]> git.baikalelectronics.ru Git - kernel.git/commit
x86/pm: Save the MSR validity status at context setup
authorPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Tue, 5 Apr 2022 00:34:19 +0000 (17:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Apr 2022 17:18:31 +0000 (10:18 -0700)
commita754861978c56d7e96457ab8747cde458607fb09
tree0c5eb4ae4a5b8ef0d7895df78beb565aa1bc915f
parent13b1e5b2893a189fbe22ae7871a2a92c4d498cde
x86/pm: Save the MSR validity status at context setup

The mechanism to save/restore MSRs during S3 suspend/resume checks for
the MSR validity during suspend, and only restores the MSR if its a
valid MSR.  This is not optimal, as an invalid MSR will unnecessarily
throw an exception for every suspend cycle.  The more invalid MSRs,
higher the impact will be.

Check and save the MSR validity at setup.  This ensures that only valid
MSRs that are guaranteed to not throw an exception will be attempted
during suspend.

Fixes: f49dc225f873 ("x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume")
Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/power/cpu.c