]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/xen: add central hypercall functions
authorJuergen Gross <jgross@suse.com>
Thu, 17 Oct 2024 09:00:52 +0000 (11:00 +0200)
committerJuergen Gross <jgross@suse.com>
Tue, 17 Dec 2024 07:23:29 +0000 (08:23 +0100)
commitb4845bb6383821a9516ce30af3a27dc873e37fd4
treee7f3aff17c7f560b8e3de2dc36daacd72878236e
parenta2796dff62d6c6bfc5fbebdf2bee0d5ac0438906
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 <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Co-developed-by: Peter Zijlstra <peterz@infradead.org>
arch/x86/include/asm/xen/hypercall.h
arch/x86/xen/enlighten.c
arch/x86/xen/enlighten_hvm.c
arch/x86/xen/enlighten_pv.c
arch/x86/xen/xen-asm.S
arch/x86/xen/xen-head.S
arch/x86/xen/xen-ops.h