diff options
| author | Juergen Gross <[email protected]> | 2024-10-17 09:00:52 +0000 |
|---|---|---|
| committer | Juergen Gross <[email protected]> | 2024-12-17 07:23:29 +0000 |
| commit | b4845bb6383821a9516ce30af3a27dc873e37fd4 (patch) | |
| tree | e7f3aff17c7f560b8e3de2dc36daacd72878236e /arch/x86/include/asm/xen/hypercall.h | |
| parent | x86/xen: don't do PV iret hypercall through hypercall page (diff) | |
| download | kernel-b4845bb6383821a9516ce30af3a27dc873e37fd4.tar.gz kernel-b4845bb6383821a9516ce30af3a27dc873e37fd4.zip | |
x86/xen: add central hypercall functions
Add generic hypercall functions usable for all normal (i.e. not iret)
hypercalls. Depending on the guest type and the processor vendor
different functions need to be used due to the to be used instruction
for entering the hypervisor:
- PV guests need to use syscall
- HVM/PVH guests on Intel need to use vmcall
- HVM/PVH guests on AMD and Hygon need to use vmmcall
As PVH guests need to issue hypercalls very early during boot, there
is a 4th hypercall function needed for HVM/PVH which can be used on
Intel and AMD processors. It will check the vendor type and then set
the Intel or AMD specific function to use via static_call().
This is part of XSA-466 / CVE-2024-53241.
Reported-by: Andrew Cooper <[email protected]>
Signed-off-by: Juergen Gross <[email protected]>
Co-developed-by: Peter Zijlstra <[email protected]>
Diffstat (limited to 'arch/x86/include/asm/xen/hypercall.h')
| -rw-r--r-- | arch/x86/include/asm/xen/hypercall.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index a2dd24947eb8..6b4dd4de08a6 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h @@ -88,6 +88,9 @@ struct xen_dm_op_buf; extern struct { char _entry[32]; } hypercall_page[]; +void xen_hypercall_func(void); +DECLARE_STATIC_CALL(xen_hypercall, xen_hypercall_func); + #define __HYPERCALL "call hypercall_page+%c[offset]" #define __HYPERCALL_ENTRY(x) \ [offset] "i" (__HYPERVISOR_##x * sizeof(hypercall_page[0])) |
