Re: [PATCH] x86/microcode, cpuhotplug: move microcode hotplug callback after cpu teardown

From: Thomas Gleixner
Date: Wed Jul 03 2019 - 05:17:16 EST


On Wed, 3 Jul 2019, Song liwei wrote:

> After CPUHP_TEARDOWN_CPU callback was invoked, the context will become
> atomic and IRQ disabled, while mc_cpu_down_prep will called
> kernfs_find_and_get_ns which will try to acquire mutext lock which may
> sleep.
>
> Adjust CPUHP_AP_MICROCODE_LOADER callback function run before
> CPUHP_TEARDOWN_CPU to fix this bug.

That's just wrong and reintroduces the bug which was fixed with that commit
as perf will access a non existing MSR which is brought in by the micro
code update.

Aside of that the mutex issue _is_ fixed in rc7 already:

5423f5ce5ca4 ("x86/microcode: Fix the microcode load on CPU hotplug for real")

Thanks,

tglx