Re: [PATCH v8 1/3] modules: Support extended MODVERSIONS info

2024-10-30 Thread Matthew Maurer
On Wed, Oct 30, 2024 at 9:37 PM Luis Chamberlain wrote: > > On Thu, Oct 31, 2024 at 12:22:36PM +1100, Michael Ellerman wrote: > > Matthew Maurer writes: > > > Adds a new format for MODVERSIONS which stores each field in a separate > > > ELF section. This initially adds support for variable length

[resend PATCH 1/2] dim: make dim_calc_stats() inputs const pointers

2024-10-30 Thread Caleb Sander Mateos
Make the start and end arguments to dim_calc_stats() const pointers to clarify that the function does not modify their values. Signed-off-by: Caleb Sander Mateos --- include/linux/dim.h | 3 ++- lib/dim/dim.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/l

[resend PATCH 2/2] dim: pass dim_sample to net_dim() by reference

2024-10-30 Thread Caleb Sander Mateos
net_dim() is currently passed a struct dim_sample argument by value. struct dim_sample is 24 bytes. Since this is greater 16 bytes, x86-64 passes it on the stack. All callers have already initialized dim_sample on the stack, so passing it by value requires pushing a duplicated copy to the stack. Ei

Re: [PATCH v8 1/3] modules: Support extended MODVERSIONS info

2024-10-30 Thread Michael Ellerman
Matthew Maurer writes: > Adds a new format for MODVERSIONS which stores each field in a separate > ELF section. This initially adds support for variable length names, but > could later be used to add additional fields to MODVERSIONS in a > backwards compatible way if needed. Any new fields will be

Re: [PATCH 2/2] dim: pass dim_sample to net_dim() by reference

2024-10-30 Thread Jakub Kicinski
On Wed, 30 Oct 2024 13:49:08 -0600 Caleb Sander Mateos wrote: > net_dim() is currently passed a struct dim_sample argument by value. > struct dim_sample is 24 bytes. Since this is greater 16 bytes, x86-64 > passes it on the stack. All callers have already initialized dim_sample > on the stack, so p

[PATCH v8 3/3] rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS

2024-10-30 Thread Matthew Maurer
From: Sami Tolvanen Previously, two things stopped Rust from using MODVERSIONS: 1. Rust symbols are occasionally too long to be represented in the original versions table 2. Rust types cannot be properly hashed by the existing genksyms approach because: * Looking up type definitions

[PATCH v8 2/3] modpost: Produce extended MODVERSIONS information

2024-10-30 Thread Matthew Maurer
Generate both the existing modversions format and the new extended one when running modpost. Presence of this metadata in the final .ko is guarded by CONFIG_EXTENDED_MODVERSIONS. We no longer generate an error on long symbols in modpost if CONFIG_EXTENDED_MODVERSIONS is set, as they can now be app

[PATCH v8 1/3] modules: Support extended MODVERSIONS info

2024-10-30 Thread Matthew Maurer
Adds a new format for MODVERSIONS which stores each field in a separate ELF section. This initially adds support for variable length names, but could later be used to add additional fields to MODVERSIONS in a backwards compatible way if needed. Any new fields will be ignored by old user tooling, un

[PATCH v8 0/3] Extended MODVERSIONS Support

2024-10-30 Thread Matthew Maurer
This patch series is intended for use alongside the Implement DWARF modversions series [1] to enable RUST and MODVERSIONS at the same time. Elsewhere, we've seen a desire for long symbol name support for LTO symbol names [2], and the previous series came up [3] as a possible solution rather than h

[PATCH] powerpc/vdso: Drop -mstack-protector-guard flags in 32-bit files with clang

2024-10-30 Thread Nathan Chancellor
64-bit build are not valid for the +# 32-bit one. clang validates the values passed to these arguments during +# parsing, even when -fno-stack-protector is passed afterwards. +CC32FLAGSREMOVE += -mstack-protector-guard% endif LD32FLAGS := -Wl,-soname=linux-vdso32.so.1 AS32FLAGS := -D__VDSO32__

[PATCH v7 01/17] powerpc/trace: Account for -fpatchable-function-entry support by toolchain

2024-10-30 Thread Hari Bathini
From: Naveen N Rao So far, we have relied on the fact that gcc supports both -mprofile-kernel, as well as -fpatchable-function-entry, and clang supports neither. Our Makefile only checks for CONFIG_MPROFILE_KERNEL to decide which files to build. Clang has a feature request out [*] to implement -f

