Date: Sat, 13 Sep 2014 23:48:43 +0000 (UTC) From: Neel Natu <neel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r271559 - projects/bhyve_svm/sys/amd64/vmm/amd Message-ID: <201409132348.s8DNmh0L026935@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: neel Date: Sat Sep 13 23:48:43 2014 New Revision: 271559 URL: http://svnweb.freebsd.org/changeset/base/271559 Log: Bug fixes. - Don't enable the HLT intercept by default. It will be enabled by bhyve(8) if required. Prior to this change HLT exiting was always enabled making the "-H" option to bhyve(8) meaningless. - Recognize a VM exit triggered by a non-maskable interrupt. Prior to this change the exit would be punted to userspace and the virtual machine would terminate. Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/svm.c Sat Sep 13 23:03:46 2014 (r271558) +++ projects/bhyve_svm/sys/amd64/vmm/amd/svm.c Sat Sep 13 23:48:43 2014 (r271559) @@ -503,7 +503,6 @@ vmcb_init(struct svm_softc *sc, int vcpu /* Intercept various events (for e.g. I/O, MSR and CPUID accesses) */ svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_IO); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_MSR); - svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_HLT); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_CPUID); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INTR); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INIT); @@ -1041,6 +1040,8 @@ exit_reason_to_str(uint64_t reason) return ("mchk"); case VMCB_EXIT_INTR: return ("extintr"); + case VMCB_EXIT_NMI: + return ("nmi"); case VMCB_EXIT_VINTR: return ("vintr"); case VMCB_EXIT_MSR: @@ -1159,6 +1160,9 @@ svm_vmexit(struct svm_softc *svm_sc, int update_rip = false; vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_EXTINT, 1); break; + case VMCB_EXIT_NMI: + update_rip = false; + break; case VMCB_EXIT_IO: loop = svm_handle_io(svm_sc, vcpu, vmexit); vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_INOUT, 1); Modified: projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h Sat Sep 13 23:03:46 2014 (r271558) +++ projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.h Sat Sep 13 23:48:43 2014 (r271559) @@ -124,6 +124,7 @@ /* VMCB exit code, APM vol2 Appendix C */ #define VMCB_EXIT_MC 0x52 #define VMCB_EXIT_INTR 0x60 +#define VMCB_EXIT_NMI 0x61 #define VMCB_EXIT_VINTR 0x64 #define VMCB_EXIT_PUSHF 0x70 #define VMCB_EXIT_POPF 0x71
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409132348.s8DNmh0L026935>