Remove VMFUNC feature detection and tracking.
authordv <dv@openbsd.org>
Mon, 7 Oct 2024 20:30:17 +0000 (20:30 +0000)
committerdv <dv@openbsd.org>
Mon, 7 Oct 2024 20:30:17 +0000 (20:30 +0000)
vmm(4) doesn't use the VMX VMFUNC instruction.

ok mlarkin@

sys/arch/amd64/amd64/identcpu.c
sys/arch/amd64/amd64/vmm_machdep.c
sys/arch/amd64/include/cpu.h

index 755e0ee..18ecbc8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: identcpu.c,v 1.147 2024/08/27 09:16:03 bluhm Exp $    */
+/*     $OpenBSD: identcpu.c,v 1.148 2024/10/07 20:30:17 dv Exp $       */
 /*     $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $        */
 
 /*
@@ -952,11 +952,6 @@ cpu_check_vmm_cap(struct cpu_info *ci)
                        /* EPT available? */
                        if (msr & (IA32_VMX_ENABLE_EPT) << 32)
                                ci->ci_vmm_flags |= CI_VMM_EPT;
-                       /* VM Functions available? */
-                       if (msr & (IA32_VMX_ENABLE_VM_FUNCTIONS) << 32) {
-                               ci->ci_vmm_cap.vcc_vmx.vmx_vm_func =
-                                   rdmsr(IA32_VMX_VMFUNC);
-                       }
                }
        }
 
index 7c898fb..1f76ac4 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm_machdep.c,v 1.38 2024/09/26 13:18:25 dv Exp $ */
+/* $OpenBSD: vmm_machdep.c,v 1.39 2024/10/07 20:30:17 dv Exp $ */
 /*
  * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
  *
@@ -7156,16 +7156,6 @@ vmx_dump_vmcs(struct vcpu *vcpu)
                        DPRINTF("\n");
                }
 
-               if (vcpu_vmx_check_cap(vcpu, IA32_VMX_PROCBASED2_CTLS,
-                   IA32_VMX_ENABLE_VM_FUNCTIONS, 1)) {
-                       /* We assume all CPUs have the same VMFUNC caps */
-                       if (curcpu()->ci_vmm_cap.vcc_vmx.vmx_vm_func & 0x1) {
-                               vmx_dump_vmcs_field(VMCS_EPTP_LIST_ADDRESS,
-                                   "EPTP List Addr");
-                               DPRINTF("\n");
-                       }
-               }
-
                if (vcpu_vmx_check_cap(vcpu, IA32_VMX_PROCBASED2_CTLS,
                    IA32_VMX_VMCS_SHADOWING, 1)) {
                        vmx_dump_vmcs_field(VMCS_VMREAD_BITMAP_ADDRESS,
index 34ba787..3a902a9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cpu.h,v 1.177 2024/09/26 13:18:25 dv Exp $    */
+/*     $OpenBSD: cpu.h,v 1.178 2024/10/07 20:30:17 dv Exp $    */
 /*     $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $     */
 
 /*-
@@ -73,7 +73,6 @@ struct vmx {
        uint32_t        vmx_vmxon_revision;
        uint32_t        vmx_msr_table_size;
        uint32_t        vmx_cr3_tgt_count;
-       uint64_t        vmx_vm_func;
        uint8_t         vmx_has_l1_flush_msr;
        uint64_t        vmx_invept_mode;
 };