[PATCH v4] powerpc/pseries: make max polling consistent for longer H_CALLs

2024-04-17 Thread Nayna Jain
Currently, plpks_confirm_object_flushed() function polls for 5msec in total instead of 5sec. Keep max polling time consistent for all the H_CALLs, which take longer than expected, to be 5sec. Also, make use of fsleep() everywhere to insert delay. Reported-by: Nageswara R Sastry Fixes:

Re: [PATCH v8 2/3] PCI/AER: Disable AER service on suspend

2024-04-17 Thread Kuppuswamy Sathyanarayanan
On 4/15/24 9:32 PM, Kai-Heng Feng wrote: > When the power rail gets cut off, the hardware can create some electric > noise on the link that triggers AER. If IRQ is shared between AER with > PME, such AER noise will cause a spurious wakeup on system suspend. > > When the power rail gets back, the

Re: [PATCH v8 1/3] PCI: Add helper to check if any of ancestor device support D3cold

2024-04-17 Thread Kuppuswamy Sathyanarayanan
On 4/15/24 9:32 PM, Kai-Heng Feng wrote: > In addition to nearest upstream bridge, driver may want to know if the > entire hierarchy can be powered off to perform different action. > > So walk higher up the hierarchy to find out if any device has valid > _PR3. > > The user will be introduced in

Re: [PATCH v2 RESEND 0/5] sched/vtime: vtime.h headers cleanup

