aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/workqueue.c
diff options
context:
space:
mode:
authorChao Gao <[email protected]>2025-01-29 09:58:57 +0000
committerPaolo Bonzini <[email protected]>2025-03-14 18:20:54 +0000
commitd3a6b6cfb82a9158ee624bf3d43e6ebd8fe05fc8 (patch)
treea865d62ab76c803d904872f940ff1b64dde4fb05 /rust/helpers/workqueue.c
parentKVM: TDX: restore host xsave state when exit from the guest TD (diff)
downloadkernel-d3a6b6cfb82a9158ee624bf3d43e6ebd8fe05fc8.tar.gz
kernel-d3a6b6cfb82a9158ee624bf3d43e6ebd8fe05fc8.zip
KVM: x86: Allow to update cached values in kvm_user_return_msrs w/o wrmsr
Several MSRs are constant and only used in userspace(ring 3). But VMs may have different values. KVM uses kvm_set_user_return_msr() to switch to guest's values and leverages user return notifier to restore them when the kernel is to return to userspace. To eliminate unnecessary wrmsr, KVM also caches the value it wrote to an MSR last time. TDX module unconditionally resets some of these MSRs to architectural INIT state on TD exit. It makes the cached values in kvm_user_return_msrs are inconsistent with values in hardware. This inconsistency needs to be fixed. Otherwise, it may mislead kvm_on_user_return() to skip restoring some MSRs to the host's values. kvm_set_user_return_msr() can help correct this case, but it is not optimal as it always does a wrmsr. So, introduce a variation of kvm_set_user_return_msr() to update cached values and skip that wrmsr. Signed-off-by: Chao Gao <[email protected]> Signed-off-by: Isaku Yamahata <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Message-ID: <[email protected]> Reviewed-by: Xiayao Li <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'rust/helpers/workqueue.c')
0 files changed, 0 insertions, 0 deletions