diff mbox

[2/3] kvm: vmx: Guest BNDCFGS requires guest MPX support

Message ID 20170523185254.98780-2-jmattson@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Mattson May 23, 2017, 6:52 p.m. UTC
The BNDCFGS MSR should only be exposed to the guest if the guest
supports MPX. (cf. the TSC_AUX MSR and RDTSCP.)

Fixes: 0dd376e709975779 ("KVM: x86: add MSR_IA32_BNDCFGS to msrs_to_save")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

kernel test robot May 24, 2017, 1:08 p.m. UTC | #1
Hi Jim,

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.12-rc2 next-20170524]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jim-Mattson/kvm-vmx-Do-not-disable-intercepts-for-BNDCFGS/20170524-122859
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-lkp (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   arch/x86/kvm/vmx.c: In function 'vmx_get_msr':
>> arch/x86/kvm/vmx.c:3198:8: error: implicit declaration of function 'guest_cpuid_has_mpx' [-Werror=implicit-function-declaration]
      if (!guest_cpuid_has_mpx(vcpu))
           ^~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/guest_cpuid_has_mpx +3198 arch/x86/kvm/vmx.c

  3192			msr_info->data = vmcs_readl(GUEST_SYSENTER_EIP);
  3193			break;
  3194		case MSR_IA32_SYSENTER_ESP:
  3195			msr_info->data = vmcs_readl(GUEST_SYSENTER_ESP);
  3196			break;
  3197		case MSR_IA32_BNDCFGS:
> 3198			if (!guest_cpuid_has_mpx(vcpu))
  3199				return 1;
  3200			msr_info->data = vmcs_read64(GUEST_BNDCFGS);
  3201			break;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 763d27ee00fb..846c60c74258 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3195,7 +3195,7 @@  static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 		msr_info->data = vmcs_readl(GUEST_SYSENTER_ESP);
 		break;
 	case MSR_IA32_BNDCFGS:
-		if (!kvm_mpx_supported())
+		if (!guest_cpuid_has_mpx(vcpu))
 			return 1;
 		msr_info->data = vmcs_read64(GUEST_BNDCFGS);
 		break;
@@ -3277,7 +3277,7 @@  static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
 		vmcs_writel(GUEST_SYSENTER_ESP, data);
 		break;
 	case MSR_IA32_BNDCFGS:
-		if (!kvm_mpx_supported())
+		if (!guest_cpuid_has_mpx(vcpu))
 			return 1;
 		vmcs_write64(GUEST_BNDCFGS, data);
 		break;