[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] vm_event: vmx: Allow intercepting hypervisor MSRs in debug builds



MSRs that are not covered by MSR bitmap (e.g hypervisor range) are
unconditionally intercepted by hardware and don't need any specific handling.

However, vmx_set_msr_intercept() wrongly ASSERT() if the MSR is a part of the
hypervisor range. Fix it by skipping the ASSERT() in this case.

This is only reachable with CONFIG_VM_EVENT using 
XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR
to configure a MSR intercept in the hypervisor range (0x40000000–0x40001fff).

Fixes: 62999081ca27 ("x86/vmx: Introduce and use struct vmx_msr_bitmap")
Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 8e52ef4d49..050168bbce 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -986,7 +986,7 @@ void vmx_set_msr_intercept(struct vcpu *v, unsigned int msr,
         if ( type & VMX_MSR_W )
             set_bit(msr, msr_bitmap->write_high);
     }
-    else
+    else if ( !((msr >= 0x40000000U) && (msr <= 0x40001fffU)) )
         ASSERT(!"MSR out of range for interception\n");
 }
 
-- 
2.55.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.