All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/IO-APIC: adjust setting of destinations
@ 2015-11-13 15:44 Jan Beulich
  2015-11-13 16:26 ` Andrew Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2015-11-13 15:44 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Keir Fraser

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

setup_IO_APIC_irqs() runs before APs get brought up, so using
desc->arch.cpu_mask as best risks it being either empty or having bits
for CPUs other than the BP set. Just use the APIC ID of the only
online CPU directly. Replace a stray hard_smp_processor_id() at once.

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, cpu_mask_to_apicid(desc->arch.cpu_mask));
+            SET_DEST(entry, logical, get_apic_id());
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_CPUS);
@@ -1843,7 +1843,7 @@ static void __init unlock_ExtINT_logic(v
 
     entry1.dest_mode = 0;			/* physical delivery */
     entry1.mask = 0;			/* unmask IRQ now */
-    SET_DEST(entry1, physical, hard_smp_processor_id());
+    SET_DEST(entry1, physical, get_apic_id());
     entry1.delivery_mode = dest_ExtINT;
     entry1.polarity = entry0.polarity;
     entry1.trigger = 0;




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

x86/IO-APIC: adjust setting of destinations

setup_IO_APIC_irqs() runs before APs get brought up, so using
desc->arch.cpu_mask as best risks it being either empty or having bits
for CPUs other than the BP set. Just use the APIC ID of the only
online CPU directly. Replace a stray hard_smp_processor_id() at once.

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, cpu_mask_to_apicid(desc->arch.cpu_mask));
+            SET_DEST(entry, logical, get_apic_id());
             spin_lock_irqsave(&ioapic_lock, flags);
             __ioapic_write_entry(apic, pin, 0, entry);
             set_native_irq_info(irq, TARGET_CPUS);
@@ -1843,7 +1843,7 @@ static void __init unlock_ExtINT_logic(v
 
     entry1.dest_mode = 0;			/* physical delivery */
     entry1.mask = 0;			/* unmask IRQ now */
-    SET_DEST(entry1, physical, hard_smp_processor_id());
+    SET_DEST(entry1, physical, get_apic_id());
     entry1.delivery_mode = dest_ExtINT;
     entry1.polarity = entry0.polarity;
     entry1.trigger = 0;

[-- 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] 4+ messages in thread

* Re: [PATCH] x86/IO-APIC: adjust setting of destinations
  2015-11-13 15:44 [PATCH] x86/IO-APIC: adjust setting of destinations Jan Beulich
@ 2015-11-13 16:26 ` Andrew Cooper
  2015-11-13 17:41   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2015-11-13 16:26 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Keir Fraser

On 13/11/15 15:44, Jan Beulich wrote:
> setup_IO_APIC_irqs() runs before APs get brought up, so using
> desc->arch.cpu_mask as best risks it being either empty or having bits
> for CPUs other than the BP set. Just use the APIC ID of the only
> online CPU directly. Replace a stray hard_smp_processor_id() at once.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Surely this stray hard_smp_processor_id() needs to be merged into your
previous patch to remove hard_smp_processor_id() ?

As for the setup_IO_APIC_irqs() change, 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, cpu_mask_to_apicid(desc->arch.cpu_mask));
> +            SET_DEST(entry, logical, get_apic_id());
>              spin_lock_irqsave(&ioapic_lock, flags);
>              __ioapic_write_entry(apic, pin, 0, entry);
>              set_native_irq_info(irq, TARGET_CPUS);
> @@ -1843,7 +1843,7 @@ static void __init unlock_ExtINT_logic(v
>  
>      entry1.dest_mode = 0;			/* physical delivery */
>      entry1.mask = 0;			/* unmask IRQ now */
> -    SET_DEST(entry1, physical, hard_smp_processor_id());
> +    SET_DEST(entry1, physical, get_apic_id());
>      entry1.delivery_mode = dest_ExtINT;
>      entry1.polarity = entry0.polarity;
>      entry1.trigger = 0;
>
>
>

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

* Re: [PATCH] x86/IO-APIC: adjust setting of destinations
  2015-11-13 16:26 ` Andrew Cooper
@ 2015-11-13 17:41   ` Jan Beulich
  2015-11-13 17:43     ` Andrew Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2015-11-13 17:41 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Keir Fraser

>>> On 13.11.15 at 17:26, <andrew.cooper3@citrix.com> wrote:
> On 13/11/15 15:44, Jan Beulich wrote:
>> setup_IO_APIC_irqs() runs before APs get brought up, so using
>> desc->arch.cpu_mask as best risks it being either empty or having bits
>> for CPUs other than the BP set. Just use the APIC ID of the only
>> online CPU directly. Replace a stray hard_smp_processor_id() at once.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Surely this stray hard_smp_processor_id() needs to be merged into your
> previous patch to remove hard_smp_processor_id() ?

Actually I should have said that the other one depends on this one.
Which one to put that hunk in really doesn't matter much.

Jan

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

* Re: [PATCH] x86/IO-APIC: adjust setting of destinations
  2015-11-13 17:41   ` Jan Beulich
@ 2015-11-13 17:43     ` Andrew Cooper
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2015-11-13 17:43 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Keir Fraser

On 13/11/15 17:41, Jan Beulich wrote:
>>>> On 13.11.15 at 17:26, <andrew.cooper3@citrix.com> wrote:
>> On 13/11/15 15:44, Jan Beulich wrote:
>>> setup_IO_APIC_irqs() runs before APs get brought up, so using
>>> desc->arch.cpu_mask as best risks it being either empty or having bits
>>> for CPUs other than the BP set. Just use the APIC ID of the only
>>> online CPU directly. Replace a stray hard_smp_processor_id() at once.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> Surely this stray hard_smp_processor_id() needs to be merged into your
>> previous patch to remove hard_smp_processor_id() ?
> Actually I should have said that the other one depends on this one.
> Which one to put that hunk in really doesn't matter much.

It would be cleaner to deal with all hard_smp_processor_id() together,
as the other hunk is this patch is a far more clear candidate for backport.

~Andrew

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

end of thread, other threads:[~2015-11-13 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 15:44 [PATCH] x86/IO-APIC: adjust setting of destinations Jan Beulich
2015-11-13 16:26 ` Andrew Cooper
2015-11-13 17:41   ` Jan Beulich
2015-11-13 17:43     ` 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.