[PATCH v7 16/17] samples/ftrace: Add support for ftrace direct samples on powerpc

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Add powerpc 32-bit and 64-bit samples for ftrace direct. This serves to show the sample instruction sequence to be used by ftrace direct calls to adhere to the ftrace ABI. On 64-bit powerpc, TOC setup requires some additional work. Signed-off-by: Naveen N Rao --- arch/power

[PATCH v7 08/17] powerpc/ftrace: Move ftrace stub used for init text before _einittext

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Move the ftrace stub used to cover inittext before _einittext so that it is within kernel text, as seen through core_kernel_text(). This is required for a subsequent change to ftrace. Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/vmlinux.lds.S | 3 +-- 1 file changed,

[PATCH v7 02/17] powerpc/kprobes: Use ftrace to determine if a probe is at function entry

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Rather than hard-coding the offset into a function to be used to determine if a kprobe is at function entry, use ftrace_location() to determine the ftrace location within the function and categorize all instructions till that offset to be function entry. For functions that can

Re: [PATCH] sound: Switch back to struct platform_driver::remove()

2024-10-30 Thread Takashi Iwai
On Tue, 29 Oct 2024 08:37:47 +0100, Uwe Kleine-König wrote: > > After commit 0edb555a65d1 ("platform: Make platform_driver::remove() > return void") .remove() is (again) the right callback to implement for > platform drivers. > > Convert all platform drivers below sound to use .remove(), with > t

Re: [PATCH v7 1/4] cpu/SMT: Provide a default topology_is_primary_thread()

2024-10-30 Thread Thomas Gleixner
On Wed, Oct 30 2024 at 20:54, Yicong Yang wrote: > > +#ifndef topology_is_primary_thread > +#define topology_is_primary_thread topology_is_primary_thread Please do not glue defines and functions together w/o a newline in between. > +static inline bool topology_is_primary_thread(unsigned int cpu

[PATCH v7 13/17] powerpc64/ftrace: Support .text larger than 32MB with out-of-line stubs

2024-10-30 Thread Hari Bathini
From: Naveen N Rao We are restricted to a .text size of ~32MB when using out-of-line function profile sequence. Allow this to be extended up to the previous limit of ~64MB by reserving space in the middle of .text. A new config option CONFIG_PPC_FTRACE_OUT_OF_LINE_NUM_RESERVE is introduced to sp

Re: [PATCH net-next 2/3] net: dpaa_eth: add assertions about SGT entry offsets in sg_fd_to_skb()

2024-10-30 Thread Vladimir Oltean
On Tue, Oct 29, 2024 at 06:43:16PM +0200, Vladimir Oltean wrote: > Tested on LS1046A. ..and now also tested on T2080 (PowerPC), no apparent regressions.

Re: [PATCH v2] sched/membarrier: Fix redundant load of membarrier_state

2024-10-30 Thread Segher Boessenkool
Hi! On Tue, Oct 29, 2024 at 11:21:28AM +0530, Nysal Jan K.A. wrote: > On architectures where ARCH_HAS_SYNC_CORE_BEFORE_USERMODE > is not selected, sync_core_before_usermode() is a no-op. > In membarrier_mm_sync_core_before_usermode() the compiler does not > eliminate redundant branches and load of

RE: [PATCH net-next 0/3] Fix sparse warnings in dpaa_eth driver

2024-10-30 Thread Madalin Bucur (OSS)
> -Original Message- > From: Vladimir Oltean > Sent: Tuesday, October 29, 2024 6:43 PM > To: net...@vger.kernel.org > Cc: David S. Miller ; Eric Dumazet > ; Jakub Kicinski ; Paolo Abeni > ; Breno Leitao ; Madalin Bucur > ; Ioana Ciornei ; Radu- > Andrei Bulie ; Christophe Leroy > ; Sean An

RE: [PATCH net] net: dpaa_eth: print FD status in CPU endianness in dpaa_eth_fd tracepoint

2024-10-30 Thread Madalin Bucur (OSS)
> -Original Message- > From: Vladimir Oltean > Sent: Tuesday, October 29, 2024 6:31 PM > To: net...@vger.kernel.org; Radu-Andrei Bulie > Cc: David S. Miller ; Eric Dumazet > ; Jakub Kicinski ; Paolo Abeni > ; Breno Leitao ; Madalin Bucur > ; Ioana Ciornei ; Christophe > Leroy ; Sean Ander

