diff options
author | Anton Lindqvist <anton@cvs.openbsd.org> | 2023-07-05 18:23:11 +0000 |
---|---|---|
committer | Anton Lindqvist <anton@cvs.openbsd.org> | 2023-07-05 18:23:11 +0000 |
commit | 205f38591802247882a1aac84b2e8c56acd07702 (patch) | |
tree | 251012da26477537fffbff78078ad788be4f194d /sys/dev/pv/hyperv.c | |
parent | 99326b8dcc01239c320c1338997604e259ad413b (diff) |
The hypercall page populated with instructions by the hypervisor is not IBT
compatible due to lack of endbr64. Replace the indirect call with a new
hv_hypercall_trampoline() routine which jumps to the hypercall page without any
indirection.
Allows me to boot OpenBSD using Hyper-V on Windows 11 again.
ok guenther@
Diffstat (limited to 'sys/dev/pv/hyperv.c')
-rw-r--r-- | sys/dev/pv/hyperv.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/pv/hyperv.c b/sys/dev/pv/hyperv.c index 08a713d814d..da9bf3ae6d7 100644 --- a/sys/dev/pv/hyperv.c +++ b/sys/dev/pv/hyperv.c @@ -407,9 +407,8 @@ hv_hypercall(struct hv_softc *sc, uint64_t control, void *input, } #ifdef __amd64__ - __asm__ volatile ("mov %0, %%r8" : : "r" (output_pa) : "r8"); - __asm__ volatile ("call *%3" : "=a" (status) : "c" (control), - "d" (input_pa), "m" (sc->sc_hc)); + extern uint64_t hv_hypercall_trampoline(uint64_t, paddr_t, paddr_t); + status = hv_hypercall_trampoline(control, input_pa, output_pa); #else /* __i386__ */ { uint32_t control_hi = control >> 32; |