public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
Cc: kvm-devel
	<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Laurent Vivier <Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
Subject: Re: FreeBSD image hangs during boot
Date: Mon, 08 Oct 2007 09:57:19 +0200	[thread overview]
Message-ID: <4709E2DF.10701@qumranet.com> (raw)
In-Reply-To: <20071005135122.GA17767-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

Aurelien Jarno wrote:
>
> It's actually described page 200 of the specifications (page 216 in 
> ACPIspec30.pdf):
>
>   Note: This descriptor is meant for describing interrupts that are connected to PIC-compatible
>   interrupt controllers, which can only be programmed for Active-High-Edge-Triggered or Active-
>   Low-Level-Triggered interrupts. Any other combination is illegal. The Extended Interrupt
>   Descriptor can be used to describe other combinations.
>
>
>   
>> Avi, if you think this anlysis is correct I can provide the patch changing
>> "Level" to "Edge"...
>>
>>     
>
> It looks like the solution is either to describe the IRQ with an 
> "Extended Interrupt Descriptor" or to change this value to one of the 
> two allowed values. In the later case we have to make sure it is
> consistent with the way the PIC works.
>
>   

The attached patch attempts to override the pci irqs (now limited to 5, 
9, 10, and 11) to be active high level triggered.  Linux boots and 
parses this correctly.  Freebsd still fails.


-- 
Any sufficiently difficult bug is indistinguishable from a feature.


[-- Attachment #2: iso.patch --]
[-- Type: text/x-patch, Size: 1742 bytes --]

diff --git a/bios/rombios32.c b/bios/rombios32.c
index 314df94..65d6207 100755
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -1181,6 +1181,14 @@ struct madt_io_apic
 			  * lines start */
 };
 
+struct madt_interrupt_source_override {
+	APIC_HEADER_DEF
+	uint8_t bus;
+	uint8_t source;
+	uint32_t gsi;
+	uint16_t flags;
+} __attribute__((__packed__));
+
 #include "acpi-dsdt.hex"
 
 static inline uint16_t cpu_to_le16(uint16_t x)
@@ -1273,7 +1281,8 @@ void acpi_bios_init(void)
     madt_addr = addr;
     madt_size = sizeof(*madt) + 
         sizeof(struct madt_processor_apic) * smp_cpus +
-        sizeof(struct madt_io_apic);
+        sizeof(struct madt_io_apic) +
+	sizeof(struct madt_interrupt_source_override) * 4;
     madt = (void *)(addr);
     addr += madt_size;
 
@@ -1335,6 +1344,8 @@ void acpi_bios_init(void)
     {
         struct madt_processor_apic *apic;
         struct madt_io_apic *io_apic;
+        struct madt_interrupt_source_override *iso;
+	static int pci_irq[4] = { 5, 9, 10, 11 };
 
         memset(madt, 0, madt_size);
         madt->local_apic_address = cpu_to_le32(0xfee00000);
@@ -1354,6 +1365,17 @@ void acpi_bios_init(void)
         io_apic->io_apic_id = smp_cpus;
         io_apic->address = cpu_to_le32(0xfec00000);
         io_apic->interrupt = cpu_to_le32(0);
+	io_apic++;
+	iso = (void *)io_apic;
+	for (i = 0; i < 4; ++i) {
+	    iso->type = APIC_XRUPT_OVERRIDE;
+	    iso->length = sizeof(*iso);
+	    iso->bus = 0;
+	    iso->source = pci_irq[i];
+	    iso->gsi = cpu_to_le32(iso->source);
+	    iso->flags = cpu_to_le16(0xd); // active high level trigger
+	    ++iso;
+	}
 
         acpi_build_table_header((struct acpi_table_header *)madt, 
                                 "APIC", madt_size);

[-- Attachment #3: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  parent reply	other threads:[~2007-10-08  7:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 11:41 FreeBSD image hangs during boot Aurelien Jarno
     [not found] ` <47022E7E.3030509-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-02 11:53   ` Laurent Vivier
     [not found]     ` <47023130.6000805-6ktuUTfB/bM@public.gmane.org>
2007-10-02 12:18       ` Aurelien Jarno
2007-10-02 12:09   ` Avi Kivity
     [not found]     ` <470234DF.6030802-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-02 12:21       ` Aurelien Jarno
     [not found]         ` <470237DC.5060008-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-02 12:38           ` Avi Kivity
     [not found]             ` <47023BBB.3020806-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-10 20:42               ` Aurelien Jarno
2007-10-02 16:27           ` Avi Kivity
     [not found]             ` <47027161.50004-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-02 16:44               ` Aurelien Jarno
     [not found]                 ` <47027586.9020508-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-02 17:04                   ` Aurelien Jarno
     [not found]                     ` <47027A01.5080903-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-02 17:25                       ` Aurelien Jarno
     [not found]                         ` <47027F25.80001-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-10 11:17                           ` Avi Kivity
     [not found]                             ` <470CB4DE.20707-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-10 11:27                               ` Aurelien Jarno
     [not found]                                 ` <470CB709.5050205-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-10 11:29                                   ` Avi Kivity
2007-10-10 13:21                               ` Aurelien Jarno
     [not found]                                 ` <470CD1F1.20305-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-10-10 13:22                                   ` Avi Kivity
     [not found]                                     ` <470CD22C.5050003-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-10 13:47                                       ` Aurelien Jarno
     [not found]                                         ` <470CD7DF.2020906-rXXEIb44qovR7s880joybQ@public.gmane.org>
2007-11-08  6:41                                           ` Avi Kivity
     [not found]                                             ` <4732AF9B.9010201-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08  9:44                                               ` Aurelien Jarno
2007-10-03 12:18               ` Laurent Vivier
2007-10-02 12:26       ` Laurent Vivier
     [not found]         ` <4702390F.9070809-6ktuUTfB/bM@public.gmane.org>
2007-10-02 12:59           ` Aurelien Jarno
2007-10-05 13:25   ` Laurent Vivier
     [not found]     ` <47063B31.6000001-6ktuUTfB/bM@public.gmane.org>
2007-10-05 13:51       ` Aurelien Jarno
     [not found]         ` <20071005135122.GA17767-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-10-05 16:06           ` Laurent Vivier
2007-10-05 16:07           ` Avi Kivity
     [not found]             ` <47066153.2040406-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-05 16:36               ` Avi Kivity
2007-10-06  8:38               ` Laurent Vivier
     [not found]                 ` <47074989.9080100-6ktuUTfB/bM@public.gmane.org>
2007-10-06 19:31                   ` Avi Kivity
2007-10-08  7:57           ` Avi Kivity [this message]
     [not found]             ` <4709E2DF.10701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-08  8:21               ` Laurent Vivier
     [not found]                 ` <4709E896.1090806-6ktuUTfB/bM@public.gmane.org>
2007-10-08  9:39                   ` Avi Kivity
     [not found]                     ` <4709FAC1.8050502-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-08 10:35                       ` Laurent Vivier
     [not found]                         ` <470A07FC.80407-6ktuUTfB/bM@public.gmane.org>
2007-10-08 10:47                           ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4709E2DF.10701@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=Laurent.Vivier-6ktuUTfB/bM@public.gmane.org \
    --cc=aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox