Re: [PATCH] powerpc: Remove eieio in _memcpy_fromio

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 16:07, Julian Vetter a écrit : [Vous ne recevez pas souvent de courriers de jul...@outer-limits.org. Découvrez pourquoi ceci est important à https://aka.ms/ LearnAboutSenderIdentification ] On 1/28/25 15:16, Christophe Leroy wrote: Le 28/01/2025 à 14:57, Julian Vetter a é

Re: [PATCH] powerpc: Remove eieio in _memcpy_fromio

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 16:24, Christophe Leroy a écrit : Le 28/01/2025 à 16:07, Julian Vetter a écrit : [Vous ne recevez pas souvent de courriers de jul...@outer-limits.org. Découvrez pourquoi ceci est important à https://aka.ms/ LearnAboutSenderIdentification ] On 1/28/25 15:16, Christophe Ler

Re: [PATCH 1/2] powerpc: properly negate error in syscall_set_return_value() in sc case

2025-01-28 Thread Dmitry V. Levin
On Tue, Jan 28, 2025 at 03:59:29PM +0100, Christophe Leroy wrote: > Le 27/01/2025 à 19:13, Dmitry V. Levin a écrit : > > According to the Power Architecture Linux system call ABI documented in > > [1], when the syscall is made with the sc instruction, both a value and an > > error condition are ret

Re: [PATCH 1/2] powerpc: properly negate error in syscall_set_return_value() in sc case

2025-01-28 Thread Eugene Syromyatnikov
On Tue, Jan 28, 2025 at 3:59 PM Christophe Leroy wrote: > > > Le 27/01/2025 à 19:13, Dmitry V. Levin a écrit : > > According to the Power Architecture Linux system call ABI documented in > > [1], when the syscall is made with the sc instruction, both a value and an > > error condition are returned

Re: [PATCH] kbuild: Add missing $(objtree) prefix to powerpc crtsavres.o artifact

2025-01-28 Thread Kienan Stewart
Hi, I missed a few CCs, looping them in now. Apologies for the extra noise. thanks, kienan On 1/27/25 1:47 PM, Kienan Stewart wrote: In the upstream commit 214c0eea43b2ea66bcd6467ea57e47ce8874191b ("kbuild: add $(objtree)/ prefix to some in-kernel build artifacts") artifacts required for build

Re: [PATCH 1/2] powerpc: properly negate error in syscall_set_return_value() in sc case

2025-01-28 Thread Christophe Leroy
Le 27/01/2025 à 19:13, Dmitry V. Levin a écrit : According to the Power Architecture Linux system call ABI documented in [1], when the syscall is made with the sc instruction, both a value and an error condition are returned, where r3 register contains the return value, and cr0.SO bit specifies

Re: [PATCH v3 2/6] syscall.h: add syscall_set_arguments() and syscall_set_return_value()

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 10:16, Dmitry V. Levin a écrit : These functions are going to be needed on all HAVE_ARCH_TRACEHOOK architectures to implement PTRACE_SET_SYSCALL_INFO API. The subject is misleading. syscall_set_return_value() already exists on most architectures and was not addressed by comm

Re: [PATCH v3 3/6] syscall.h: introduce syscall_set_nr()

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 10:16, Dmitry V. Levin a écrit : Similar to syscall_set_arguments() that complements syscall_get_arguments(), introduce syscall_set_nr() that complements syscall_get_nr(). syscall_set_nr() is going to be needed along with syscall_set_arguments() on all HAVE_ARCH_TRACEHOOK arch

Re: [PATCH 2/2] powerpc: fix inconsistencies in syscall error return handling

2025-01-28 Thread Christophe Leroy
Le 27/01/2025 à 19:14, Dmitry V. Levin a écrit : Since the introduction of SECCOMP_RET_TRACE support, the kernel supports simultaneously both the generic kernel -ERRORCODE return value ABI and the powerpc sc syscall return ABI for PTRACE_EVENT_SECCOMP tracers. This change is an attempt to addr

Re: [PATCH] powerpc: Remove eieio in _memcpy_fromio

2025-01-28 Thread Julian Vetter
On 1/28/25 15:16, Christophe Leroy wrote: Le 28/01/2025 à 14:57, Julian Vetter a écrit : Remove the eieio() calls in _memcpy_fromio, to bring its implementation closer to the one from lib/iomem_copy.c. These eieio() calls don't seem to be necessary, because the _memcpy_toio completely omits th

[PATCH] powerpc: Remove eieio in _memcpy_fromio

2025-01-28 Thread Julian Vetter
Remove the eieio() calls in _memcpy_fromio, to bring its implementation closer to the one from lib/iomem_copy.c. These eieio() calls don't seem to be necessary, because the _memcpy_toio completely omits them. Also the legacy code from ppc was not doing them. Signed-off-by: Julian Vetter --- arch

Re: [PATCH 27/27] mm/hugetlb: enable bootmem allocation from CMA areas

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 00:22, Frank van der Linden a écrit : If hugetlb_cma_only is enabled, we know that hugetlb pages can only be allocated from CMA. Now that there is an interface to do early reservations from a CMA area (returning memblock memory), it can be used to allocate hugetlb pages from CM

Re: [PATCH v3 4/6] kvm powerpc/book3s-apiv2: Introduce kvm-hv specific PMU

2025-01-28 Thread Madhavan Srinivasan
On 1/27/25 1:06 PM, Vaibhav Jain wrote: > Hi Athira, > > Thanks for reviewing this patch series. My responses to your review > comment inline below: > > > Athira Rajeev writes: > >>> On 23 Jan 2025, at 5:37 PM, Vaibhav Jain wrote: >>> >>> Introduce a new PMU named 'kvm-hv' to report Book3s

Re: [PATCH 2/2] powerpc: fix inconsistencies in syscall error return handling

2025-01-28 Thread Dmitry V. Levin
On Tue, Jan 28, 2025 at 07:01:47PM +0100, Christophe Leroy wrote: > Le 27/01/2025 à 19:14, Dmitry V. Levin a écrit : > > Since the introduction of SECCOMP_RET_TRACE support, the kernel supports > > simultaneously both the generic kernel -ERRORCODE return value ABI and > > the powerpc sc syscall ret

Re: Re: Re: Re: [PATCH v2] treewide: const qualify ctl_tables where applicable

2025-01-28 Thread Joel Granados
On Mon, Jan 27, 2025 at 03:42:39PM +, Matthew Wilcox wrote: > On Mon, Jan 27, 2025 at 04:55:58PM +0200, Jani Nikula wrote: > > You could have static const within functions too. You get the rodata > > protection and function local scope, best of both worlds? > > timer_active is on the stack, so

[PATCH v3 0/6] ptrace: introduce PTRACE_SET_SYSCALL_INFO API

2025-01-28 Thread Dmitry V. Levin
PTRACE_SET_SYSCALL_INFO is a generic ptrace API that complements PTRACE_GET_SYSCALL_INFO by letting the ptracer modify details of system calls the tracee is blocked in. This API allows ptracers to obtain and modify system call details in a straightforward and architecture-agnostic way. Current im

[PATCH v3 3/6] syscall.h: introduce syscall_set_nr()

2025-01-28 Thread Dmitry V. Levin
Similar to syscall_set_arguments() that complements syscall_get_arguments(), introduce syscall_set_nr() that complements syscall_get_nr(). syscall_set_nr() is going to be needed along with syscall_set_arguments() on all HAVE_ARCH_TRACEHOOK architectures to implement PTRACE_SET_SYSCALL_INFO API. S

[PATCH v3 2/6] syscall.h: add syscall_set_arguments() and syscall_set_return_value()

2025-01-28 Thread Dmitry V. Levin
These functions are going to be needed on all HAVE_ARCH_TRACEHOOK architectures to implement PTRACE_SET_SYSCALL_INFO API. This partially reverts commit 7962c2eddbfe ("arch: remove unused function syscall_set_arguments()") by reusing some of old syscall_set_arguments() implementations. Signed-off-

[PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE

2025-01-28 Thread Paul Mackerras
Power ISA v3.1 implementations in the Linux Compliancy Subset and lower are not required to implement broadcast TLBIE, and in fact Microwatt doesn't. To avoid the need to specify "disable_tlbie" on the kernel command line on SMP Microwatt systems, this defines a config option that asserts that bro

[PATCH 0/5] Microwatt updates

2025-01-28 Thread Paul Mackerras
This patch series updates the kernel support for the Microwatt soft-core and its implementation on FPGA systems, particularly the Digilent Arty A7-100 FPGA development board. Microwatt now supports almost all of the features of the SFFS (Scalar Fixed-poin and Floating-point Subset) compliancy subs

[PATCH 5/5] powerpc/microwatt: Add SMP support

2025-01-28 Thread Paul Mackerras
This adds support for Microwatt systems with more than one core, and updates the device tree for a 2-core version. (This does not prevent the kernel from running on a single-core system.) Signed-off-by: Paul Mackerras --- arch/powerpc/boot/dts/microwatt.dts | 34 ++-- a

[PATCH 2/5] powerpc/microwatt: Device-tree updates

2025-01-28 Thread Paul Mackerras
Microwatt now implements ISA v3.1 (SFFS compliancy subset), including prefixed instructions, scv/rfscv, and the FSCR, HFSCR, TAR, and CTRL registers. The privileged mode of operation is now hypervisor mode and there is no privileged non-hypervisor mode; the MSR[HV] bit is forced to 1. Besides upd

[PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Paul Mackerras
This uses the 'wait' instruction to pause instruction execution when idle until an interrupt occurs. Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/microwatt/setup.c | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/platforms/microwatt/setup.c b/arch/powerpc/pl

[PATCH 1/5] powerpc/microwatt: Select COMMON_CLK in order to get the clock framework

2025-01-28 Thread Paul Mackerras
This is to allow us to select Litex MMC host controller driver, which drives the litesdcard gateware. Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/microwatt/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/microwatt/Kconfig b/arch/powerpc/platforms/

Re: [f2fs-dev] [PATCH v4 00/19] Wire up CRC32 library functions to arch-optimized code

2025-01-28 Thread patchwork-bot+f2fs
Hello: This series was applied to jaegeuk/f2fs.git (dev) by Eric Biggers : On Sun, 1 Dec 2024 17:08:25 -0800 you wrote: > This patchset applies to v6.13-rc1 and is also available in git via: > > git fetch > https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git > crc32-lib-v4

[powerpc:merge] BUILD SUCCESS cd24e66993a004318e9caf6daab4d80015e1a9b6

2025-01-28 Thread kernel test robot
clang-18 arc nsimosci_hs_smp_defconfiggcc-13.2.0 arc randconfig-001-20250128gcc-13.2.0 arc randconfig-002-20250128gcc-13.2.0 arm allmodconfigclang-18 arm allmodconfig

[PATCH v2 4/4] seccomp: remove the 'sd' argument from __seccomp_filter()

2025-01-28 Thread Oleg Nesterov
After the previous change 'sd' is always NULL. Signed-off-by: Oleg Nesterov Reviewed-by: Kees Cook --- kernel/seccomp.c | 21 - 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 281e853bae8c..4bd2eb50f77b 100644 --- a/ke

[PATCH v2 1/4] seccomp/mips: change syscall_trace_enter() to use secure_computing()

2025-01-28 Thread Oleg Nesterov
arch/mips/Kconfig selects HAVE_ARCH_SECCOMP_FILTER so syscall_trace_enter() can just use __secure_computing(NULL) and rely on populate_seccomp_data(sd) and "sd == NULL" checks in __secure_computing(sd) paths. With the change above syscall_trace_enter() can just use secure_computing() and avoid #if

[PATCH v2 0/4] seccomp: remove the 'sd' argument from __secure_computing()

2025-01-28 Thread Oleg Nesterov
Hello, Link to v1: https://lore.kernel.org/all/20250120134409.ga21...@redhat.com/ Only 2/4 was changed, please see interdiff at the end. I've included the acks I got on 1/4, 3/4, and 4/4 (thanks!). Oleg. --- arch/mips/kernel/ptrace.c | 20 ++- arch/powerpc/kernel/ptra

[PATCH v2 2/4] seccomp: fix the __secure_computing() stub for !HAVE_ARCH_SECCOMP_FILTER

2025-01-28 Thread Oleg Nesterov
Depending on CONFIG_HAVE_ARCH_SECCOMP_FILTER, __secure_computing(NULL) will crash or not. This is not consistent/safe, especially considering that after the previous change __secure_computing(sd) is always called with sd == NULL. Fortunately, if CONFIG_HAVE_ARCH_SECCOMP_FILTER=n, __secure_computin

[PATCH v2 3/4] seccomp: remove the 'sd' argument from __secure_computing()

2025-01-28 Thread Oleg Nesterov
After the previous changes 'sd' is always NULL. Signed-off-by: Oleg Nesterov Reviewed-by: Kees Cook --- arch/powerpc/kernel/ptrace/ptrace.c | 2 +- include/linux/seccomp.h | 6 +++--- kernel/entry/common.c | 2 +- kernel/seccomp.c| 12 +--

Re: [PATCH v3 2/6] syscall.h: add syscall_set_arguments() and syscall_set_return_value()

2025-01-28 Thread Dmitry V. Levin
On Tue, Jan 28, 2025 at 04:04:34PM +0100, Christophe Leroy wrote: > Le 28/01/2025 à 10:16, Dmitry V. Levin a écrit : > > These functions are going to be needed on all HAVE_ARCH_TRACEHOOK > > architectures to implement PTRACE_SET_SYSCALL_INFO API. > > The subject is misleading. syscall_set_return_v

Re: [PATCH v3 3/6] syscall.h: introduce syscall_set_nr()

2025-01-28 Thread Dmitry V. Levin
On Tue, Jan 28, 2025 at 04:13:52PM +0100, Christophe Leroy wrote: > Le 28/01/2025 à 10:16, Dmitry V. Levin a écrit : > > Similar to syscall_set_arguments() that complements > > syscall_get_arguments(), introduce syscall_set_nr() > > that complements syscall_get_nr(). > > > > syscall_set_nr() is go

Re: [PATCH 27/27] mm/hugetlb: enable bootmem allocation from CMA areas

2025-01-28 Thread Frank van der Linden
Hi Christophe, thanks for your comments. Replies inline below. On Tue, Jan 28, 2025 at 12:55 AM Christophe Leroy wrote: > > > > Le 28/01/2025 à 00:22, Frank van der Linden a écrit : > > If hugetlb_cma_only is enabled, we know that hugetlb pages > > can only be allocated from CMA. Now that there i

Re: [PATCH] powerpc: Remove eieio in _memcpy_fromio

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 14:57, Julian Vetter a écrit : Remove the eieio() calls in _memcpy_fromio, to bring its implementation closer to the one from lib/iomem_copy.c. These eieio() calls don't seem to be necessary, because the _memcpy_toio completely omits them. Also the legacy code from ppc was not

Re: Re: Re: Re: [PATCH v2] treewide: const qualify ctl_tables where applicable

2025-01-28 Thread Paul Moore
On Tue, Jan 28, 2025 at 6:22 AM Joel Granados wrote: > On Mon, Jan 27, 2025 at 03:42:39PM +, Matthew Wilcox wrote: > > On Mon, Jan 27, 2025 at 04:55:58PM +0200, Jani Nikula wrote: > > > You could have static const within functions too. You get the rodata > > > protection and function local sco

[PATCH v2 05/13] cpumask: deprecate cpumask_next_wrap()

2025-01-28 Thread Yury Norov
The next patch aligns implementation of cpumask_next_wrap() with the find_next_bit_wrap(), and it changes function signature. To make the transition smooth, this patch deprecates current implementation by adding an _old suffix. The following patches switch current users to the new implementation o

[PATCH v2 06/13] cpumask: re-introduce cpumask_next{,_and}_wrap()

2025-01-28 Thread Yury Norov
cpumask_next_wrap_old() has two additional parameters, comparing to its generic counterpart find_next_bit_wrap(). The reason for that is historical. Before 4fe49b3b97c262 ("lib/bitmap: introduce for_each_set_bit_wrap() macro"), cpumask_next_wrap() was used to implement for_each_cpu_wrap() iterator

[PATCH v2 00/13] cpumask: cleanup cpumask_next_wrap() implementation and usage

2025-01-28 Thread Yury Norov
cpumask_next_wrap() is overly complicated, comparing to it's generic version find_next_bit_wrap(), not mentioning it duplicates the above. It roots to the times when the function was used in the implementation of for_each_cpu_wrap() iterator. The function has 2 additional parameters that were used

[PATCH v2 04/13] powerpc/xmon: simplify xmon_batch_next_cpu()

2025-01-28 Thread Yury Norov
The function opencodes for_each_cpu_wrap() macro. As a loop termination condition it uses cpumask_empty(), which is O(N), and it makes the whole algorithm O(N^2). Switching to for_each_cpu_wrap() simplifies the logic, and makes the algorithm linear. Signed-off-by: Yury Norov --- arch/powerpc/xmo

Re: [PATCH] powerpc: Remove eieio in _memcpy_fromio

2025-01-28 Thread Arnd Bergmann
On Tue, Jan 28, 2025, at 16:34, Christophe Leroy wrote: > Le 28/01/2025 à 16:24, Christophe Leroy a écrit : >> Le 28/01/2025 à 16:07, Julian Vetter a écrit : >>> With 'ppc' I was refering to 'include/asm-ppc/io.h'. But you're right, >>> when going back a bit, in the 'include/asm-powerpc/io.h' there

[PATCH v2 03/13] ibmvnic: simplify ibmvnic_set_queue_affinity()

2025-01-28 Thread Yury Norov
A loop based on cpumask_next_wrap() opencodes the dedicated macro for_each_online_cpu_wrap(). Using the macro allows to avoid setting bits affinity mask more than once when stride >= num_online_cpus. This also helps to drop cpumask handling code in the caller function. CC: Nick Child Signed-off-

Re: [PATCH 1/2] powerpc: properly negate error in syscall_set_return_value() in sc case

2025-01-28 Thread Dmitry V. Levin
On Tue, Jan 28, 2025 at 05:00:31PM +0100, Christophe Leroy wrote: > Le 28/01/2025 à 16:52, Dmitry V. Levin a écrit : > > On Tue, Jan 28, 2025 at 03:59:29PM +0100, Christophe Leroy wrote: > >> Le 27/01/2025 à 19:13, Dmitry V. Levin a écrit : > >>> According to the Power Architecture Linux system cal

Re: [PATCH 1/2] powerpc: properly negate error in syscall_set_return_value() in sc case

2025-01-28 Thread Christophe Leroy
Le 28/01/2025 à 16:52, Dmitry V. Levin a écrit : On Tue, Jan 28, 2025 at 03:59:29PM +0100, Christophe Leroy wrote: Le 27/01/2025 à 19:13, Dmitry V. Levin a écrit : According to the Power Architecture Linux system call ABI documented in [1], when the syscall is made with the sc instruction, b

Re: [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:53 AM AEST, Paul Mackerras wrote: > Power ISA v3.1 implementations in the Linux Compliancy Subset and > lower are not required to implement broadcast TLBIE, and in fact > Microwatt doesn't. To avoid the need to specify "disable_tlbie" on > the kernel command line on SMP Mi

Re: [PATCH 5/5] powerpc/microwatt: Add SMP support

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:55 AM AEST, Paul Mackerras wrote: > This adds support for Microwatt systems with more than one core, and > updates the device tree for a 2-core version. (This does not prevent > the kernel from running on a single-core system.) > > Signed-off-by: Paul Mackerras Well, I'm

Re: [PATCH 2/5] powerpc/microwatt: Device-tree updates

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote: > Microwatt now implements ISA v3.1 (SFFS compliancy subset), including > prefixed instructions, scv/rfscv, and the FSCR, HFSCR, TAR, and CTRL > registers. The privileged mode of operation is now hypervisor mode > and there is no privilege

Re: [PATCH 1/5] powerpc/microwatt: Select COMMON_CLK in order to get the clock framework

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:51 AM AEST, Paul Mackerras wrote: > This is to allow us to select Litex MMC host controller driver, which > drives the litesdcard gateware. > > Signed-off-by: Paul Mackerras Acked-by: Nicholas Piggin > --- > arch/powerpc/platforms/microwatt/Kconfig | 1 + > 1 file chan

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Nicholas Piggin
On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote: > This uses the 'wait' instruction to pause instruction execution when > idle until an interrupt occurs. > > Signed-off-by: Paul Mackerras > --- > arch/powerpc/platforms/microwatt/setup.c | 9 + > 1 file changed, 9 insertions(+) >

Re: [PATCH 3/5] powerpc/microwatt: Define an idle power-save function

2025-01-28 Thread Paul Mackerras
On Wed, Jan 29, 2025 at 04:06:03PM +1000, Nicholas Piggin wrote: > On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote: > > This uses the 'wait' instruction to pause instruction execution when > > idle until an interrupt occurs. > > > > Signed-off-by: Paul Mackerras > > --- > > arch/powerpc

Re: [PATCH 5/5] powerpc/microwatt: Add SMP support

2025-01-28 Thread Paul Mackerras
On Wed, Jan 29, 2025 at 04:21:26PM +1000, Nicholas Piggin wrote: > On Wed Jan 29, 2025 at 8:55 AM AEST, Paul Mackerras wrote: > > This adds support for Microwatt systems with more than one core, and > > updates the device tree for a 2-core version. (This does not prevent > > the kernel from runnin

Re: [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE

2025-01-28 Thread Paul Mackerras
On Wed, Jan 29, 2025 at 04:14:25PM +1000, Nicholas Piggin wrote: > On Wed Jan 29, 2025 at 8:53 AM AEST, Paul Mackerras wrote: > > Power ISA v3.1 implementations in the Linux Compliancy Subset and > > lower are not required to implement broadcast TLBIE, and in fact > > Microwatt doesn't. To avoid t

Re: [PATCH 2/5] powerpc/microwatt: Device-tree updates

2025-01-28 Thread Paul Mackerras
On Wed, Jan 29, 2025 at 04:36:14PM +1000, Nicholas Piggin wrote: > On Wed Jan 29, 2025 at 8:52 AM AEST, Paul Mackerras wrote: > > Microwatt now implements ISA v3.1 (SFFS compliancy subset), including > > prefixed instructions, scv/rfscv, and the FSCR, HFSCR, TAR, and CTRL > > registers. The privil