Re: [PATCH v1 1/1] x86/tdx: Add tdcall() and tdvmcall() helper functions

2021-03-19 Thread Kuppuswamy, Sathyanarayanan
On 3/19/21 11:22 AM, Dave Hansen wrote: On 3/19/21 10:42 AM, Kuppuswamy, Sathyanarayanan wrote: @@ -4,6 +4,58 @@   #include   #include   +void tdcall(u64 leafid, struct tdcall_regs *regs) +{ +    asm volatile( +    /* RAX = leafid (TDCALL LEAF ID) */ +    "  movq %0,

Re: [PATCH v1 1/1] x86/tdx: Add tdcall() and tdvmcall() helper functions

2021-03-19 Thread Dave Hansen
On 3/19/21 10:42 AM, Kuppuswamy, Sathyanarayanan wrote: >>> @@ -4,6 +4,58 @@ >>>   #include >>>   #include >>>   +void tdcall(u64 leafid, struct tdcall_regs *regs) >>> +{ >>> +    asm volatile( >>> +    /* RAX = leafid (TDCALL LEAF ID) */ >>> +    "  movq %0, %%rax;" >>> +

Re: [PATCH v1 1/1] x86/tdx: Add tdcall() and tdvmcall() helper functions

2021-03-19 Thread Kuppuswamy, Sathyanarayanan
Hi Sean, Thanks for the review. On 3/19/21 9:55 AM, Sean Christopherson wrote: On Thu, Mar 18, 2021, Kuppuswamy Sathyanarayanan wrote: diff --git a/arch/x86/kernel/tdx.c b/arch/x86/kernel/tdx.c index e44e55d1e519..7ae1d25e272b 100644 --- a/arch/x86/kernel/tdx.c +++ b/arch/x86/kernel/tdx.c @@

Re: [PATCH v1 1/1] x86/tdx: Add tdcall() and tdvmcall() helper functions

2021-03-19 Thread Sean Christopherson
On Thu, Mar 18, 2021, Kuppuswamy Sathyanarayanan wrote: > diff --git a/arch/x86/kernel/tdx.c b/arch/x86/kernel/tdx.c > index e44e55d1e519..7ae1d25e272b 100644 > --- a/arch/x86/kernel/tdx.c > +++ b/arch/x86/kernel/tdx.c > @@ -4,6 +4,58 @@ > #include > #include > > +void tdcall(u64 leafid,

[PATCH v1 1/1] x86/tdx: Add tdcall() and tdvmcall() helper functions

2021-03-18 Thread Kuppuswamy Sathyanarayanan
Implement common helper functions to communicate with the TDX Module and VMM (using TDCALL instruction). tdvmcall() function can be used to request services from VMM. tdcall() function can be used to communicate with the TDX Module. Using common helper functions makes the code more readable and