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

2025-01-27 Thread Jani Nikula
On Mon, 27 Jan 2025, Joel Granados wrote: > On Wed, Jan 22, 2025 at 01:41:35PM +0100, Ard Biesheuvel wrote: >> On Wed, 22 Jan 2025 at 13:25, Joel Granados wrote: >> > >> > On Tue, Jan 21, 2025 at 02:40:16PM +0100, Alexander Gordeev wrote: >> > > On Fri, Jan 10, 2025 at 03:16:08PM +0100, Joel Gran

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-27 Thread Dmitry V. Levin
On Sat, Jan 25, 2025 at 11:18:06PM +1100, Michael Ellerman wrote: > Alexey Gladkov writes: > > > ... > > I'm not a powerpc expert but shouldn't be used regs->gpr[3] via a > > regs_return_value() in system_call_exception() ? > > Yes I agree. > > > notrace long system_call_exception(struct pt_regs

Re: [PATCH v2] selftests: livepatch: handle PRINTK_CALLER in check_result()

2025-01-27 Thread Petr Mladek
On Sun 2025-01-19 22:02:38, Madhavan Srinivasan wrote: > Some arch configs (like ppc64) enable CONFIG_PRINTK_CALLER, > which adds the caller id as part of the dmesg. With recent > util-linux's update 467a5b3192f16 ('dmesg: add caller_id support') > the standard "dmesg" has been enhanced to print PR

Re: [PATCH 00/34] address all -Wunused-const warnings

2025-01-27 Thread Andy Shevchenko
On Wed, Apr 03, 2024 at 10:06:18AM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > Compilers traditionally warn for unused 'static' variables, but not > if they are constant. The reason here is a custom for C++ programmers > to define named constants as 'static const' variables in header fi

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-27 Thread Dmitry V. Levin
On Mon, Jan 27, 2025 at 12:36:53PM +0100, Christophe Leroy wrote: > Le 27/01/2025 à 12:20, Dmitry V. Levin a écrit : > > On Thu, Jan 23, 2025 at 11:07:21PM +0100, Christophe Leroy wrote: > > [...] > >> To add a bit more to the confusion, > > > > Looks like there is no end to it: > > > > static in

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-27 Thread Christophe Leroy
Le 27/01/2025 à 12:44, Dmitry V. Levin a écrit : On Mon, Jan 27, 2025 at 12:36:53PM +0100, Christophe Leroy wrote: Le 27/01/2025 à 12:20, Dmitry V. Levin a écrit : On Thu, Jan 23, 2025 at 11:07:21PM +0100, Christophe Leroy wrote: [...] To add a bit more to the confusion, Looks like there

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-27 Thread Christophe Leroy
Le 27/01/2025 à 12:20, Dmitry V. Levin a écrit : On Thu, Jan 23, 2025 at 11:07:21PM +0100, Christophe Leroy wrote: [...] To add a bit more to the confusion, Looks like there is no end to it: static inline long regs_return_value(struct pt_regs *regs) { if (trap_is_scv(regs))

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-27 Thread Dmitry V. Levin
On Thu, Jan 23, 2025 at 11:07:21PM +0100, Christophe Leroy wrote: [...] > To add a bit more to the confusion, Looks like there is no end to it: static inline long regs_return_value(struct pt_regs *regs) { if (trap_is_scv(regs)) return regs->gpr[3]; if (is_syscall_

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-27 Thread Dmitry V. Levin
On Mon, Jan 27, 2025 at 01:04:27PM +0100, Christophe Leroy wrote: > > > Le 27/01/2025 à 12:44, Dmitry V. Levin a écrit : > > On Mon, Jan 27, 2025 at 12:36:53PM +0100, Christophe Leroy wrote: > >> Le 27/01/2025 à 12:20, Dmitry V. Levin a écrit : > >>> On Thu, Jan 23, 2025 at 11:07:21PM +0100, Chri

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

2025-01-27 Thread Joel Granados
On Wed, Jan 22, 2025 at 01:41:35PM +0100, Ard Biesheuvel wrote: > On Wed, 22 Jan 2025 at 13:25, Joel Granados wrote: > > > > On Tue, Jan 21, 2025 at 02:40:16PM +0100, Alexander Gordeev wrote: > > > On Fri, Jan 10, 2025 at 03:16:08PM +0100, Joel Granados wrote: > > > > > > Hi Joel, > > > > > > > Ad

Re: [PATCH v3] powerpc/hugetlb: Disable gigantic hugepages if fadump is active

2025-01-27 Thread Christophe Leroy
Le 25/01/2025 à 11:49, Sourabh Jain a écrit : The fadump kernel boots with limited memory solely to collect the kernel core dump. Having gigantic hugepages in the fadump kernel is of no use. Many times, the fadump kernel encounters OOM (Out of Memory) issues if gigantic hugepages are allocated

Re: [PATCH RFC 9/9] dt-bindings: nand: Convert fsl,elbc bindings to YAML

2025-01-27 Thread Krzysztof Kozlowski
On Sun, Jan 26, 2025 at 07:59:04PM +0100, J. Neuschäfer wrote: > Convert the Freescale localbus controller bindings from text form to > YAML. The list of compatible strings reflects current usage. simple-bus and 20 other compatibles you used were not present in the original binding. Does above "li

Re: [PATCH v2] powerpc/hugetlb: Disable gigantic hugepages if fadump is active

2025-01-27 Thread Christophe Leroy
Le 25/01/2025 à 10:32, Sourabh Jain a écrit : Hello Christophe On 24/01/25 19:44, Christophe Leroy wrote: Le 24/01/2025 à 11:32, Sourabh Jain a écrit : The fadump kernel boots with limited memory solely to collect the kernel core dump. Having gigantic hugepages in the fadump kernel is of

Re: [PATCH v2] powerpc/hugetlb: Disable gigantic hugepages if fadump is active

2025-01-27 Thread Sourabh Jain
On 27/01/25 13:18, Christophe Leroy wrote: Le 25/01/2025 à 10:32, Sourabh Jain a écrit : Hello Christophe On 24/01/25 19:44, Christophe Leroy wrote: Le 24/01/2025 à 11:32, Sourabh Jain a écrit : The fadump kernel boots with limited memory solely to collect the kernel core dump. Havin

Re: [PATCH v3] powerpc/hugetlb: Disable gigantic hugepages if fadump is active

2025-01-27 Thread Sourabh Jain
Hello Christophe, On 27/01/25 13:23, Christophe Leroy wrote: Le 25/01/2025 à 11:49, Sourabh Jain a écrit : The fadump kernel boots with limited memory solely to collect the kernel core dump. Having gigantic hugepages in the fadump kernel is of no use. Many times, the fadump kernel encounters

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

2025-01-27 Thread Matthew Wilcox
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 it can't be static const. Does this really need to be cc'd to such a wid

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

2025-01-27 Thread Kienan Stewart
ase-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04 change-id: 20250127-buildfix-extmod-powerpc-a744e1331f83 Best regards, -- Kienan Stewart

Re: [PATCH v6 1/2] kexec: Consolidate machine_kexec_mask_interrupts() implementation

2025-01-27 Thread Will Deacon
On Wed, Dec 04, 2024 at 02:20:02PM +, Eliav Farber wrote: > Consolidate the machine_kexec_mask_interrupts implementation into a common > function located in a new file: kernel/irq/kexec.c. This removes duplicate > implementations from architecture-specific files in arch/arm, arch/arm64, > arch/

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

2025-01-27 Thread Dmitry V. Levin
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 the error condition. When cr0.SO is clear, the sysc

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

2025-01-27 Thread Dmitry V. Levin
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 address the code inconsistencies in syscall error return h

Re: [PATCH 2/4] seccomp: kill the dead code in the !CONFIG_HAVE_ARCH_SECCOMP_FILTER version of __secure_computing()

2025-01-27 Thread Kees Cook
On Tue, Jan 21, 2025 at 03:30:39PM +0100, Oleg Nesterov wrote: > How about > > __secure_computing() > { > return secure_computing_strict(syscall_get_nr(...)); > } > > in the "#ifndef CONFIG_HAVE_ARCH_SECCOMP_FILTER" section near > secure_computing_strict() in kerne

[PATCH v4] powerpc/hugetlb: Disable gigantic hugepages if fadump is active

2025-01-27 Thread Sourabh Jain
The fadump kernel boots with limited memory solely to collect the kernel core dump. Having gigantic hugepages in the fadump kernel is of no use. Many times, the fadump kernel encounters OOM (Out of Memory) issues if gigantic hugepages are allocated. To address this, disable gigantic hugepages if f

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

2025-01-27 Thread Frank van der Linden
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 CMA. This also allows for doing pre-HVO on these pages (if e

[PATCH v3 1/6] powerpc/pseries: Define common functions for RTAS sequence calls

2025-01-27 Thread Haren Myneni
The RTAS call can be normal where retrieves the data form the hypervisor once or sequence based RTAS call which has to issue multiple times until the complete data is obtained. For some of these sequence RTAS calls, the OS should not interleave calls with different input until the sequence is compl

[PATCH v3 6/6] powerpc/pseries: Add papr-platform-dump character driver for dump retrieval

2025-01-27 Thread Haren Myneni
ibm,platform-dump RTAS call in combination with writable mapping /dev/mem is issued to collect platform dump from the hypervisor and may need multiple calls to get the complete dump. The current implementation uses rtas_platform_dump() API provided by librtas library to issue these RTAS calls. But

[PATCH v3 3/6] powerpc/pseries: Add papr-indices char driver for ibm,get-indices

2025-01-27 Thread Haren Myneni
The RTAS call ibm,get-indices is used to obtain indices and location codes for a specified indicator or sensor token. The current implementation uses rtas_get_indices() API provided by librtas library which allocates RMO buffer and issue this RTAS call in the user space. But writable mapping /dev/m

[PATCH v3 2/6] powerpc/pseries: Define papr_indices_io_block for papr-indices ioctls

2025-01-27 Thread Haren Myneni
To issue ibm,get-indices, ibm,set-dynamic-indicator and ibm,get-dynamic-sensor-state in the user space, the RMO buffer is allocated for the work area which is restricted under system lockdown. So instead of user space execution, the kernel will provide /dev/papr-indices interface to execute these R

[PATCH v3 5/6] powerpc/pseries: Add ibm,get-dynamic-sensor-state RTAS call support

2025-01-27 Thread Haren Myneni
The RTAS call ibm,get-dynamic-sensor-state is used to get the sensor state identified by the location code and the sensor token. The librtas library provides an API rtas_get_dynamic_sensor() which uses /dev/mem access for work area allocation but is restricted under system lockdown. This patch pro

[PATCH v3 4/6] powerpc/pseries: Add ibm,set-dynamic-indicator RTAS call support

2025-01-27 Thread Haren Myneni
The RTAS call ibm,set-dynamic-indicator is used to set the new indicator state identified by a location code. The current implementation uses rtas_set_dynamic_indicator() API provided by librtas library which allocates RMO buffer and issue this RTAS call in the user space. But /dev/mem access by th

[PATCH v3 0/6] Add character devices for indices and platform-dump RTAS

2025-01-27 Thread Haren Myneni
Several APIs such as rtas_get_indices(), rtas_get_dynamic_sensor(), rtas_set_dynamic_indicator() and rtas_platform_dump() provided by librtas library are implemented in user space using rtas syscall in combination with writable mappings of /dev/mem. But this implementation is not compatible with sy