All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/IO-APIC: fix setting of destinations
@ 2015-11-19  9:46 Jan Beulich
  2015-11-19 14:19 ` Boris Ostrovsky
  2015-11-19 14:39 ` Andrew Cooper
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-11-19  9:46 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Keir Fraser

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

In commit a85da715cf ("x86/IO-APIC: adjust setting of destinations") I
made a pretty blatant mistake: get_apic_id() can be used there only
when running APICs in physical mode. For both flat and clustered modes
the change was wrong, causing different kinds of boot problems on
affected systems. Don't revert that change though, but use TARGET_CPUS
(equaling cpu_online_map, and with there only being a single online CPU
fulfilling the original commits intention).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(vo
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry, logical, get_apic_id());
+            SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_CPUS);




[-- Attachment #2: x86-IO-APIC-setup-IRQs-fix.patch --]
[-- Type: text/plain, Size: 1079 bytes --]

x86/IO-APIC: fix setting of destinations

In commit a85da715cf ("x86/IO-APIC: adjust setting of destinations") I
made a pretty blatant mistake: get_apic_id() can be used there only
when running APICs in physical mode. For both flat and clustered modes
the change was wrong, causing different kinds of boot problems on
affected systems. Don't revert that change though, but use TARGET_CPUS
(equaling cpu_online_map, and with there only being a single online CPU
fulfilling the original commits intention).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(vo
                 disable_8259A_irq(irq_to_desc(irq));
 
             desc = irq_to_desc(irq);
-            SET_DEST(entry, logical, get_apic_id());
+            SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_CPUS);

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/IO-APIC: fix setting of destinations
  2015-11-19  9:46 [PATCH] x86/IO-APIC: fix setting of destinations Jan Beulich
@ 2015-11-19 14:19 ` Boris Ostrovsky
  2015-11-19 14:39 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2015-11-19 14:19 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Cooper, Keir Fraser

On 11/19/2015 04:46 AM, Jan Beulich wrote:
> In commit a85da715cf ("x86/IO-APIC: adjust setting of destinations") I
> made a pretty blatant mistake: get_apic_id() can be used there only
> when running APICs in physical mode. For both flat and clustered modes
> the change was wrong, causing different kinds of boot problems on
> affected systems. Don't revert that change though, but use TARGET_CPUS
> (equaling cpu_online_map, and with there only being a single online CPU
> fulfilling the original commits intention).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(vo
>                   disable_8259A_irq(irq_to_desc(irq));
>   
>               desc = irq_to_desc(irq);
> -            SET_DEST(entry, logical, get_apic_id());
> +            SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
>               spin_lock_irqsave(&ioapic_lock, flags);
>               __ioapic_write_entry(apic, pin, 0, entry);
>               set_native_irq_info(irq, TARGET_CPUS);


Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

(One of our systems started failing and I bisected it yesterday to 
a85da715c but didn't get to actually debug it. Now I don't need to).

-boris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/IO-APIC: fix setting of destinations
  2015-11-19  9:46 [PATCH] x86/IO-APIC: fix setting of destinations Jan Beulich
  2015-11-19 14:19 ` Boris Ostrovsky
@ 2015-11-19 14:39 ` Andrew Cooper
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-11-19 14:39 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Keir Fraser

On 19/11/15 09:46, Jan Beulich wrote:
> In commit a85da715cf ("x86/IO-APIC: adjust setting of destinations") I
> made a pretty blatant mistake: get_apic_id() can be used there only
> when running APICs in physical mode. For both flat and clustered modes
> the change was wrong, causing different kinds of boot problems on
> affected systems. Don't revert that change though, but use TARGET_CPUS
> (equaling cpu_online_map, and with there only being a single online CPU
> fulfilling the original commits intention).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

I also missed that while reviewing.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -1039,7 +1039,7 @@ static void __init setup_IO_APIC_irqs(vo
>                  disable_8259A_irq(irq_to_desc(irq));
>  
>              desc = irq_to_desc(irq);
> -            SET_DEST(entry, logical, get_apic_id());
> +            SET_DEST(entry, logical, cpu_mask_to_apicid(TARGET_CPUS));
>              spin_lock_irqsave(&ioapic_lock, flags);
>              __ioapic_write_entry(apic, pin, 0, entry);
>              set_native_irq_info(irq, TARGET_CPUS);
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-19 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-19  9:46 [PATCH] x86/IO-APIC: fix setting of destinations Jan Beulich
2015-11-19 14:19 ` Boris Ostrovsky
2015-11-19 14:39 ` Andrew Cooper

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.