Re: [patch 16/20] perf/x86/intel: Drop get_online_cpus() in intel_snb_check_microcode()

From: Borislav Petkov
Date: Tue Apr 18 2017 - 07:28:12 EST


On Sat, Apr 15, 2017 at 07:01:23PM +0200, Thomas Gleixner wrote:
> From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
>
> If intel_snb_check_microcode() is invoked via
> microcode_init -> perf_check_microcode -> intel_snb_check_microcode
>
> then get_online_cpus() is invoked nested. This works with the current
> implementation of get_online_cpus() but prevents converting it to a percpu
> rwsem.
>
> intel_snb_check_microcode() is also invoked from intel_sandybridge_quirk()
> unprotected.
>
> Drop get_online_cpus() from intel_snb_check_microcode() and add it to
> intel_sandybridge_quirk() so both call sites are protected.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: x86@xxxxxxxxxx

Acked-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.