All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "M. Nunberg" <mnunberg@haskalah.org>
Cc: xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: pvops acpi and xen 4  issues
Date: Wed, 10 Mar 2010 15:48:04 -0800	[thread overview]
Message-ID: <4B982FB4.4040800@goop.org> (raw)
In-Reply-To: <1268250249.7980.10.camel@debmed>

On 03/10/2010 11:44 AM, M. Nunberg wrote:
> On Mon, 2010-03-08 at 15:02 -0500, Konrad Rzeszutek Wilk wrote:
>    
>>> 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)
>>      
> acpi_sci_ioapic_setup: 0 ->  20 (3, 3)
>    
>> ...
>> [    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
>>      
> NR_IRQS:4352 nr_irqs:4096
> xen: registering gsi 0 triggering 1 polarity 0
> xen: -->  irq=0
> Already setup the GSI :0
> xen: registering gsi 1 triggering 1 polarity 0
> xen: -->  irq=1
> Already setup the GSI :1
> xen: registering gsi 2 triggering 1 polarity 0
> xen: -->  irq=2
> Already setup the GSI :2
> xen: registering gsi 3 triggering 1 polarity 0
> xen: -->  irq=3
> Already setup the GSI :3
> xen: registering gsi 4 triggering 1 polarity 0
> xen: -->  irq=4
> Already setup the GSI :4
> xen: registering gsi 5 triggering 1 polarity 0
> xen: -->  irq=5
> Already setup the GSI :5
> xen: registering gsi 6 triggering 1 polarity 0
> xen: -->  irq=6
> Already setup the GSI :6
> xen: registering gsi 7 triggering 1 polarity 0
> xen: -->  irq=7
> Already setup the GSI :7
> xen: registering gsi 8 triggering 1 polarity 0
> xen: -->  irq=8
> Already setup the GSI :8
> xen: registering gsi 9 triggering 1 polarity 0
> xen: -->  irq=9
> Already setup the GSI :9
> xen: registering gsi 10 triggering 1 polarity 0
> xen: -->  irq=10
> Already setup the GSI :10
> xen: registering gsi 11 triggering 1 polarity 0
> xen: -->  irq=11
> Already setup the GSI :11
> xen: registering gsi 12 triggering 1 polarity 0
> xen: -->  irq=12
> Already setup the GSI :12
> xen: registering gsi 13 triggering 1 polarity 0
> xen: -->  irq=13
> Already setup the GSI :13
> xen: registering gsi 14 triggering 1 polarity 0
> xen: -->  irq=14
> Already setup the GSI :14
> xen: registering gsi 15 triggering 1 polarity 0
> xen: -->  irq=15
> Already setup the GSI :15
> xen_setup_pirqs: FADT.SCI: 9 ACPI.SCI:20. Using IRQ 20.
> xen_setup_pirqs: acpi_get_override_irq fails for 20.
> xen_setup_pirqs: SCI override: trigger: level->edge, polarity: high->low
> xen: registering gsi 20 triggering 0 polarity 1
>    alloc irq_desc for 20 on node 0
>    alloc kstat_irqs on node 0
> xen: -->  irq=20
> (XEN) IOAPIC[0]: Set PCI routing entry (8-20 ->  0x98 ->  IRQ 20 Mode:1 Active:1)
> Console: colour VGA+ 80x25
> ....
>    
>> [    1.511254] Already setup the GSI :9
>>      
> And as you predicted, this line did not show up for 20
>    
>> .. and then later:
>> [    3.058890] ACPI: Core revision 20090903
>> [    3.084701] acpi_early_init: FADT.SCI = 9
>>      
> s/9/20, again
>    
>> .. and then lots of ACPI debug stuff.
>>      
> In the log.
>    
>> 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).
>>      
> All in all, I think it did work. From a novice's perspective (like mine), This message:
> 	ACPI: Interpreter enabled
> was missing when SCI was enabled in the BIOS, but with your patch, it is present.
> I am attaching the full log as a bz2 compressed textfile, as the last time I tried to send something with wide lines, something gobbled it up, though I think the relevant info is inline
>    

Could you try this patch? (Already committed to xen/next, as it works 
for me.)

Thanks,
     J

 From 06ab9af4e7beaf2bcafae4e390b4a51908dfd29e Mon Sep 17 00:00:00 2001
From: Jeremy Fitzhardinge<jeremy.fitzhardinge@citrix.com>
Date: Wed, 10 Mar 2010 15:44:21 -0800
Subject: [PATCH] Merge branch 'xen/dom0/apic-next' into xen/next

* xen/dom0/apic-next:
   xen: parse MADT to get information to set up ACPI SCI

: abulafia:pts/0; git show d02659fd69312e5ff9890c1c7ca2bea9a782ad57
 From d02659fd69312e5ff9890c1c7ca2bea9a782ad57 Mon Sep 17 00:00:00 2001
