]> www.infradead.org Git - linux.git/commit
x86/vmware: Introduce VMware hypercall API
authorAlexey Makhalov <alexey.makhalov@broadcom.com>
Thu, 13 Jun 2024 19:16:43 +0000 (12:16 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 25 Jun 2024 15:01:33 +0000 (17:01 +0200)
commit34bf25e820ae1ab38f9cd88834843ba76678a2fd
tree64eb660560fe3463261c9702c59714d4f545622d
parentf2661062f16b2de5d7b6a5c42a9a5c96326b8454
x86/vmware: Introduce VMware hypercall API

Introduce a vmware_hypercall family of functions. It is a common implementation
to be used by the VMware guest code and virtual device drivers in architecture
independent manner.

The API consists of vmware_hypercallX and vmware_hypercall_hb_{out,in}
set of functions analogous to KVM's hypercall API. Architecture-specific
implementation is hidden inside.

It will simplify future enhancements in VMware hypercalls such as SEV-ES and
TDX related changes without needs to modify a caller in device drivers code.

Current implementation extends an idea from

  bac7b4e84323 ("x86/vmware: Update platform detection code for VMCALL/VMMCALL hypercalls")

to have a slow, but safe path vmware_hypercall_slow() earlier during the boot
when alternatives are not yet applied.  The code inherits VMWARE_CMD logic from
the commit mentioned above.

Move common macros from vmware.c to vmware.h.

  [ bp: Fold in a fix:
    https://lore.kernel.org/r/20240625083348.2299-1-alexey.makhalov@broadcom.com ]

Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240613191650.9913-2-alexey.makhalov@broadcom.com
arch/x86/include/asm/vmware.h
arch/x86/kernel/cpu/vmware.c