Re: [RFC PATCH 2/2] arch/powerpc/kvm: Fix doorbells for nested KVM guests on PowerNV

2024-10-30 Thread Gautam Menghani
On Thu, Jul 04, 2024 at 10:10:05PM +1000, Nicholas Piggin wrote: > On Fri Jun 28, 2024 at 4:03 AM AEST, Gautam Menghani wrote: > > commit 6398326b9ba1("KVM: PPC: Book3S HV P9: Stop using vc->dpdes") > > introduced an optimization to use only vcpu->doorbell_request for SMT > > emulation for Power9 a

[PATCH v7 0/4] Support SMT control on arm64

2024-10-30 Thread Yicong Yang
From: Yicong Yang The core CPU control framework supports runtime SMT control which is not yet supported on arm64. Besides the general vulnerabilities concerns we want this runtime control on our arm64 server for: - better single CPU performance in some cases - saving overall power consumption

[PATCH v7 1/4] cpu/SMT: Provide a default topology_is_primary_thread()

2024-10-30 Thread Yicong Yang
From: Yicong Yang Currently if architectures want to support HOTPLUG_SMT they need to provide a topology_is_primary_thread() telling the framework which thread in the SMT cannot offline. However arm64 doesn't have a restriction on which thread in the SMT cannot offline, a simplest choice is that

[PATCH v7 2/4] arch_topology: Support SMT control for OF based system

2024-10-30 Thread Yicong Yang
From: Yicong Yang On building the topology from the devicetree, we've already gotten the SMT thread number of each core. Update the largest SMT thread number and enable the SMT control by the end of topology parsing. The core's SMT control provides two interface to the users [1]: 1) enable/disab

[PATCH v7 3/4] arm64: topology: Support SMT control on ACPI based system

2024-10-30 Thread Yicong Yang
From: Yicong Yang For ACPI we'll build the topology from PPTT and we cannot directly get the SMT number of each core. Instead using a temporary xarray to record the heterogeneous information (from ACPI_PPTT_ACPI_IDENTICAL) and SMT information of the first core in its heterogeneous CPU cluster whe

[PATCH v7 4/4] arm64: Kconfig: Enable HOTPLUG_SMT

2024-10-30 Thread Yicong Yang
From: Yicong Yang Enable HOTPLUG_SMT for SMT control. Signed-off-by: Yicong Yang --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index fd9df6dcc593..cccd0a07c050 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -243,

[PATCH v7 12/17] powerpc64/ftrace: Move ftrace sequence out of line

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Function profile sequence on powerpc includes two instructions at the beginning of each function: mflrr0 bl ftrace_caller The call to ftrace_caller() gets nop'ed out during kernel boot and is patched in when ftrace is enabled. Given the sequence, we c

Re: [PATCH net-next 1/3] soc: fsl_qbman: use be16_to_cpu() in qm_sg_entry_get_off()

2024-10-30 Thread Breno Leitao
On Tue, Oct 29, 2024 at 06:43:15PM +0200, Vladimir Oltean wrote: > struct qm_sg_entry :: offset is a 13-bit field, declared as __be16. > > When using be32_to_cpu(), a wrong value will be calculated on little > endian systems (Arm), because type promotion from 16-bit to 32-bit, > which is done befo

Re: [PATCH net-next 3/3] net: dpaa_eth: extract hash using __be32 pointer in rx_default_dqrr()

2024-10-30 Thread Breno Leitao
On Tue, Oct 29, 2024 at 06:43:17PM +0200, Vladimir Oltean wrote: > Sparse provides the following output: > > warning: cast to restricted __be32 > > This is a harmless warning due to the fact that we dereference the hash > stored in the FD using an incorrect type annotation. Suppress the > warning

[PATCH v7 15/17] powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Add support for DYNAMIC_FTRACE_WITH_DIRECT_CALLS similar to the arm64 implementation. ftrace direct calls allow custom trampolines to be called into directly from function ftrace call sites, bypassing the ftrace trampoline completely. This functionality is currently utilized b

Re: [RFC PATCH v1 01/57] mm: Add macros ahead of supporting boot-time page size selection

2024-10-30 Thread Ryan Roberts
Hi all (especially mm people!), On 14/10/2024 11:58, Ryan Roberts wrote: > arm64 can support multiple base page sizes. Instead of selecting a page > size at compile time, as is done today, we will make it possible to > select the desired page size on the command line. > > In this case PAGE_SHIFT

