From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: pvops acpi and xen 4 issues Date: Mon, 8 Mar 2010 15:02:26 -0500 Message-ID: <20100308200226.GA16759@phenom.dumpdata.com> References: <1267216422.31593.15.camel@debmed> <4B8857DD.2050300@goop.org> <1267237361.7978.10.camel@debmed> <20100301161336.GC7881@phenom.dumpdata.com> <1267740285.10743.4.camel@debmed> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vkogqOf2sHV7VnPd" Return-path: Content-Disposition: inline In-Reply-To: <1267740285.10743.4.camel@debmed> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "M. Nunberg" Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > make sure it was indeed being called. I think this might have something > to do with what Jeremy mentioned about my SCI being on 9 and not 20, but > honestly, I haven't a clue. I have the full log if you need more. I am attaching a debug patch that will help in troubleshooting this and potentially fix this. Couple of things: 1). Turn the Enable ACPI SCI in the BIOS to Enable. 2). Compile your Linux kernel with the attached patch and these two options: CONFIG_ACPI_DEBUG=y CONFIG_ACPI_DEBUG_FUNC_TRACE=y Do use your old .config that was triggering the failure in the first case. 3). Edit your kernel line to have: debug initcall_debug acpi.debug_level=0xffffffff acpi.debug_layer=0x2 xen_sci=fun 4). Boot your kernel. You should see something like this: ... snip.. [ 0.000000] acpi_sci_ioapic_setup: 0 -> 9 (3, 1) ... [ 1.483956] xen_setup_pirqs: FADT.SCI: 9 ACPI.SCI:9. Using 9 IRQ, [ 1.490025] xen_setup_pirqs: SCI override: trigger: level->level, polarity: high->high [ 1.497824] xen: registering gsi 9 triggering 0 polarity 0 [ 1.503282] xen_allocate_pirq: returning irq 9 for gsi 9 [ 1.508572] xen: --> irq=9 [ 1.511254] Already setup the GSI :9 .. and then later: [ 3.058890] ACPI: Core revision 20090903 [ 3.084701] acpi_early_init: FADT.SCI = 9 .. and then lots of ACPI debug stuff. Thought in your case, the IRQ that should show up is 20 and the 'Already setup the GSI :20' might not show up. Please e-mail the full serial log (even if it does work). > I used Xen 4-rc4 : xen/stable 2.6.32.9 - latest git from today. --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="debug-apic-sci.patch" diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 21fc029..128ae25 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -344,7 +344,9 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) * stash over-ride to indicate we've been here * and for later update of acpi_gbl_FADT */ + printk(KERN_INFO "%s: %d -> %d (%d, %d)\n", __FUNCTION__, acpi_sci_override_gsi, gsi, trigger, polarity); acpi_sci_override_gsi = gsi; + return; } diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c index f999ad8..4cee777 100644 --- a/arch/x86/xen/pci.c +++ b/arch/x86/xen/pci.c @@ -69,7 +69,41 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity) } return irq; } +static int xen_sci_override = 0; +static int xen_sci_trigger = ACPI_ACTIVE_LOW; +static int xen_sci_polarity = ACPI_EDGE_SENSITIVE; +static int __init +xen_sci_override_func(char *str) +{ + int val; + + while (*str) { + if (!strncmp(str, "level", 5)) { + xen_sci_trigger = ACPI_LEVEL_SENSITIVE; + str+=5; + } + if (!strncmp(str, "edge", 4)) { + xen_sci_trigger = ACPI_EDGE_SENSITIVE; + str+=4; + } + if (!strncmp(str, "high", 4)) { + xen_sci_polarity = ACPI_ACTIVE_HIGH; + str+=4; + } + if (!strncmp(str, "low", 3)) { + xen_sci_polarity = ACPI_ACTIVE_LOW; + str+=3; + } + str = strpbrk(str, ","); + if (!str) + break; + str++; /* skip ',' */ + } + xen_sci_override = 1; + return 0; +} +__setup("xen_sci=", xen_sci_override_func); void __init xen_setup_pirqs(void) { int irq; @@ -84,13 +118,56 @@ void __init xen_setup_pirqs(void) for (irq = 0; irq < NR_IRQS_LEGACY; irq++) { int trigger, polarity; - if (acpi_get_override_irq(irq, &trigger, &polarity) == -1) + if (acpi_get_override_irq(irq, &trigger, &polarity) == -1) { + printk(KERN_INFO "%s: skipping %d\n", __FUNCTION__, irq); continue; + } + xen_register_gsi(irq, + trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE, + polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH); + } + /* For SCI that is above NR_IRQS_LEGACY or xen_sci_override is turned on*/ + if ((acpi_gbl_FADT.sci_interrupt > NR_IRQS_LEGACY) || + (acpi_sci_override_gsi > NR_IRQS_LEGACY) || + (xen_sci_override)) { + + int trigger, polarity; + + irq = acpi_gbl_FADT.sci_interrupt; + + if ((acpi_sci_override_gsi > NR_IRQS_LEGACY) && + (acpi_gbl_FADT.sci_interrupt <= NR_IRQS_LEGACY)) + irq = acpi_sci_override_gsi; + + if ((acpi_sci_override_gsi <= NR_IRQS_LEGACY) && + (acpi_gbl_FADT.sci_interrupt > NR_IRQS_LEGACY)) + irq = acpi_gbl_FADT.sci_interrupt; + printk(KERN_INFO "%s: FADT.SCI: %d ACPI.SCI:%d. Using IRQ %d.\n", + __FUNCTION__, + acpi_gbl_FADT.sci_interrupt, acpi_sci_override_gsi, irq); + + if (acpi_get_override_irq(irq, &trigger, &polarity) == -1) { + printk(KERN_INFO "%s: acpi_get_override_irq fails for %d. \n", __FUNCTION__, irq); + } + if (xen_sci_override) { +#define trig2str(x) (x == ACPI_LEVEL_SENSITIVE) ? "level" : "edge" +#define pol2str(x) (x == ACPI_ACTIVE_LOW) ? "low" : "high" + printk(KERN_INFO "%s: SCI override: trigger: %s->%s, polarity: %s->%s\n", + __FUNCTION__, + trig2str(trigger), trig2str(xen_sci_trigger), + pol2str(polarity), pol2str(xen_sci_polarity)); +#undef trig2str +#undef pol2str + trigger = xen_sci_trigger; + polarity = xen_sci_polarity; + } xen_register_gsi(irq, trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE, polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH); + } + } #ifdef CONFIG_PCI_MSI diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7411915..82d60a4 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -688,6 +688,7 @@ void __init acpi_early_init(void) * update it with result from INT_SRC_OVR parsing */ acpi_gbl_FADT.sci_interrupt = acpi_sci_override_gsi; + printk(KERN_INFO "%s: FADT.SCI = %d\n", __FUNCTION__,acpi_sci_override_gsi); } #endif --vkogqOf2sHV7VnPd Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --vkogqOf2sHV7VnPd--