Re: [PATCH 01/20] x86/tdx: Introduce tdvmcall_trampoline()

2024-05-20 Thread Dave Hansen
On 5/20/24 03:32, Kirill A. Shutemov wrote: >> In other words, I think this as the foundational justification for the >> rest of the series leaves a little to be desired. > See the patch below. Is it what you had in mind? > > This patch saves ~2K of code, comparing to ~3K for my patchset: > > add

Re: [PATCH 01/20] x86/tdx: Introduce tdvmcall_trampoline()

2024-05-20 Thread Kirill A. Shutemov
On Fri, May 17, 2024 at 07:02:25PM +0200, Paolo Bonzini wrote: > On 5/17/24 16:19, Kirill A. Shutemov wrote: > > The function will be used from inline assembly to handle most TDVMCALL > > cases. > > Perhaps add that the calling convention is designed to allow using the asm > constraints a/b/c/d/S/

Re: [PATCH 01/20] x86/tdx: Introduce tdvmcall_trampoline()

2024-05-20 Thread Kirill A. Shutemov
On Fri, May 17, 2024 at 08:21:37AM -0700, Dave Hansen wrote: > On 5/17/24 07:19, Kirill A. Shutemov wrote: > > TDCALL calls are centralized into a few megawrappers that take the > > struct tdx_module_args as input. Most of the call sites only use a few > > arguments, but they have to zero out unuse

Re: [PATCH 01/20] x86/tdx: Introduce tdvmcall_trampoline()

2024-05-17 Thread Paolo Bonzini
On 5/17/24 16:19, Kirill A. Shutemov wrote: The function will be used from inline assembly to handle most TDVMCALL cases. Perhaps add that the calling convention is designed to allow using the asm constraints a/b/c/d/S/D and keep the asm blocks simpler? Paolo

Re: [PATCH 01/20] x86/tdx: Introduce tdvmcall_trampoline()

2024-05-17 Thread Dave Hansen
On 5/17/24 07:19, Kirill A. Shutemov wrote: > TDCALL calls are centralized into a few megawrappers that take the > struct tdx_module_args as input. Most of the call sites only use a few > arguments, but they have to zero out unused fields in the structure to > avoid data leaks to the VMM. This lead

[PATCH 01/20] x86/tdx: Introduce tdvmcall_trampoline()

2024-05-17 Thread Kirill A. Shutemov
TDCALL calls are centralized into a few megawrappers that take the struct tdx_module_args as input. Most of the call sites only use a few arguments, but they have to zero out unused fields in the structure to avoid data leaks to the VMM. This leads to the compiler generating inefficient code: dozen