Skip to content

Commit

Permalink
KVM: VMX: support MSR_IA32_ARCH_CAPABILITIES as a feature MSR
Browse files Browse the repository at this point in the history
This lets userspace read the MSR_IA32_ARCH_CAPABILITIES and check that all
requested features are available on the host.

Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
bonzini committed Jul 15, 2018
1 parent 786b71f commit cd28325
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ static u32 msr_based_features[] = {

MSR_F10H_DECFG,
MSR_IA32_UCODE_REV,
MSR_IA32_ARCH_CAPABILITIES,
};

static unsigned int num_msr_based_features;
Expand All @@ -1100,7 +1101,8 @@ static int kvm_get_msr_feature(struct kvm_msr_entry *msr)
{
switch (msr->index) {
case MSR_IA32_UCODE_REV:
rdmsrl(msr->index, msr->data);
case MSR_IA32_ARCH_CAPABILITIES:
rdmsrl_safe(msr->index, &msr->data);
break;
default:
if (kvm_x86_ops->get_msr_feature(msr))
Expand Down

0 comments on commit cd28325

Please sign in to comment.