Hi While working on a patch, i noticed that vmm_get_guest_faulttype was incorrect for amd (VMM_MODE_RVI) cpus, apon further inspection realised it was unused. Please see the patch below to remove it.
cheers Adam ? div Index: sys/arch/amd64/amd64/vmm.c =================================================================== RCS file: /cvs/src/sys/arch/amd64/amd64/vmm.c,v retrieving revision 1.257 diff -u -p -u -p -r1.257 vmm.c --- sys/arch/amd64/amd64/vmm.c 13 Dec 2019 03:38:15 -0000 1.257 +++ sys/arch/amd64/amd64/vmm.c 30 Jan 2020 06:47:41 -0000 @@ -177,7 +177,6 @@ void vmx_handle_intr(struct vcpu *); void vmx_handle_intwin(struct vcpu *); void vmx_handle_misc_enable_msr(struct vcpu *); int vmm_get_guest_memtype(struct vm *, paddr_t); -int vmm_get_guest_faulttype(void); int vmx_get_guest_faulttype(void); int svm_get_guest_faulttype(struct vmcb *); int vmx_get_exit_qualification(uint64_t *); @@ -5073,23 +5072,6 @@ vmm_get_guest_memtype(struct vm *vm, pad DPRINTF("guest memtype @ 0x%llx unknown\n", (uint64_t)gpa); return (VMM_MEM_TYPE_UNKNOWN); -} - -/* - * vmm_get_guest_faulttype - * - * Determines the type (R/W/X) of the last fault on the VCPU last run on - * this PCPU. Calls the appropriate architecture-specific subroutine. - */ -int -vmm_get_guest_faulttype(void) -{ - if (vmm_softc->mode == VMM_MODE_EPT) - return vmx_get_guest_faulttype(); - else if (vmm_softc->mode == VMM_MODE_RVI) - return vmx_get_guest_faulttype(); - else - panic("%s: unknown vmm mode: %d", __func__, vmm_softc->mode); } /*