Index: lib/libnvmm/libnvmm.c =================================================================== RCS file: /cvsroot/src/lib/libnvmm/libnvmm.c,v retrieving revision 1.18 diff -u -r1.18 libnvmm.c --- lib/libnvmm/libnvmm.c 27 Oct 2019 20:17:36 -0000 1.18 +++ lib/libnvmm/libnvmm.c 3 Aug 2020 23:42:51 -0000 @@ -311,6 +311,7 @@ vcpu->cpuid = cpuid; vcpu->state = &comm->state; vcpu->event = &comm->event; + vcpu->mi_state = &comm->mi_state; vcpu->exit = malloc(sizeof(*vcpu->exit)); return 0; Index: lib/libnvmm/nvmm.h =================================================================== RCS file: /cvsroot/src/lib/libnvmm/nvmm.h,v retrieving revision 1.17 diff -u -r1.17 nvmm.h --- lib/libnvmm/nvmm.h 28 Oct 2019 08:30:49 -0000 1.17 +++ lib/libnvmm/nvmm.h 3 Aug 2020 23:42:51 -0000 @@ -60,6 +60,7 @@ struct nvmm_vcpu_state *state; struct nvmm_vcpu_event *event; struct nvmm_vcpu_exit *exit; + union nvmm_mi_state *mi_state; }; struct nvmm_io { Index: sys/dev/nvmm/nvmm.c =================================================================== RCS file: /cvsroot/src/sys/dev/nvmm/nvmm.c,v retrieving revision 1.33 diff -u -r1.33 nvmm.c --- sys/dev/nvmm/nvmm.c 1 Aug 2020 08:18:36 -0000 1.33 +++ sys/dev/nvmm/nvmm.c 3 Aug 2020 23:43:18 -0000 @@ -614,7 +614,13 @@ if (error) goto out; + if (vcpu->comm->mi_state.immediate_exit) { + error = EINTR; + goto out2; + } + error = nvmm_do_vcpu_run(mach, vcpu, &args->exit); +out2: nvmm_vcpu_put(vcpu); out: Index: sys/dev/nvmm/nvmm.h =================================================================== RCS file: /cvsroot/src/sys/dev/nvmm/nvmm.h,v retrieving revision 1.13 diff -u -r1.13 nvmm.h --- sys/dev/nvmm/nvmm.h 1 Aug 2020 08:18:36 -0000 1.13 +++ sys/dev/nvmm/nvmm.h 3 Aug 2020 23:43:18 -0000 @@ -71,6 +71,15 @@ #define NVMM_VCPU_CONF_MD_BEGIN 200 #define NVMM_VCPU_CONF_MD(op) (op - NVMM_VCPU_CONF_MD_BEGIN) +union nvmm_mi_state { + uint64_t _reserved[16]; + struct { + uint8_t _immediate_exit; + } _mi_state; +}; + +#define immediate_exit _mi_state._immediate_exit + struct nvmm_comm_page { /* State. */ uint64_t state_wanted; @@ -81,6 +90,9 @@ /* Event. */ bool event_commit; struct nvmm_vcpu_event event; + + /* Machine Independent NVMM State. */ + union nvmm_mi_state mi_state; }; /*