Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Nov 2013 00:45:17 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r257933 - head/usr.sbin/bhyve
Message-ID:  <201311110045.rAB0jH0i014363@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Mon Nov 11 00:45:17 2013
New Revision: 257933
URL: http://svnweb.freebsd.org/changeset/base/257933

Log:
  x86 platforms that use an IOAPIC route the legacy timer interrupt (IRQ0) to
  pin 2 of the IOAPIC.
  
  Add an 'Interrupt Source Override' entry to the MADT to describe this
  and start asserting interrupts on pin 2 in the 8254 device model.
  
  Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)

Modified:
  head/usr.sbin/bhyve/acpi.c
  head/usr.sbin/bhyve/pit_8254.c

Modified: head/usr.sbin/bhyve/acpi.c
==============================================================================
--- head/usr.sbin/bhyve/acpi.c	Sun Nov 10 23:48:16 2013	(r257932)
+++ head/usr.sbin/bhyve/acpi.c	Mon Nov 11 00:45:17 2013	(r257933)
@@ -259,7 +259,17 @@ basl_fwrite_madt(FILE *fp)
 	EFPRINTF(fp, "[0004]\t\tInterrupt : 00000000\n");
 	EFPRINTF(fp, "\n");
 
-	/* Override the 8259 chained vector. XXX maybe not needed */
+	/* Legacy IRQ0 is connected to pin 2 of the IOAPIC */
+	EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n");
+	EFPRINTF(fp, "[0001]\t\tLength : 0A\n");
+	EFPRINTF(fp, "[0001]\t\tBus : 00\n");
+	EFPRINTF(fp, "[0001]\t\tSource : 00\n");
+	EFPRINTF(fp, "[0004]\t\tInterrupt : 00000002\n");
+	EFPRINTF(fp, "[0002]\t\tFlags (decoded below) : 0005\n");
+	EFPRINTF(fp, "\t\t\tPolarity : 1\n");
+	EFPRINTF(fp, "\t\t\tTrigger Mode : 1\n");
+	EFPRINTF(fp, "\n");
+
 	EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n");
 	EFPRINTF(fp, "[0001]\t\tLength : 0A\n");
 	EFPRINTF(fp, "[0001]\t\tBus : 00\n");

Modified: head/usr.sbin/bhyve/pit_8254.c
==============================================================================
--- head/usr.sbin/bhyve/pit_8254.c	Sun Nov 10 23:48:16 2013	(r257932)
+++ head/usr.sbin/bhyve/pit_8254.c	Mon Nov 11 00:45:17 2013	(r257933)
@@ -106,8 +106,8 @@ pit_mevent_cb(int fd, enum ev_type type,
 
 	pit_mev_count++;
 
-	ioapic_assert_pin(c->ctx, 0);
-	ioapic_deassert_pin(c->ctx, 0);
+	ioapic_assert_pin(c->ctx, 2);
+	ioapic_deassert_pin(c->ctx, 2);
 
 	/*
 	 * Delete the timer for one-shots



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311110045.rAB0jH0i014363>