diff mbox series

[v2,3/5] x86/smp: perform disabling on interrupts ahead of AP shutdown

Message ID 20250206150615.52052-4-roger.pau@citrix.com (mailing list archive)
State Superseded
Headers show
Series xen/x86: prevent local APIC errors at shutdown | expand

Commit Message

Roger Pau Monne Feb. 6, 2025, 3:06 p.m. UTC
Move the disabling of interrupt sources so it's done ahead of the offlining
of APs.  This is to prevent AMD systems triggering "Receive accept error"
when interrupts target CPUs that are no longer online.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/arch/x86/smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Beulich Feb. 10, 2025, 10:24 a.m. UTC | #1
On 06.02.2025 16:06, Roger Pau Monne wrote:
> Move the disabling of interrupt sources so it's done ahead of the offlining
> of APs.  This is to prevent AMD systems triggering "Receive accept error"
> when interrupts target CPUs that are no longer online.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Changes since v1:
>  - New in this version.

Ah, you decided to effectively split the original patch.

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with a question:

> --- a/xen/arch/x86/smp.c
> +++ b/xen/arch/x86/smp.c
> @@ -374,6 +374,8 @@ void smp_send_stop(void)
>          smp_call_function(stop_this_cpu, &stop_aps, 0);
>  
>      local_irq_disable();
> +    disable_IO_APIC();
> +    hpet_disable();

Is this then taking care of the bogus error interrupt observing ESR=0x00?

Jan
Roger Pau Monne Feb. 10, 2025, 10:47 a.m. UTC | #2
On Mon, Feb 10, 2025 at 11:24:58AM +0100, Jan Beulich wrote:
> On 06.02.2025 16:06, Roger Pau Monne wrote:
> > Move the disabling of interrupt sources so it's done ahead of the offlining
> > of APs.  This is to prevent AMD systems triggering "Receive accept error"
> > when interrupts target CPUs that are no longer online.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Changes since v1:
> >  - New in this version.
> 
> Ah, you decided to effectively split the original patch.
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> with a question:
> 
> > --- a/xen/arch/x86/smp.c
> > +++ b/xen/arch/x86/smp.c
> > @@ -374,6 +374,8 @@ void smp_send_stop(void)
> >          smp_call_function(stop_this_cpu, &stop_aps, 0);
> >  
> >      local_irq_disable();
> > +    disable_IO_APIC();
> > +    hpet_disable();
> 
> Is this then taking care of the bogus error interrupt observing ESR=0x00?

This, with the extra commits that follow should prevent the error from
triggering yes.  With all patches in the series applied I'm no longer
able to see the ESR=0x00 message.

Thanks, Roger.
diff mbox series

Patch

diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
index 074baae2cc3b..f931db0d71c6 100644
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -374,6 +374,8 @@  void smp_send_stop(void)
         smp_call_function(stop_this_cpu, &stop_aps, 0);
 
     local_irq_disable();
+    disable_IO_APIC();
+    hpet_disable();
 
     if ( num_online_cpus() > 1 )
     {
@@ -389,8 +391,6 @@  void smp_send_stop(void)
 
     if ( cpu_online(cpu) )
     {
-        disable_IO_APIC();
-        hpet_disable();
         __stop_this_cpu();
         x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC);
     }