sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-29 19:28:41 +00:00
parent 0f90c06c31
commit 9bb6d42f92
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
16 changed files with 119 additions and 114 deletions

View file

@ -1,4 +1,4 @@
/* $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>
*
@ -3958,9 +3958,8 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp)
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);
@ -4180,9 +4179,6 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp)
break;
}
sidt(&idtr);
sldt(&ldt_sel);
TRACEPOINT(vmm, guest_enter, vcpu, vrp);
/*
@ -4210,8 +4206,14 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *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