Re: [PATCH v3 2/2] x86/pm: Add enumeration check before spec MSRs save/restore setup

From: Dave Hansen
Date: Fri Nov 18 2022 - 13:12:39 EST


On 11/15/22 11:17, Pawan Gupta wrote:
> To fix this, add the corresponding X86_FEATURE bit for each MSR. Avoid
> trying to manipulate the MSR when the feature bit is clear. This
> required adding a X86_FEATURE bit for MSRs that do not have one already,
> but it's a small price to pay.
>
> Fixes: 73924ec4d560 ("x86/pm: Save the MSR validity status at context setup")
> Reported-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxx

Thanks for fixing this up. The X86_FEATURE approach is a good one. The
"poking at random MSRs" always seemed a bit wonky.

Reviewed-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>