[PATCH v7 11/17] kbuild: Add generic hook for architectures to use before the final vmlinux link

2024-10-30 Thread Hari Bathini
From: Naveen N Rao On powerpc, we would like to be able to make a pass on vmlinux.o and generate a new object file to be linked into vmlinux. Add a generic pass in Makefile.vmlinux that architectures can use for this purpose. Architectures need to select CONFIG_ARCH_WANTS_PRE_LINK_VMLINUX and mu

[PATCH v7 04/17] powerpc32/ftrace: Unify 32-bit and 64-bit ftrace entry code

2024-10-30 Thread Hari Bathini
From: Naveen N Rao On 32-bit powerpc, gcc generates a three instruction sequence for function profiling: mflrr0 stw r0, 4(r1) bl _mcount On kernel boot, the call to _mcount() is nop-ed out, to be patched back in when ftrace is actually enabled. The 'stw' inst

[PATCH v7 05/17] powerpc/module_64: Convert #ifdef to IS_ENABLED()

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Minor refactor for converting #ifdef to IS_ENABLED(). Reviewed-by: Nicholas Piggin Signed-off-by: Naveen N Rao --- arch/powerpc/kernel/module_64.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/k

[PATCH v7 10/17] powerpc/ftrace: Add a postlink script to validate function tracer

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Function tracer on powerpc can only work with vmlinux having a .text size of up to ~64MB due to powerpc branch instruction having a limited relative branch range of 32MB. Today, this is only detected on kernel boot when ftrace is init'ed. Add a post-link script to check the siz

[PATCH v7 07/17] powerpc/ftrace: Skip instruction patching if the instructions are the same

2024-10-30 Thread Hari Bathini
From: Naveen N Rao To simplify upcoming changes to ftrace, add a check to skip actual instruction patching if the old and new instructions are the same. We still validate that the instruction is what we expect, but don't actually patch the same instruction again. Signed-off-by: Naveen N Rao ---

[PATCH v7 17/17] powerpc64/bpf: Add support for bpf trampolines

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Add support for bpf_arch_text_poke() and arch_prepare_bpf_trampoline() for 64-bit powerpc. While the code is generic, BPF trampolines are only enabled on 64-bit powerpc. 32-bit powerpc will need testing and some updates. BPF Trampolines adhere to the existing ftrace ABI utiliz

[PATCH v7 14/17] powerpc/ftrace: Add support for DYNAMIC_FTRACE_WITH_CALL_OPS

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Implement support for DYNAMIC_FTRACE_WITH_CALL_OPS similar to the arm64 implementation. This works by patching-in a pointer to an associated ftrace_ops structure before each traceable function. If multiple ftrace_ops are associated with a call site, then a special ftrace_list_

[PATCH v7 09/17] powerpc64/bpf: Fold bpf_jit_emit_func_call_hlp() into bpf_jit_emit_func_call_rel()

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Commit 61688a82e047 ("powerpc/bpf: enable kfunc call") enhanced bpf_jit_emit_func_call_hlp() to handle calls out to module region, where bpf progs are generated. The only difference now between bpf_jit_emit_func_call_hlp() and bpf_jit_emit_func_call_rel() is in handling of the

[PATCH v7 06/17] powerpc/ftrace: Remove pointer to struct module from dyn_arch_ftrace

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Pointer to struct module is only relevant for ftrace records belonging to kernel modules. Having this field in dyn_arch_ftrace wastes memory for all ftrace records belonging to the kernel. Remove the same in favour of looking up the module from the ftrace record address, simila

[PATCH v7 03/17] powerpc64/ftrace: Nop out additional 'std' instruction emitted by gcc v5.x

2024-10-30 Thread Hari Bathini
From: Naveen N Rao Gcc v5.x emits a 3-instruction sequence for -mprofile-kernel: mflrr0 std r0, 16(r1) bl _mcount Gcc v6.x moved to a simpler 2-instruction sequence by removing the 'std' instruction. The store saved the return address in the LR save area in t

[PATCH v7 00/17] powerpc: Core ftrace rework, support for ftrace direct and bpf trampolines

2024-10-30 Thread Hari Bathini
This is v7 of the series posted here: https://lore.kernel.org/all/20241018173632.277333-1-hbath...@linux.ibm.com/ This series reworks core ftrace support on powerpc to have the function profiling sequence moved out of line. This enables us to have a single nop at kernel function entry virtually el