KVM: x86: add MSR_IA32_BNDCFGS to msrs_to_save
authorLiu, Jinsong <jinsong.liu@intel.com>
Mon, 24 Feb 2014 10:56:53 +0000 (10:56 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 25 Feb 2014 19:17:09 +0000 (20:17 +0100)
From 5d5a80cd172ea6fb51786369bcc23356b1e9e956 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Mon, 24 Feb 2014 18:11:55 +0800
Subject: [PATCH v5 2/3] KVM: x86: add MSR_IA32_BNDCFGS to msrs_to_save

Add MSR_IA32_BNDCFGS to msrs_to_save, and corresponding logic
to kvm_get/set_msr().

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c

index e4e4b50f57e6453b0755df779f981a6cf2815349..83ee24f74a697d2f96a784ab3abb0c6a9c21a676 100644 (file)
@@ -2484,6 +2484,9 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
        case MSR_IA32_SYSENTER_ESP:
                data = vmcs_readl(GUEST_SYSENTER_ESP);
                break;
+       case MSR_IA32_BNDCFGS:
+               data = vmcs_read64(GUEST_BNDCFGS);
+               break;
        case MSR_IA32_FEATURE_CONTROL:
                if (!nested_vmx_allowed(vcpu))
                        return 1;
@@ -2552,6 +2555,9 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
        case MSR_IA32_SYSENTER_ESP:
                vmcs_writel(GUEST_SYSENTER_ESP, data);
                break;
+       case MSR_IA32_BNDCFGS:
+               vmcs_write64(GUEST_BNDCFGS, data);
+               break;
        case MSR_IA32_TSC:
                kvm_write_tsc(vcpu, msr_info);
                break;
index 3da8df8ea63cd34c0f09434a75e7bce96b12f73e..33fa9e348d1808f90fe014cb48f9808f96a19968 100644 (file)
@@ -882,7 +882,7 @@ static u32 msrs_to_save[] = {
        MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
 #endif
        MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA,
-       MSR_IA32_FEATURE_CONTROL
+       MSR_IA32_FEATURE_CONTROL, MSR_IA32_BNDCFGS
 };
 
 static unsigned num_msrs_to_save;