From: Jeremy Fitzhardinge<jeremy.fitzhardinge@citrix.com>
Date: Wed, 10 Mar 2010 13:07:15 -0800
Subject: [PATCH] xen: parse MADT to get information to set up ACPI SCI

If the SCI is not in its traditional place of irq 9/gsi 9, then we
need to set it up properly.

Signed-off-by: Jeremy Fitzhardinge<jeremy.fitzhardinge@citrix.com>

diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
index f999ad8..a2accf4 100644
--- a/arch/x86/xen/pci.c
+++ b/arch/x86/xen/pci.c
@@ -70,6 +70,97 @@ int xen_register_gsi(u32 gsi, int triggering, int polarity)
  	return irq;
  }

+#ifdef CONFIG_ACPI
+#define BAD_MADT_ENTRY(entry, end) (					    \
+		(!entry) || (unsigned long)entry + sizeof(*entry)>  end ||  \
+		((struct acpi_subtable_header *)entry)->length<  sizeof(*entry))
+
+
+static int __init
+xen_acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
+			   const unsigned long end)
+{
+	struct acpi_madt_interrupt_override *intsrc = NULL;
+
+	intsrc = (struct acpi_madt_interrupt_override *)header;
+
+	if (BAD_MADT_ENTRY(intsrc, end))
+		return -EINVAL;
+
+	acpi_table_print_madt_entry(header);
+
+	if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) {
+		int gsi;
+		int trigger, polarity;
+
+		trigger = intsrc->inti_flags&  ACPI_MADT_TRIGGER_MASK;
+		polarity = intsrc->inti_flags&  ACPI_MADT_POLARITY_MASK;
+
+		/* Command-line over-ride via acpi_sci= */
+		if (acpi_sci_flags&  ACPI_MADT_TRIGGER_MASK)
+			trigger = acpi_sci_flags&  ACPI_MADT_TRIGGER_MASK;
+
+		if (acpi_sci_flags&  ACPI_MADT_POLARITY_MASK)
+			polarity = acpi_sci_flags&  ACPI_MADT_POLARITY_MASK;
+
+		printk("xen: sci override: source_irq=%d global_irq=%d trigger=%x polarity=%x\n",
+			intsrc->source_irq, intsrc->global_irq,
+			trigger, polarity);
+
+		switch (polarity) {
+		case ACPI_MADT_POLARITY_CONFORMS:
+		case ACPI_MADT_POLARITY_ACTIVE_LOW:
+			polarity = ACPI_ACTIVE_LOW;
+			break;
+
+		case ACPI_MADT_POLARITY_ACTIVE_HIGH:
+			polarity = ACPI_ACTIVE_HIGH;
+			break;
+
+		default:
+			return 0;
+		}
+
+		switch (trigger) {
+		case ACPI_MADT_TRIGGER_CONFORMS:
+		case ACPI_MADT_TRIGGER_LEVEL:
+			trigger = ACPI_LEVEL_SENSITIVE;
+			break;
+
+		case ACPI_MADT_TRIGGER_EDGE:
+			trigger = ACPI_EDGE_SENSITIVE;
+			break;
+
+		default:
+			return 0;
+		}
+
+		gsi = xen_register_gsi(intsrc->global_irq,
+				       trigger, polarity);
+		/*
+		 * stash over-ride to indicate we've been here
+		 * and for later update of acpi_gbl_FADT
+		 */
+		acpi_sci_override_gsi = gsi;
+
+		printk("xen: acpi sci %d\n", gsi);
+	}
+
+	return 0;
+}
+
+static __init void xen_setup_acpi_sci(void)
+{
+  acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE,
+			xen_acpi_parse_int_src_ovr,
+			nr_irqs);
+}
+#else
+static __init void xen_setup_acpi_sci(void)
+{
+}
+#endif
+
  void __init xen_setup_pirqs(void)
  {
  	int irq;
@@ -91,6 +182,8 @@ void __init xen_setup_pirqs(void)
  			trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE,
  			polarity ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH);
  	}
+
+	xen_setup_acpi_sci();
  }

  #ifdef CONFIG_PCI_MSI

      reply	other threads:[~2010-03-10 23:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-26 20:33 pvops acpi and xen 4 issues M. Nunberg
2010-02-26 23:23 ` Jeremy Fitzhardinge
2010-02-27  2:22   ` M. Nunberg
2010-03-01 16:13     ` Konrad Rzeszutek Wilk
2010-03-04 22:04       ` M. Nunberg
2010-03-08 20:02         ` Konrad Rzeszutek Wilk
2010-03-10 19:44           ` M. Nunberg
2010-03-10 23:48             ` Jeremy Fitzhardinge [this message]

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=4B982FB4.4040800@goop.org \
    --to=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=mnunberg@haskalah.org \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.