]> Gentwo Git Trees - linux/.git/commit
KVM: x86: Add helper to retrieve current value of user return MSR
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Tue, 23 Sep 2025 15:37:37 +0000 (08:37 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 23 Sep 2025 15:55:20 +0000 (08:55 -0700)
commit9bc366350734246301b090802fc71f9924daad39
tree9a786961efa1a2979a055ca2c9713c1752cd710f
parent5b66e335ead6472f336b4d7d9cbf14488b844f27
KVM: x86: Add helper to retrieve current value of user return MSR

In the user return MSR support, the cached value is always the hardware
value of the specific MSR. Therefore, add a helper to retrieve the
cached value, which can replace the need for RDMSR, for example, to
allow SEV-ES guests to restore the correct host hardware value without
using RDMSR.

Cc: stable@vger.kernel.org
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
[sean: drop "cache" from the name, make it a one-liner, tag for stable]
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250923153738.1875174-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c