Skip to content

Commit

Permalink
x86/tdx: Add more registers to struct tdx_hypercall_args
Browse files Browse the repository at this point in the history
struct tdx_hypercall_args is used to pass down hypercall arguments to
__tdx_hypercall() assembly routine.

Currently __tdx_hypercall() handles up to 6 arguments. In preparation to
changes in __tdx_hypercall(), expand the structure to 6 more registers
and generate asm offsets for them.

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-3-kirill.shutemov%40linux.intel.com
  • Loading branch information
Kirill A. Shutemov authored and Dave Hansen committed Jan 27, 2023
1 parent 3543f88 commit 0da908c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/x86/include/asm/shared/tdx.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@
* This is a software only structure and not part of the TDX module/VMM ABI.
*/
struct tdx_hypercall_args {
u64 r8;
u64 r9;
u64 r10;
u64 r11;
u64 r12;
u64 r13;
u64 r14;
u64 r15;
u64 rdi;
u64 rsi;
u64 rbx;
u64 rdx;
};

/* Used to request services from the VMM */
Expand Down
6 changes: 6 additions & 0 deletions arch/x86/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@ static void __used common(void)
OFFSET(TDX_MODULE_r11, tdx_module_output, r11);

BLANK();
OFFSET(TDX_HYPERCALL_r8, tdx_hypercall_args, r8);
OFFSET(TDX_HYPERCALL_r9, tdx_hypercall_args, r9);
OFFSET(TDX_HYPERCALL_r10, tdx_hypercall_args, r10);
OFFSET(TDX_HYPERCALL_r11, tdx_hypercall_args, r11);
OFFSET(TDX_HYPERCALL_r12, tdx_hypercall_args, r12);
OFFSET(TDX_HYPERCALL_r13, tdx_hypercall_args, r13);
OFFSET(TDX_HYPERCALL_r14, tdx_hypercall_args, r14);
OFFSET(TDX_HYPERCALL_r15, tdx_hypercall_args, r15);
OFFSET(TDX_HYPERCALL_rdi, tdx_hypercall_args, rdi);
OFFSET(TDX_HYPERCALL_rsi, tdx_hypercall_args, rsi);
OFFSET(TDX_HYPERCALL_rbx, tdx_hypercall_args, rbx);
OFFSET(TDX_HYPERCALL_rdx, tdx_hypercall_args, rdx);

BLANK();
OFFSET(BP_scratch, boot_params, scratch);
Expand Down

0 comments on commit 0da908c

Please sign in to comment.