Skip to contentSkip to conversation

x86/hvm: Add check for cpu_has_vmx_virt_exceptions

PATCH In review Alexandru Isaila 2 participants 2 messages Sep 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/hvm: Add check for cpu_has_vmx_virt_exceptions

This is useful so HVMOP_altp2m_vcpu_enable_notify will fail and not silently succeed. It save a call to HVMOP_altp2m_set_suppress_ve.

---
 xen/arch/x86/hvm/hvm.c | 6 ++++++
 1 file changed, 6 insertions(+)
xen/arch/x86/hvm/hvm.c +6 -0
index 9a490ef68c..51fc3ec07f 100644
@@ -4561,6 +4561,12 @@ static int do_altp2m_op(
             break;
         }
 
+        if ( !cpu_has_vmx_virt_exceptions )
+        {
+            rc = -EOPNOTSUPP;
+            break;
+        }
+
         v = d->vcpu[a.u.enable_notify.vcpu_id];
 
         if ( !gfn_eq(vcpu_altp2m(v).veinfo_gfn, INVALID_GFN) ||
Signature · 7 lines
2.17.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Alexandru Isaila

This is useful so HVMOP_altp2m_vcpu_enable_notify will fail and not silently succeed. It save a call to HVMOP_altp2m_set_suppress_ve.

In principle we could emulate this by having .sve becoming an EPT_MISCONFIG, but that can be left to whomever wants to use this functionality on pre-Broadwell hardware.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel