]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86: Add a helper to dedup loading guest/host XCR0 and XSS
authorBinbin Wu <binbin.wu@linux.intel.com>
Mon, 10 Nov 2025 05:05:39 +0000 (13:05 +0800)
committerSean Christopherson <seanjc@google.com>
Wed, 19 Nov 2025 13:41:12 +0000 (05:41 -0800)
commit0b28f21ad46200fec9f8b8058692902d0de98221
tree85a1e6f762e3c2adb150b4a40cbe61e401b8963b
parent7649412af3eab700037feb14822d03eba484c576
KVM: x86: Add a helper to dedup loading guest/host XCR0 and XSS

Add and use a helper, kvm_load_xfeatures(), to dedup the code that loads
guest/host xfeatures.

Opportunistically return early if X86_CR4_OSXSAVE is not set to reduce
indentations.

No functional change intended.

Suggested-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Chao Gao <chao.gao@intel.com>
Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://patch.msgid.link/20251110050539.3398759-1-binbin.wu@linux.intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c