2024-04-17 Thread Michael Ellerman
Frederic Weisbecker writes: > Le Wed, Apr 10, 2024 at 05:09:43PM +0200, Alexander Gordeev a écrit : >> Hi All, >> >> There are no changes since the last post, just a re-send. >> >> v2: >> - patch 4: commit message reworded (Heiko) >> - patch 5: vtime.h is removed from Kbuild scripts (PowerPC

Re: [PATCH v4 05/15] mm: introduce execmem_alloc() and execmem_free()

2024-04-17 Thread Song Liu
On Tue, Apr 16, 2024 at 12:23 AM Mike Rapoport wrote: > > On Mon, Apr 15, 2024 at 06:36:39PM +0100, Mark Rutland wrote: > > On Mon, Apr 15, 2024 at 09:52:41AM +0200, Peter Zijlstra wrote: > > > On Thu, Apr 11, 2024 at 07:00:41PM +0300, Mike Rapoport wrote: > > > > +/** > > > > + * enum

Re: [PATCH v4 14/15] kprobes: remove dependency on CONFIG_MODULES

2024-04-17 Thread Masami Hiramatsu
Hi Mike, On Thu, 11 Apr 2024 19:00:50 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > kprobes depended on CONFIG_MODULES because it has to allocate memory for > code. > > Since code allocations are now implemented with execmem, kprobes can be > enabled in non-modular kernels. >

Re: [PATCH v4 05/15] mm: introduce execmem_alloc() and execmem_free()

2024-04-17 Thread Google
On Thu, 11 Apr 2024 19:00:41 +0300 Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > module_alloc() is used everywhere as a mean to allocate memory for code. > > Beside being semantically wrong, this unnecessarily ties all subsystems > that need to allocate code, such as ftrace, kprobes

[PATCH] powerpc/ptdump: Fix walk_vmemmap to also print first vmemmap entry

2024-04-17 Thread Ritesh Harjani (IBM)
walk_vmemmap() was skipping the first vmemmap entry pointed by vmemmap_list pointer itself. This patch fixes that. With this we should see the vmemmap entry at 0xc00c for hash which wasn't getting printed on doing "cat /sys/kernel/debug/kernel_hash_pagetable" Signed-off-by: Ritesh

Re: [PATCH 1/3] powerpc/mm: Align memory_limit value specified using mem= kernel parameter

2024-04-17 Thread Joel Savitz
Acked-by: Joel Savitz

[PATCH v1 9/9] Documentation: Document PowerPC kernel dynamic DEXCR interface

2024-04-17 Thread Benjamin Gray
Documents how to use the PR_PPC_GET_DEXCR and PR_PPC_SET_DEXCR prctl()'s for changing a process's DEXCR or its process tree default value. Signed-off-by: Benjamin Gray --- Documentation/arch/powerpc/dexcr.rst | 141 ++- 1 file changed, 139 insertions(+), 2 deletions(-)

[PATCH v1 8/9] selftests/powerpc/dexcr: Add chdexcr utility

2024-04-17 Thread Benjamin Gray
Adds a utility to exercise the prctl DEXCR inheritance in the shell. Supports setting and clearing each aspect. Signed-off-by: Benjamin Gray --- .../selftests/powerpc/dexcr/.gitignore| 1 + .../testing/selftests/powerpc/dexcr/Makefile | 2 +-

[PATCH v1 7/9] selftests/powerpc/dexcr: Add DEXCR config details to lsdexcr

2024-04-17 Thread Benjamin Gray
Now that the DEXCR can be configured with prctl, add a section in lsdexcr that explains why each aspect is set the way it is. Signed-off-by: Benjamin Gray --- .../testing/selftests/powerpc/dexcr/lsdexcr.c | 113 +- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git

[PATCH v1 6/9] selftests/powerpc/dexcr: Attempt to enable NPHIE in hashchk selftest

2024-04-17 Thread Benjamin Gray
Now that a process can control its DEXCR to some extent, make the hashchk tests more reliable by explicitly setting the local and onexec NPHIE aspect. Signed-off-by: Benjamin Gray --- tools/testing/selftests/powerpc/dexcr/hashchk_test.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH v1 5/9] selftests/powerpc/dexcr: Add DEXCR prctl interface test

2024-04-17 Thread Benjamin Gray
Some basic tests of the prctl interface of the DEXCR. Signed-off-by: Benjamin Gray --- .../selftests/powerpc/dexcr/.gitignore| 1 + .../testing/selftests/powerpc/dexcr/Makefile | 4 +- tools/testing/selftests/powerpc/dexcr/dexcr.c | 40

[PATCH v1 3/9] powerpc/dexcr: Reset DEXCR value across exec

2024-04-17 Thread Benjamin Gray
Inheriting the DEXCR across exec can have security and usability concerns. If a program is compiled with hash instructions it generally expects to run with NPHIE enabled. But if the parent process disables NPHIE then if it's not careful it will be disabled for any children too and the protection

[PATCH v1 4/9] powerpc/dexcr: Add DEXCR prctl interface

2024-04-17 Thread Benjamin Gray
Now that we track a DEXCR on a per-task basis, individual tasks are free to configure it as they like. The interface is a pair of getter/setter prctl's that work on a single aspect at a time (multiple aspects at once is more difficult if there are different rules applied for each aspect, now or

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

2024-04-17 Thread Benjamin Gray
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 using the same addresses in the child. While -fno-pie is already

[PATCH v1 2/9] powerpc/dexcr: Track the DEXCR per-process

2024-04-17 Thread Benjamin Gray
Add capability to make the DEXCR act as a per-process SPR. We do not yet have an interface for changing the values per task. We also expect the kernel to use a single DEXCR value across all tasks while in privileged state, so there is no need to synchronize after changing it (the userspace

[PATCH v1 0/9] Add dynamic DEXCR support

2024-04-17 Thread Benjamin Gray
Adds support for a process to change its DEXCR value. The implementation is somewhat conservative; SBHE (speculative branch hint enable) is not exposed as an editable aspect because its effects can bleed over to other threads. As explained in the third patch, this series changes the reset/inherit

Re: [PATCH v2 RESEND 0/5] sched/vtime: vtime.h headers cleanup

2024-04-17 Thread Frederic Weisbecker
Le Wed, Apr 10, 2024 at 05:09:43PM +0200, Alexander Gordeev a écrit : > Hi All, > > There are no changes since the last post, just a re-send. > > v2: > - patch 4: commit message reworded (Heiko) > - patch 5: vtime.h is removed from Kbuild scripts (PowerPC only) (Heiko) > > v1: > Please find a

[PATCH v3 3/3] PCI/AER: Clear UNCOR_STATUS bits that might be ANFE

2024-04-17 Thread Zhenzhong Duan
When processing an ANFE, ideally both correctable error(CE) status and uncorrectable error(UE) status should be cleared. However, there is no way to fully identify the UE associated with ANFE. Even worse, a Fatal Error(FE) or Non-Fatal Error(NFE) may set the same UE status bit as ANFE. Treating an

[PATCH v3 2/3] PCI/AER: Print UNCOR_STATUS bits that might be ANFE

2024-04-17 Thread Zhenzhong Duan
When an Advisory Non-Fatal error(ANFE) triggers, both correctable error(CE) status and ANFE related uncorrectable error(UE) status will be printed: AER: Correctable error message received from :b7:02.0 PCIe Bus Error: severity=Correctable, type=Transaction Layer, (Receiver ID) device

[PATCH v3 1/3] PCI/AER: Store UNCOR_STATUS bits that might be ANFE in aer_err_info

2024-04-17 Thread Zhenzhong Duan
In some cases the detector of a Non-Fatal Error(NFE) is not the most appropriate agent to determine the type of the error. For example, when software performs a configuration read from a non-existent device or Function, completer will send an ERR_NONFATAL Message. On some platforms, ERR_NONFATAL

[PATCH v3 0/3] PCI/AER: Handle Advisory Non-Fatal error

2024-04-17 Thread Zhenzhong Duan
Hi, This is a relay work of Qingshun's v2 [1], but changed to focus on ANFE processing as subject suggests and drops trace-event for now. I think it's a bit heavy to do extra IOes to get PCIe registers only for trace purpose and not see it a community request for now. According to PCIe Base