[PATCH] x86/tdx: Support vmalloc() for tdx_enc_status_changed()

2024-05-20 Thread Dexuan Cui
When a TDX guest runs on Hyper-V, the hv_netvsc driver's netvsc_init_buf() allocates buffers using vzalloc(), and needs to share the buffers with the host OS by calling set_memory_decrypted(), which is not working for vmalloc() yet. Add the support by handling the pages one by one. Co-developed-by

Re: [PATCH v2 1/6] arm64/hyperv: Support DeviceTree

2024-05-20 Thread Roman Kisel
On 5/19/2024 11:45 PM, Krzysztof Kozlowski wrote: On 15/05/2024 19:33, Roman Kisel wrote: static bool hyperv_initialized; @@ -27,6 +30,29 @@ int hv_get_hypervisor_version(union hv_hypervisor_version_info *info) return 0; } +static bool hyperv_detect_fdt(void) +{ +#ifdef CO

Re: [PATCH v2 5/6] drivers/hv/vmbus: Get the irq number from DeviceTree

2024-05-20 Thread Roman Kisel
On 5/17/2024 10:14 AM, Rob Herring wrote: On Tue, May 14, 2024 at 5:45 PM Roman Kisel wrote: The vmbus driver uses ACPI for interrupt assignment on arm64 hence it won't function in the VTL mode where only DeviceTree can be used. Update the vmbus driver to discover interrupt configuration v

Re: [PATCH 1/6] arm64/hyperv: Support DeviceTree

2024-05-20 Thread Roman Kisel
On 5/14/2024 5:00 PM, Easwar Hariharan wrote: On 5/14/2024 4:17 PM, Roman Kisel wrote: On 5/14/2024 3:46 PM, Easwar Hariharan wrote: On 5/10/2024 10:42 AM, Roman Kisel wrote: On 5/10/2024 10:04 AM, Easwar Hariharan wrote: On 5/10/2024 9:05 AM, rom...@linux.microsoft.com wrote: From: R

Re: [PATCH 2/6] drivers/hv: Enable VTL mode for arm64

2024-05-20 Thread Roman Kisel
On 5/15/2024 12:43 AM, Wei Liu wrote: On Fri, May 10, 2024 at 09:05:01AM -0700, rom...@linux.microsoft.com wrote: From: Roman Kisel This change removes dependency on ACPI when buidling the hv drivers to allow Virtual Trust Level boot with DeviceTree. Signed-off-by: Roman Kisel --- drive

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 00/20] x86/tdx: Rewrite TDCALL wrappers

2024-05-20 Thread Huang, Kai
On Fri, 2024-05-17 at 08:18 -0700, Dave Hansen wrote: > On 5/17/24 07:19, Kirill A. Shutemov wrote: > > arch/x86/boot/compressed/tdx.c| 32 +--- > > arch/x86/coco/tdx/tdcall.S| 145 ++- > > arch/x86/coco/tdx/tdx-shared.c| 26 +-- > > arch/x86/coco/tdx/tdx.c

Re: [PATCH 16/20] x86/tdx: Convert VP_INFO tdcall to use new TDCALL_5() macro

2024-05-20 Thread Kirill A. Shutemov
On Fri, May 17, 2024 at 08:57:10AM -0700, Dave Hansen wrote: > On 5/17/24 07:19, Kirill A. Shutemov wrote: > > - /* > > -* TDINFO TDX module call is used to get the TD execution environment > > -* information like GPA width, number of available vcpus, debug mode > > -* information, et

Re: [PATCH 02/20] x86/tdx: Add macros to generate TDVMCALL wrappers

2024-05-20 Thread Kirill A. Shutemov
On Fri, May 17, 2024 at 06:54:15PM +0200, Paolo Bonzini wrote: > On 5/17/24 16:19, Kirill A. Shutemov wrote: > > Introduce a set of macros that allow to generate wrappers for TDVMCALL > > leafs. The macros uses tdvmcall_trmapoline() and provides SYSV-complaint > > ABI on top of it. > > Not really

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