Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Guenter Roeck
On 5/17/24 11:00, Guenter Roeck wrote: On 5/17/24 10:48, Steven Rostedt wrote: On Fri, 17 May 2024 10:36:37 -0700 Guenter Roeck wrote: Building csky:allmodconfig (and others) ... failed -- Error log: In file included from include/trace/trace_events.h:419,   from

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Guenter Roeck
On 5/17/24 10:48, Steven Rostedt wrote: On Fri, 17 May 2024 10:36:37 -0700 Guenter Roeck wrote: Building csky:allmodconfig (and others) ... failed -- Error log: In file included from include/trace/trace_events.h:419, from include/trace/define_trace.h:102,

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Steven Rostedt
On Fri, 17 May 2024 10:36:37 -0700 Guenter Roeck wrote: > Building csky:allmodconfig (and others) ... failed > -- > Error log: > In file included from include/trace/trace_events.h:419, > from include/trace/define_trace.h:102, > from

Re: [PATCH 03/20] x86/tdx: Convert port I/O handling to use new TDVMCALL macros

2024-05-17 Thread Paolo Bonzini
On 5/17/24 17:28, Dave Hansen wrote: On 5/17/24 07:19, Kirill A. Shutemov wrote: static inline void tdx_io_out(int size, u16 port, u32 value) { - struct tdx_module_args args = { - .r10 = TDX_HYPERCALL_STANDARD, - .r11 =

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Guenter Roeck
On Thu, May 16, 2024 at 01:34:54PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > [ >This is a treewide change. I will likely re-create this patch again in >the second week of the merge window of v6.10 and submit it then. Hoping >to keep the conflicts that it will

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

2024-05-17 Thread Rob Herring
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 > via DeviceTree. > > Signed-off-by:

Re: [PATCH 14/20] x86/tdx: Add macros to generate TDCALL wrappers

2024-05-17 Thread Paolo Bonzini
On 5/17/24 16:19, Kirill A. Shutemov wrote: Introduce a set of macros that allow to generate wrappers for TDCALL leafs. There are three macros differentiated by number of return parameters. Signed-off-by: Kirill A. Shutemov --- arch/x86/include/asm/shared/tdx.h | 58

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 02/20] x86/tdx: Add macros to generate TDVMCALL wrappers

2024-05-17 Thread Paolo Bonzini
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 SYSV-compliant, more like "The macros use asm() to call tdvmcall_trampoline

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Darrick J. Wong
On Thu, May 16, 2024 at 01:34:54PM -0400, Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > [ >This is a treewide change. I will likely re-create this patch again in >the second week of the merge window of v6.10 and submit it then. Hoping >to keep the conflicts that it will

Re: [PATCH 17/20] x86/tdx: Convert VM_RD/VM_WR tdcalls to use new TDCALL macros

2024-05-17 Thread Dave Hansen
Let's say you're debugging tdg_vm_rd(). You suspect someone read the spec wrong. You pull up the spec: https://sr71.net/~dave/intel/tdg.vm.rd.png On 5/17/24 07:19, Kirill A. Shutemov wrote: > static inline u64 tdg_vm_rd(u64 field, u64 *value) > { > - struct tdx_module_args args =

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

2024-05-17 Thread Dave Hansen
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, etc. More details about the ABI can be found in TDX > - *

Re: [PATCH 03/20] x86/tdx: Convert port I/O handling to use new TDVMCALL macros

2024-05-17 Thread Dave Hansen
On 5/17/24 07:19, Kirill A. Shutemov wrote: > static inline void tdx_io_out(int size, u16 port, u32 value) > { > - struct tdx_module_args args = { > - .r10 = TDX_HYPERCALL_STANDARD, > - .r11 = hcall_func(EXIT_REASON_IO_INSTRUCTION), > - .r12 = size, > -

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

Re: [PATCH 00/20] x86/tdx: Rewrite TDCALL wrappers

2024-05-17 Thread Dave Hansen
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 | 298 -- > arch/x86/hyperv/ivm.c

[PATCH 20/20] x86/tdx: Remove old TDCALL wrappers

2024-05-17 Thread Kirill A. Shutemov
All code has been converted to new TDCALL wrappers. Drop the old wrappers. Signed-off-by: Kirill A. Shutemov --- arch/x86/boot/compressed/tdx.c| 6 arch/x86/coco/tdx/tdcall.S| 60 ++- arch/x86/coco/tdx/tdx-shared.c| 20 ---

[PATCH 17/20] x86/tdx: Convert VM_RD/VM_WR tdcalls to use new TDCALL macros

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDCALL instead of tdcall() to issue VM_RD/VM_WR tdcalls It increase code slightly: Function old new delta tdx_early_init 744 776 +32 but combined with VP_INFO changes the total effect on

[PATCH 19/20] x86/tdx: Convert MR_REPORT tdcall to use new TDCALL_0() macro

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDCALL_0() instead of tdcall() to issue MR_REPORT tdcall. It cuts code bloat substantially: Function old new delta tdx_mcall_get_report0229 111-118 Signed-off-by: Kirill A. Shutemov ---

[PATCH 18/20] x86/tdx: Convert VP_VEINFO_GET tdcall to use new TDCALL_5() macro

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDCALL_5() instead of tdcall() to issue VP_VEINFO_GET tdcall. It cuts code bloat substantially: Function old new delta tdx_get_ve_info 253 116-137 Signed-off-by: Kirill A. Shutemov ---

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

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDCALL_5() instead of tdcall() to issue VP_INFO tdcall. It cuts code bloat slightly: Function old new delta tdx_early_init 780 744 -36 Signed-off-by: Kirill A. Shutemov ---

[PATCH 15/20] x86/tdx: Convert PAGE_ACCEPT tdcall to use new TDCALL_0() macro

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDCALL_0() instead of __tdcall() to issue PAGE_ACCEPT tdcall. It cuts code bloat substantially: Function old new delta tdx_accept_memory592 233-359 Signed-off-by: Kirill A. Shutemov ---

[PATCH 08/20] x86/tdx: Convert MMIO handling to use new TDVMCALL macros

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_0() and TDVMCALL_1() instead of __tdx_hypercall() to handle MMIO emulation. It cuts code bloat substantially: Function old new delta tdx_handle_virt_exception 17471383-364 Signed-off-by: Kirill A.

[PATCH 12/20] x86/tdx: Rewrite tdx_kvm_hypercall() without __tdx_hypercall()

2024-05-17 Thread Kirill A. Shutemov
tdx_kvm_hypercall() issues KVM hypercall. Rewrite it without using __tdx_hypercall(). Use tdvmcall_trampoline() instead. It cuts code bloat substantially: Function old new delta tdx_kvm_hypercall160 53-107

[PATCH 11/20] x86/tdx: Rewrite tdx_panic() without __tdx_hypercall()

2024-05-17 Thread Kirill A. Shutemov
tdx_panic() uses REPORT_FATAL_ERROR hypercall to deliver panic message in ealy boot. Rewrite it without using __tdx_hypercall(). REPORT_FATAL_ERROR hypercall is special. It uses pretty much all available registers to pass down the error message. TDVMCALL macros are not usable here. Implement the

[PATCH 14/20] x86/tdx: Add macros to generate TDCALL wrappers

2024-05-17 Thread Kirill A. Shutemov
Introduce a set of macros that allow to generate wrappers for TDCALL leafs. There are three macros differentiated by number of return parameters. Signed-off-by: Kirill A. Shutemov --- arch/x86/include/asm/shared/tdx.h | 58 +++ 1 file changed, 58 insertions(+) diff

[PATCH 09/20] x86/tdx: Convert MAP_GPA hypercall to use new TDVMCALL macros

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_1() instead of __tdx_hypercall() to issue MAP_GPA hypercall. It cuts code bloat substantially: Function old new delta tdx_enc_status_changed 352 242-110 tdx_kexec_finish

[PATCH 07/20] x86/tdx: Convert CPUID handling to use new TDVMCALL_4()

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_4() instead of __tdx_hypercall() to handle CPUID instruction emulation. It cuts code bloat substantially: Function old new delta tdx_handle_virt_exception 18191747 -72 Signed-off-by: Kirill A.

[PATCH 13/20] x86/tdx: Rewrite hv_tdx_hypercall() without __tdx_hypercall()

2024-05-17 Thread Kirill A. Shutemov
Rewrite hv_tdx_hypercall() in assembly to remove one more __tdx_hypercall() user. tdvmcall_trampoline() cannot be used here as Hyper-V uses R8 and RDX to pass down parameters which is incompatible with tdvmcall_trampoline() The rewrite cuts code bloat substantially: Function

[PATCH 10/20] x86/tdx: Convert GET_QUOTE hypercall to use new TDVMCALL macros

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_0() instead of __tdx_hypercall() to issue GET_QUOTE hypercall. It cuts code bloat substantially: Function old new delta tdx_hcall_get_quote 188 76-112 Signed-off-by: Kirill A. Shutemov ---

[PATCH 05/20] x86/tdx: Convert MSR read handling to use new TDVMCALL_1()

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_1() instead of __tdx_hypercall() to handle MSR read emulation. It cuts code bloat substantially: Function old new delta tdx_handle_virt_exception 20521947-105 Signed-off-by: Kirill A. Shutemov ---

[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:

[PATCH 06/20] x86/tdx: Convert MSR write handling to use new TDVMCALL_0()

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_0() instead of __tdx_hypercall() to handle MSR write emulation. It cuts code bloat substantially: Function old new delta tdx_handle_virt_exception 19471819-128 Signed-off-by: Kirill A. Shutemov

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

2024-05-17 Thread Kirill A. Shutemov
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. There are three macros differentiated by number of return parameters. Signed-off-by: Kirill A. Shutemov ---

[PATCH 03/20] x86/tdx: Convert port I/O handling to use new TDVMCALL macros

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_0() and TDVMCALL_1() instead of __tdx_hypercall() to handle port I/O in TDX guest. It cuts handle_io() size in half: Function old new delta handle_io436 202-234 Signed-off-by:

[PATCH 04/20] x86/tdx: Convert HLT handling to use new TDVMCALL_0()

2024-05-17 Thread Kirill A. Shutemov
Use newly introduced TDVMCALL_0() instead of __tdx_hypercall() to handle HLT instruction emulation. It cuts code bloat substantially: Function old new delta tdx_safe_halt 58 88 +30 tdx_handle_virt_exception

[PATCH 00/20] x86/tdx: Rewrite TDCALL wrappers

2024-05-17 Thread Kirill A. Shutemov
Sean noticing that the TDCALL wrappers were generating a lot of awful code. 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

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Takashi Iwai
On Thu, 16 May 2024 19:34:54 +0200, Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > [ >This is a treewide change. I will likely re-create this patch again in >the second week of the merge window of v6.10 and submit it then. Hoping >to keep the conflicts that it will

Re: [PATCH] tracing/treewide: Remove second parameter of __assign_str()

2024-05-17 Thread Rafael J. Wysocki
On Thu, May 16, 2024 at 7:35 PM Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > [ >This is a treewide change. I will likely re-create this patch again in >the second week of the merge window of v6.10 and submit it then. Hoping >to keep the conflicts that it will cause