x86/tdx: Refactor __tdx_hypercall() to allow pass down more arguments
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Thu, 26 Jan 2023 22:11:55 +0000 (01:11 +0300)
committerDave Hansen <dave.hansen@linux.intel.com>
Fri, 27 Jan 2023 17:42:09 +0000 (09:42 -0800)
commitc30c4b2555ba93b845559a036293fcaf7ffd2b82
treed6b6aeaf1f06216838e3ff9149eaa914b685da7a
parent0da908c291070d89482f6211dbe81d4d43c3f7cb
x86/tdx: Refactor __tdx_hypercall() to allow pass down more arguments

RDI is the first argument to __tdx_hypercall() that used to pass pointer
to struct tdx_hypercall_args. RSI is the second argument that contains
flags, such as TDX_HCALL_HAS_OUTPUT and TDX_HCALL_ISSUE_STI.

RDI and RSI can also be used as arguments to TDVMCALL leafs. Move RDI to
RAX and RSI to RBP to free up them for the hypercall arguments.

RAX saved on stack during TDCALL as it returns status code in the
register.

RBP value has to be restored before returning from __tdx_hypercall() as
it is callee-saved register.

This is preparatory patch. No functional change.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20230126221159.8635-4-kirill.shutemov%40linux.intel.com
arch/x86/coco/tdx/tdcall.S