On 12/08/2010 07:03 PM, Nadav Har'El wrote:
When the guest can use VMX instructions (when the "nested" module option is on), it should also be able to read and write VMX MSRs, e.g., to query about VMX capabilities. This patch adds this support. + +static int vmx_set_vmx_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) +{ + switch (msr_index) { + case MSR_IA32_FEATURE_CONTROL: + case MSR_IA32_VMX_BASIC: + case MSR_IA32_VMX_TRUE_PINBASED_CTLS: + case MSR_IA32_VMX_PINBASED_CTLS: + case MSR_IA32_VMX_PROCBASED_CTLS: + case MSR_IA32_VMX_EXIT_CTLS: + case MSR_IA32_VMX_ENTRY_CTLS: + case MSR_IA32_VMX_PROCBASED_CTLS2: + case MSR_IA32_VMX_EPT_VPID_CAP: + pr_unimpl(vcpu, "unimplemented VMX MSR write: 0x%x data %llx\n", + msr_index, data); + return 0; + default: + return 1; + } +}
These msrs are read-only IIRC, so they should #GP without any message. Nor should they be part of the save/restore msr set.
We do need a way for userspace to set them though. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html