We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e8037b commit 1828688Copy full SHA for 1828688
arch/x86/kernel/cpu/mshyperv.c
@@ -262,11 +262,14 @@ static uint32_t __init ms_hyperv_platform(void)
262
static int hv_nmi_unknown(unsigned int val, struct pt_regs *regs)
263
{
264
static atomic_t nmi_cpu = ATOMIC_INIT(-1);
265
+ unsigned int old_cpu, this_cpu;
266
267
if (!unknown_nmi_panic)
268
return NMI_DONE;
269
- if (atomic_cmpxchg(&nmi_cpu, -1, raw_smp_processor_id()) != -1)
270
+ old_cpu = -1;
271
+ this_cpu = raw_smp_processor_id();
272
+ if (!atomic_try_cmpxchg(&nmi_cpu, &old_cpu, this_cpu))
273
return NMI_HANDLED;
274
275
0 commit comments