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

From: Pawan Gupta
Date: Fri Nov 18 2022 - 13:29:48 EST


On Fri, Nov 18, 2022 at 10:12:32AM -0800, Dave Hansen wrote:
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>

Thanks.