Re: [PATCH v19 007/130] x86/virt/tdx: Export SEAMCALL functions

kirill.shutemov
2024-04-25T16:46:26Z

On Fri, Apr 19, 2024 at 12:53:19PM -0700, Sean Christopherson wrote:
> > But I guess we can make a *few* wrappers that covers all needed cases.
>
> Yeah. I suspect two will suffice. One for the calls that say at or below four
> inputs, and one for the fat ones like ReportFatalError that use everything under
> the sun.

I ended up with three helpers:

- tdvmcall_trampoline() as you proposed.

- tdvmcall_report_fatal_error() that does ReportFatalError specificly.
Pointer to char array as an input. Never returns: no need to
save/restore registers.

- hv_tdx_hypercall(). Hyper-V annoyingly uses R8 and RDX as parameters :/

> Not sure, haven't looked at them recently. At a glance, something similar? The
> use of high registers instead of RDI and RSI is damn annoying :-/

I defined three helpers: TDCALL_0(), TDCALL_1() and TDCALL_5(). All takes 4
input arguments.

I've updated the WIP branch with the new version:

https://github.com/intel/tdx/commits/guest-tdx-asm/

Any feedback is welcome.

--
Kiryl Shutsemau / Kirill A. Shutemov