lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly
On Fri, Jul 21, 2023 at 12:18:23AM +0000, Huang, Kai wrote:

> Unfortunately I don't think it's feasible. Sean pointed out that
> kvm_vcpu_arch::regs[] do follow the "register index" hardware layout in x86 (for
> which I missed sorry), so we cannot re-order KVM part.  
>
> And unfortunately RBP (5) is in middle of those registers:
>
> 0 = RAX
> 1 = RCX
> 2 = RDX
> 3 = RBX
> 4 = RSP
> 5 = RBP
> 6 = RSI
> 7 = RDI
> 8–15 represent R8–R15, respectively...
>
> Thus unless we add RBP to 'struct tdx_module_args', it's impossible to re-order
> the structure to match KVM's layout.

Adding RBP to the struct shouldn't be a problem, we'll just not use it.
Same as RSP, nobody sane would expect that to be used. If you worry
about it you can give them funny names like:

struct tdx_module_args {
unsigned long ax;
unsigned long cx;
unsigned long dx;
unsigned long bx;
unsigned long __sp_unused;
unsigned long __bp_unused;
unsigned long si;
unsigned long di;
...
};

I mean, at this point the whole thing is just 128 bytes of data anyway.

\
 
 \ /
  Last update: 2023-07-21 10:06    [W:0.078 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site