summaryrefslogtreecommitdiff
path: root/sys/dev/pv/hyperv.c
diff options
context:
space:
mode:
authorAnton Lindqvist <anton@cvs.openbsd.org>2023-07-05 18:23:11 +0000
committerAnton Lindqvist <anton@cvs.openbsd.org>2023-07-05 18:23:11 +0000
commit205f38591802247882a1aac84b2e8c56acd07702 (patch)
tree251012da26477537fffbff78078ad788be4f194d /sys/dev/pv/hyperv.c
parent99326b8dcc01239c320c1338997604e259ad413b (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.c5
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;