Skip to content

Commit 0da908c

Browse files
kirylhansendc
authored andcommitted
x86/tdx: Add more registers to struct tdx_hypercall_args
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 <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/all/20230126221159.8635-3-kirill.shutemov%40linux.intel.com
1 parent 3543f88 commit 0da908c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

arch/x86/include/asm/shared/tdx.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@
2222
* This is a software only structure and not part of the TDX module/VMM ABI.
2323
*/
2424
struct tdx_hypercall_args {
25+
u64 r8;
26+
u64 r9;
2527
u64 r10;
2628
u64 r11;
2729
u64 r12;
2830
u64 r13;
2931
u64 r14;
3032
u64 r15;
33+
u64 rdi;
34+
u64 rsi;
35+
u64 rbx;
36+
u64 rdx;
3137
};
3238

3339
/* Used to request services from the VMM */

arch/x86/kernel/asm-offsets.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,18 @@ static void __used common(void)
7575
OFFSET(TDX_MODULE_r11, tdx_module_output, r11);
7676

7777
BLANK();
78+
OFFSET(TDX_HYPERCALL_r8, tdx_hypercall_args, r8);
79+
OFFSET(TDX_HYPERCALL_r9, tdx_hypercall_args, r9);
7880
OFFSET(TDX_HYPERCALL_r10, tdx_hypercall_args, r10);
7981
OFFSET(TDX_HYPERCALL_r11, tdx_hypercall_args, r11);
8082
OFFSET(TDX_HYPERCALL_r12, tdx_hypercall_args, r12);
8183
OFFSET(TDX_HYPERCALL_r13, tdx_hypercall_args, r13);
8284
OFFSET(TDX_HYPERCALL_r14, tdx_hypercall_args, r14);
8385
OFFSET(TDX_HYPERCALL_r15, tdx_hypercall_args, r15);
86+
OFFSET(TDX_HYPERCALL_rdi, tdx_hypercall_args, rdi);
87+
OFFSET(TDX_HYPERCALL_rsi, tdx_hypercall_args, rsi);
88+
OFFSET(TDX_HYPERCALL_rbx, tdx_hypercall_args, rbx);
89+
OFFSET(TDX_HYPERCALL_rdx, tdx_hypercall_args, rdx);
8490

8591
BLANK();
8692
OFFSET(BP_scratch, boot_params, scratch);

0 commit comments

Comments
 (0)