Re: [PATCH bpf] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-07 Thread Michael Ellerman
Puranjay Mohan writes: > The Linux Kernel Memory Model [1][2] requires RMW operations that have a > return value to be fully ordered. > > BPF atomic operations with BPF_FETCH (including BPF_XCHG and > BPF_CMPXCHG) return a value back so they need to be JITed to fully > ordered operations. POWERPC

Re: [PATCH 0/4] ASoC: Constify static snd_pcm_hardware

2024-05-07 Thread Mark Brown
On Mon, 29 Apr 2024 13:48:45 +0200, Krzysztof Kozlowski wrote: > No dependencies. > > Static 'struct snd_pcm_hardware' is not modified by few drivers and its > copy is passed to the core, so it can be made const for increased code > safety. > > Best regards, > Krzysztof > > [...] Applied to

Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files

2024-05-07 Thread kernel test robot
Hi Vignesh, kernel test robot noticed the following build warnings: [auto build test WARNING on kees/for-next/execve] [also build test WARNING on tip/x86/core kees/for-next/pstore kees/for-next/kspp linus/master v6.9-rc7 next-20240507] [If your patch is applied to the wrong git tree, kindly

Re: [PATCH RESEND v8 07/16] mm/execmem, arch: convert simple overrides of module_alloc to execmem

2024-05-07 Thread Google
On Sun, 5 May 2024 19:06:19 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Several architectures override module_alloc() only to define address > range for code allocations different than VMALLOC address space. > > Provide a generic implementation in execmem that uses the

Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files

2024-05-07 Thread kernel test robot
Hi Vignesh, kernel test robot noticed the following build warnings: [auto build test WARNING on kees/for-next/execve] [also build test WARNING on tip/x86/core kees/for-next/pstore kees/for-next/kspp linus/master v6.9-rc7 next-20240507] [If your patch is applied to the wrong git tree, kindly

Re: [PATCH RESEND v8 05/16] module: make module_memory_{alloc,free} more self-contained

2024-05-07 Thread Google
On Sun, 5 May 2024 19:06:17 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Move the logic related to the memory allocation and freeing into > module_memory_alloc() and module_memory_free(). > Looks good to me. Reviewed-by: Masami Hiramatsu (Google) Thanks, > Signed-off-by:

[PATCH bpf] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-07 Thread Puranjay Mohan
The Linux Kernel Memory Model [1][2] requires RMW operations that have a return value to be fully ordered. BPF atomic operations with BPF_FETCH (including BPF_XCHG and BPF_CMPXCHG) return a value back so they need to be JITed to fully ordered operations. POWERPC currently emits relaxed operations

Re: [PATCH 1/1] [RFC] ethernet: Convert from tasklet to BH workqueue

2024-05-07 Thread Russell King (Oracle)
On Tue, May 07, 2024 at 07:01:11PM +, Allen Pais wrote: > The only generic interface to execute asynchronously in the BH context is > tasklet; however, it's marked deprecated and has some design flaws. To > replace tasklets, BH workqueue support was recently added. A BH workqueue > behaves

Re: [PATCH 1/1] [RFC] ethernet: Convert from tasklet to BH workqueue

2024-05-07 Thread Allen
On Tue, May 7, 2024 at 12:23 PM Russell King (Oracle) wrote: > > On Tue, May 07, 2024 at 07:01:11PM +, Allen Pais wrote: > > The only generic interface to execute asynchronously in the BH context is > > tasklet; however, it's marked deprecated and has some design flaws. To > > replace

[PATCH 1/1] [RFC] ethernet: Convert from tasklet to BH workqueue

2024-05-07 Thread Allen Pais
The only generic interface to execute asynchronously in the BH context is tasklet; however, it's marked deprecated and has some design flaws. To replace tasklets, BH workqueue support was recently added. A BH workqueue behaves similarly to regular workqueues except that the queued work items are

[PATCH 0/1] Convert tasklets to BH workqueues in ethernet drivers

2024-05-07 Thread Allen Pais
This series focuses on converting the existing implementation of tasklets to bottom half (BH) workqueues across various Ethernet drivers under drivers/net/ethernet/*. Impact: The conversion is expected to maintain or improve the performance of the affected drivers. It also improves the

Re: [PATCH v3] kprobe/ftrace: bail out if ftrace was killed

2024-05-07 Thread Stephen Brennan
Christophe Leroy writes: > Le 01/05/2024 à 18:29, Stephen Brennan a écrit : >> If an error happens in ftrace, ftrace_kill() will prevent disarming >> kprobes. Eventually, the ftrace_ops associated with the kprobes will be >> freed, yet the kprobes will still be active, and when triggered, they >>

Re: [RFC PATCH v2 0/6] powerpc: pSeries: vfio: iommu: Re-enable support for SPAPR TCE VFIO

2024-05-07 Thread Shivaprasad G Bhat
Hi Jason, On 5/6/24 23:13, Jason Gunthorpe wrote: On Sat, May 04, 2024 at 12:33:53AM +0530, Shivaprasad G Bhat wrote: We have legacy workloads using VFIO in userspace/kvm guests running on downstream distro kernels. We want these workloads to be able to continue running on our arch. It has

Re: [kvm-unit-tests PATCH v9 07/31] scripts: allow machine option to be specified in unittests.cfg

2024-05-07 Thread Thomas Huth
On 04/05/2024 14.28, Nicholas Piggin wrote: This allows different machines with different requirements to be supported by run_tests.sh, similarly to how different accelerators are handled. Acked-by: Thomas Huth Acked-by: Andrew Jones Signed-off-by: Nicholas Piggin --- docs/unittests.txt

Re: [PATCH V2 3/9] tools/perf: Fix a comment about multi_regs in extract_reg_offset function

2024-05-07 Thread Arnaldo Carvalho de Melo
On Mon, May 06, 2024 at 09:40:15PM -0700, Namhyung Kim wrote: > On Mon, May 6, 2024 at 5:19 AM Athira Rajeev > wrote: > > > > Fix a comment in function which explains how multi_regs field gets set > > for an instruction. In the example, "mov %rsi, 8(%rbx,%rcx,4)", the > > comment mistakenly

Re: [PATCH v18 0/6] powerpc/crash: Kernel handling of CPU and memory hotplug

2024-05-07 Thread Michael Ellerman
On Tue, 26 Mar 2024 11:24:07 +0530, Sourabh Jain wrote: > Commit 247262756121 ("crash: add generic infrastructure for crash > hotplug support") added a generic infrastructure that allows > architectures to selectively update the kdump image component during CPU > or memory add/remove events within

Re: [PATCH] powerpc/crash: remove unnecessary NULL check before kvfree()

2024-05-07 Thread Michael Ellerman
On Thu, 02 May 2024 23:50:40 +0530, Sourabh Jain wrote: > Fix the following coccicheck build warning: > > arch/powerpc/kexec/crash.c:488:2-8: WARNING: NULL check before some > freeing functions is not needed. > > Applied to powerpc/topic/kdump-hotplug. [1/1] powerpc/crash: remove unnecessary

Re: [PATCH 00/13] ASoC: Use snd_soc_substream_to_rtd() for accessing private_data

2024-05-07 Thread Mark Brown
On Tue, 30 Apr 2024 16:02:09 +0200, Krzysztof Kozlowski wrote: > Do not open-code snd_soc_substream_to_rtd() when accessing > snd_pcm_substream->private_data. This makes code more consistent with > rest of ASoC and allows in the future to move the field to any other > place or add additional

[PATCH] macintosh/ams: Fix unused variable warning

2024-05-07 Thread Michael Ellerman
If both CONFIG_SENSORS_AMS_PMU and CONFIG_SENSORS_AMS_I2C are unset, there is an unused variable warning in the ams driver: drivers/macintosh/ams/ams-core.c: In function 'ams_init': drivers/macintosh/ams/ams-core.c:181:29: warning: unused variable 'np' 181 | struct device_node

Re: [kvm-unit-tests PATCH v9 17/31] powerpc: Add cpu_relax

2024-05-07 Thread Thomas Huth
On 04/05/2024 14.28, Nicholas Piggin wrote: Add a cpu_relax variant that uses SMT priority nop instructions like Linux. This was split out of the SMP patch because it affects the sprs test case. Signed-off-by: Nicholas Piggin --- lib/ppc64/asm/barrier.h | 1 + powerpc/sprs.c | 4

Re: [PATCH 1/2] radix/kfence: map __kfence_pool at page granularity

2024-05-07 Thread Christophe Leroy
Le 24/04/2024 à 13:09, Hari Bathini a écrit : > When KFENCE is enabled, total system memory is mapped at page level > granularity. But in radix MMU mode, ~3GB additional memory is needed > to map 100GB of system memory at page level granularity when compared > to using 2MB direct mapping. This

[powerpc:topic/kdump-hotplug] BUILD SUCCESS 9803af291162dbca4b9773586a3f5c392f0dd974

2024-05-07 Thread kernel test robot
allmodconfig gcc arc allnoconfig gcc arc allyesconfig gcc arc defconfig gcc arc nsimosci_hs_defconfig gcc arc randconfig-001-20240507 gcc arc

Re: [kvm-unit-tests PATCH v9 12/31] powerpc: general interrupt tests

2024-05-07 Thread Thomas Huth
On 04/05/2024 14.28, Nicholas Piggin wrote: Add basic testing of various kinds of interrupts, machine check, page fault, illegal, decrementer, trace, syscall, etc. This has a known failure on QEMU TCG pseries machines where MSR[ME] can be incorrectly set to 0. Signed-off-by: Nicholas Piggin

Re: [kvm-unit-tests PATCH v9 03/31] powerpc: Mark known failing tests as kfail

2024-05-07 Thread Thomas Huth
On 07/05/2024 06.07, Nicholas Piggin wrote: On Mon May 6, 2024 at 5:37 PM AEST, Thomas Huth wrote: On 04/05/2024 14.28, Nicholas Piggin wrote: Mark the failing h_cede_tm and spapr_vpa tests as kfail. Signed-off-by: Nicholas Piggin --- powerpc/spapr_vpa.c | 3 ++- powerpc/tm.c| 3

[PATCH v7] arch/powerpc/kvm: Add support for reading VPA counters for pseries guests

2024-05-07 Thread Gautam Menghani
PAPR hypervisor has introduced three new counters in the VPA area of LPAR CPUs for KVM L2 guest (see [1] for terminology) observability - 2 for context switches from host to guest and vice versa, and 1 counter for getting the total time spent inside the KVM guest. Add a tracepoint that enables

Re: [PATCH v4 2/2] powerpc/bpf: enable kfunc call

2024-05-07 Thread Naveen N Rao
On Thu, May 02, 2024 at 11:02:05PM GMT, Hari Bathini wrote: > Currently, bpf jit code on powerpc assumes all the bpf functions and > helpers to be part of core kernel text. This is false for kfunc case, > as function addresses may not be part of core kernel text area. So, > add support for

Re: [PATCH v4 1/2] powerpc64/bpf: fix tail calls for PCREL addressing

2024-05-07 Thread Naveen N Rao
On Thu, May 02, 2024 at 11:02:04PM GMT, Hari Bathini wrote: > With PCREL addressing, there is no kernel TOC. So, it is not setup in > prologue when PCREL addressing is used. But the number of instructions > to skip on a tail call was not adjusted accordingly. That resulted in > not so obvious

Re: [PATCH 6/7] powerpc: Replace CONFIG_4xx with CONFIG_44x

2024-05-07 Thread Christophe Leroy
Le 06/05/2024 à 14:51, Michael Ellerman a écrit : > Replace 4xx usage with 44x, and replace 4xx_SOC with 44x. You can go one step further because CONFIG_44x implies CONFIG_BOOKE, see

Re: [PATCH V2 8/9] tools/perf: Add support to find global register variables using find_data_type_global_reg

2024-05-07 Thread Christophe Leroy
Le 06/05/2024 à 14:19, Athira Rajeev a écrit : > There are cases where define a global register variable and associate it > with a specified register. Example, in powerpc, two registers are > defined to represent variable: > 1. r13: represents local_paca > register struct paca_struct *local_paca

Re: [PATCH V2 7/9] tools/perf: Update instruction tracking with add instruction

2024-05-07 Thread Christophe Leroy
Le 06/05/2024 à 14:19, Athira Rajeev a écrit : > Update instruction tracking with add instruction. Apart from "mr" > instruction, the register state is carried on by other insns, ie, > "add, addi, addis". Since these are not memory instructions and doesn't > fall in the range of (32 to 63), add

[PATCH v2 1/1] x86/elf: Add a new .note section containing Xfeatures information to x86 core files

2024-05-07 Thread Vignesh Balasubramanian
Add a new .note section containing type, size, offset and flags of every xfeature that is present. This information will be used by the debuggers to understand the XSAVE layout of the machine where the core file is dumped, and to read XSAVE registers, especially during cross-platform debugging.

[PATCH v2 0/1] Add XSAVE layout description to Core files for debuggers to support varying XSAVE layouts

2024-05-07 Thread Vignesh Balasubramanian
This patch proposes to add an extra .note section in the corefile to dump the CPUID information of a machine. This is being done to solve the issue of tools like the debuggers having to deal with coredumps from machines with varying XSAVE layouts in spite of having the same XCR0 bits. The new

Re: [PATCH V2 6/9] tools/perf: Update instruction tracking for powerpc

2024-05-07 Thread Christophe Leroy
Le 06/05/2024 à 14:19, Athira Rajeev a écrit : > Add instruction tracking function "update_insn_state_powerpc" for > powerpc. Example sequence in powerpc: > > ld r10,264(r3) > mr r31,r3 > < > ld r9,312(r31) Your approach looks fragile. mr is a simplified instruction which in

Re: [PATCH V2 5/9] tools/perf: Update parameters for reg extract functions to use raw instruction on powerpc

2024-05-07 Thread Christophe Leroy
Le 06/05/2024 à 14:19, Athira Rajeev a écrit : > Use the raw instruction code and macros to identify memory instructions, > extract register fields and also offset. The implementation addresses > the D-form, X-form, DS-form instructions. Two main functions are added. > New parse function

Re: [PATCH V2 4/9] tools/perf: Add support to capture and parse raw instruction in objdump

2024-05-07 Thread Christophe Leroy
Le 06/05/2024 à 14:19, Athira Rajeev a écrit : > Add support to capture and parse raw instruction in objdump. What's the purpose of using 'objdump' for reading raw instructions ? Can't they be read directly without invoking 'objdump' ? It looks odd to me to use objdump to provide readable

Re: [PATCH v1 1/9] selftests/powerpc/dexcr: Add -no-pie to hashchk tests

2024-05-07 Thread Andrew Donnellan
On Wed, 2024-04-17 at 21:23 +1000, Benjamin Gray wrote: > The hashchk tests want to verify that the hash key is changed over > exec. > It does so by calculating hashes at the same address across an exec. > This is made simpler by disabling PIE functionality, so we can > re-execute ourselves and be

Re: [PATCH v6] arch/powerpc/kvm: Add support for reading VPA counters for pseries guests

2024-05-07 Thread Naveen N Rao
On Mon, May 06, 2024 at 08:26:03PM GMT, Gautam Menghani wrote: > PAPR hypervisor has introduced three new counters in the VPA area of > LPAR CPUs for KVM L2 guest (see [1] for terminology) observability - 2 > for context switches from host to guest and vice versa, and 1 counter > for getting the