mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/apic: Do not use smp_processor_id() in preemptible code
@ 2017-09-26 17:08 Borislav Petkov
  2017-09-26 19:03 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Borislav Petkov @ 2017-09-26 17:08 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML

From: Borislav Petkov <bp@suse.de>

Call stack is:

  check_preemption_disabled
  ? x2apic_prepare_cpu
  x2apic_dead_cpu
  cpuhp_invoke_callback
  ? cpuhp_kick_ap_work
  ? cpumask_next
  _cpu_down
  freeze_secondary_cpus
  hibernation_snapshot
  ...

i.e., box is doing suspend-to-disk.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/apic/x2apic_cluster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index 3da94277140f..6050c5364bdc 100644
--- a/arch/x86/kernel/apic/x2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -156,7 +156,7 @@ static int x2apic_dead_cpu(unsigned int dead_cpu)
 {
 	struct cluster_mask *cmsk = per_cpu(cluster_masks, dead_cpu);
 
-	cpumask_clear_cpu(smp_processor_id(), &cmsk->mask);
+	cpumask_clear_cpu(dead_cpu, &cmsk->mask);
 	free_cpumask_var(per_cpu(ipi_mask, dead_cpu));
 	return 0;
 }
-- 
2.13.0

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

* Re: [PATCH] x86/apic: Do not use smp_processor_id() in preemptible code
  2017-09-26 17:08 [PATCH] x86/apic: Do not use smp_processor_id() in preemptible code Borislav Petkov
@ 2017-09-26 19:03 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2017-09-26 19:03 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: X86 ML, LKML

On Tue, 26 Sep 2017, Borislav Petkov wrote:

> From: Borislav Petkov <bp@suse.de>
> 
> Call stack is:
> 
>   check_preemption_disabled
>   ? x2apic_prepare_cpu
>   x2apic_dead_cpu
>   cpuhp_invoke_callback
>   ? cpuhp_kick_ap_work
>   ? cpumask_next
>   _cpu_down
>   freeze_secondary_cpus
>   hibernation_snapshot
>   ...
> 
> i.e., box is doing suspend-to-disk.
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  arch/x86/kernel/apic/x2apic_cluster.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
> index 3da94277140f..6050c5364bdc 100644
> --- a/arch/x86/kernel/apic/x2apic_cluster.c
> +++ b/arch/x86/kernel/apic/x2apic_cluster.c
> @@ -156,7 +156,7 @@ static int x2apic_dead_cpu(unsigned int dead_cpu)
>  {
>  	struct cluster_mask *cmsk = per_cpu(cluster_masks, dead_cpu);
>  
> -	cpumask_clear_cpu(smp_processor_id(), &cmsk->mask);
> +	cpumask_clear_cpu(dead_cpu, &cmsk->mask);

Duh......

>  	free_cpumask_var(per_cpu(ipi_mask, dead_cpu));
>  	return 0;
>  }
> -- 
> 2.13.0
> 
> 

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

end of thread, other threads:[~2017-09-26 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 17:08 [PATCH] x86/apic: Do not use smp_processor_id() in preemptible code Borislav Petkov
2017-09-26 19:03 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®