-/* $OpenBSD: vmm_machdep.c,v 1.19 2024/02/25 22:33:09 guenther Exp $ */
+/* $OpenBSD: vmm_machdep.c,v 1.20 2024/02/29 16:10:52 guenther Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
struct schedstate_percpu *spc;
struct vmx_invvpid_descriptor vid;
uint64_t eii, procbased, int_st;
- uint16_t irq, ldt_sel;
+ uint16_t irq;
u_long s;
- struct region_descriptor idtr;
rw_assert_wrlock(&vcpu->vc_lock);
break;
}
- sidt(&idtr);
- sldt(&ldt_sel);
-
TRACEPOINT(vmm, guest_enter, vcpu, vrp);
/*
wrpkru(0, PGK_VALUE);
}
- lidt(&idtr);
- lldt(ldt_sel);
+ /*
+ * VM exit restores the GDT and IDT bases, but gives
+ * them high limits. Reload with the correct limits here.
+ * 'gdt' is set above first time through and reset there
+ * whenever this thread switches CPU.
+ */
+ bare_lgdt(&gdt);
+ cpu_init_idt();
/*
* On exit, interrupts are disabled, and we are running with