Re: [PATCH] KVM: SVM: Stub out MSR_VM_CR to return VM_CR.LOCK and ignore writes

From: Sean Christopherson

Date: Fri Nov 13 2026 - 09:54:51 EST


On Fri, 30 Oct 2026 14:03:21 -0700, Jim Mattson wrote:
> Commit 4a810181c8bc ("KVM: SVM: Implement emulation of vm_cr msr") added
> svm_set_vm_cr() and svm->nested.vm_cr_msr solely because Hyper-V wrote
> to MSR_VM_CR when running under nested SVM [1]. At the time, Avi Kivity
> noted that the MSR needed to be exposed to userspace for save/restore
> [2], but it was never added to KVM_GET_MSR_INDEX_LIST.
>
> Moreover, KVM's emulation of MSR_VM_CR does not actually wire up any of
> its five defined bits (DPD, R_INIT, DIS_A20M, LOCK, SVMDIS) to their
> architectural behaviors (not even checking VM_CR.SVMDIS on writes to
> MSR_EFER), checks the wrong bit (SVMDIS instead of LOCK) when locking
> bits 4:3, and never resets vm_cr_msr on vCPU reset/INIT.
>
> [...]

Applied to kvm-x86 svm, thanks!

[1/1] KVM: SVM: Stub out MSR_VM_CR to return VM_CR.LOCK and ignore writes
https://github.com/kvm-x86/linux/commit/27ddbc70c82a

--
https://github.com/kvm-x86/linux/tree/next