Re: [PATCH] powerpc/crypto/chacha-p10: Fix failure on non Power10

2024-04-01 Thread Herbert Xu
On Fri, Mar 29, 2024 at 12:02:00AM +1100, Michael Ellerman wrote: > The chacha-p10-crypto module provides optimised chacha routines for > Power10. It also selects CRYPTO_ARCH_HAVE_LIB_CHACHA which says it > provides chacha_crypt_arch() to generic code. > > Notably the module needs to provide chach

Re: [PATCH v3] scsi: sg: Avoid race in error handling & drop bogus warn

2024-04-01 Thread Sachin Sant
> On 2 Apr 2024, at 12:40 AM, Alexander Wetzel wrote: > > commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") > introduced an incorrect WARN_ON_ONCE() and missed a sequence where > sg_device_destroy() was used after scsi_device_put(). > > sg_device_destroy() is accessing the paren

[PATCH v12 11/11] powerpc: mm: Support page table check

2024-04-01 Thread Rohan McLure
On creation and clearing of a page table mapping, instrument such calls by invoking page_table_check_pte_set and page_table_check_pte_clear respectively. These calls serve as a sanity check against illegal mappings. Enable ARCH_SUPPORTS_PAGE_TABLE_CHECK for all platforms. See also: riscv support

[PATCH v12 04/11] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pud_clear()

2024-04-01 Thread Rohan McLure
This reverts commit 931c38e16499 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pud_clear"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the addres

[PATCH v12 10/11] powerpc: mm: Use set_pte_at_unchecked() for early-boot / internal usages

2024-04-01 Thread Rohan McLure
In the new set_ptes() API, set_pte_at() (a special case of set_ptes()) is intended to be instrumented by the page table check facility. There are however several other routines that constitute the API for setting page table entries, including set_pmd_at() among others. Such routines are themselves

[PATCH v12 09/11] poweprc: mm: Implement *_user_accessible_page() for ptes

2024-04-01 Thread Rohan McLure
Page table checking depends on architectures providing an implementation of p{te,md,ud}_user_accessible_page. With refactorisations made on powerpc/mm, the pte_access_permitted() and similar methods verify whether a userland page is accessible with the required permissions. Since page table checki

[PATCH v12 08/11] powerpc: mm: Add pud_pfn() stub

2024-04-01 Thread Rohan McLure
The page table check feature requires that pud_pfn() be defined on each consuming architecture. Since only 64-bit, Book3S platforms allow for hugepages at this upper level, and since the calling code is gated by a call to pud_user_accessible_page(), which will return zero, include this stub as a BU

[PATCH v12 07/11] mm: Provide address parameter to p{te,md,ud}_user_accessible_page()

2024-04-01 Thread Rohan McLure
On several powerpc platforms, a page table entry may not imply whether the relevant mapping is for userspace or kernelspace. Instead, such platforms infer this by the address which is being accessed. Add an additional address argument to each of these routines in order to provide support for page

[PATCH v12 06/11] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pte_clear()

2024-04-01 Thread Rohan McLure
This reverts commit aa232204c468 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pte_clear"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the addres

[PATCH v12 03/11] mm/page_table_check: Provide addr parameter to page_table_check_pte_set()

2024-04-01 Thread Rohan McLure
To provide support for powerpc platforms, provide an addr parameter to the page_table_check_pte_set() routine. This parameter is needed on some powerpc platforms which do not encode whether a mapping is for user or kernel in the pte. On such platforms, this can be inferred form the addr parameter.

[PATCH v12 05/11] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pmd_clear()

2024-04-01 Thread Rohan McLure
This reverts commit 1831414cd729 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_clear"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the addres

[PATCH v12 01/11] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pud_set()

2024-04-01 Thread Rohan McLure
This reverts commit 6d144436d954 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pud_set"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the address

[PATCH v12 00/11] Support page table check PowerPC

2024-04-01 Thread Rohan McLure
Support page table check on all PowerPC platforms. This works by serialising assignments, reassignments and clears of page table entries at each level in order to ensure that anonymous mappings have at most one writable consumer, and likewise that file-backed mappings are not simultaneously also an

[PATCH v12 02/11] mm/page_table_check: Reinstate address parameter in [__]page_table_check_pmd_set()

2024-04-01 Thread Rohan McLure
This reverts commit a3b837130b58 ("mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_set"). Reinstate previously unused parameters for the purpose of supporting powerpc platforms, as many do not encode user/kernel ownership of the page in the pte, but instead in the address

Re: [PATCH v3 2/2] powerpc/pseries: increase timeout value for plpks_signed_update_var() H_CALL

2024-04-01 Thread Andrew Donnellan
On Thu, 2024-03-28 at 22:09 -0400, Nayna Jain wrote: > Signed update H_CALL currently polls PHYP for 5msec. Update this to > 5sec. I think this description of the existing code's behaviour is incorrect: - without your patch #1, the existing code polls for up to 5,000ms - with your patch #1, the e

Re: [PATCH v1] powerpc: Error on assembly warnings

2024-04-01 Thread Andrew Donnellan
On Tue, 2024-03-26 at 15:44 +1100, Benjamin Gray wrote: > We currently enable -Werror on the arch/powerpc subtree. However this > only catches C warnings. Assembly warnings are logged, but the make > invocation will still succeed. This can allow incorrect syntax such > as > >   ori r3, r4, r5 > >

Re: [PATCH v11 00/11] Support page table check PowerPC

2024-04-01 Thread Rohan McLure
On Thu, 2024-03-28 at 10:28 +0100, Ingo Molnar wrote: > > * Rohan McLure wrote: > > > Rohan McLure (11): > >   Revert "mm/page_table_check: remove unused parameter in > > [__]page_table_check_pud_set" > >   Revert "mm/page_table_check: remove unused parameter in > > [__]page_table_check_pmd_set"

Re: (subset) [PATCH 0/9] enabled -Wformat-truncation for clang

2024-04-01 Thread Martin K. Petersen
On Tue, 26 Mar 2024 23:37:59 +0100, Arnd Bergmann wrote: > With randconfig build testing, I found only eight files that produce > warnings with clang when -Wformat-truncation is enabled. This means > we can just turn it on by default rather than only enabling it for > "make W=1". > > Unfortunatel

Re: [PATCH] Add static_key_feature_checks_initialized flag

2024-04-01 Thread Nicholas Miehlbradt
On 28/3/2024 2:20 am, Christophe Leroy wrote: Le 27/03/2024 à 05:59, Nicholas Miehlbradt a écrit : JUMP_LABEL_FEATURE_CHECK_DEBUG used static_key_initialized to determine whether {cpu,mmu}_has_feature() was used before static keys were initialized. However, {cpu,mmu}_has_feature() should no

Re: [PATCH] Add static_key_feature_checks_initialized flag

2024-04-01 Thread Nicholas Miehlbradt
On 28/3/2024 2:20 am, Christophe Leroy wrote: Le 27/03/2024 à 05:59, Nicholas Miehlbradt a écrit : JUMP_LABEL_FEATURE_CHECK_DEBUG used static_key_initialized to determine whether {cpu,mmu}_has_feature() was used before static keys were initialized. However, {cpu,mmu}_has_feature() should no

Re: [PATCHv3 pci-next 1/2] PCI/AER: correctable error message as KERN_INFO

2024-04-01 Thread Xi Ruoyao
On Wed, 2024-03-27 at 11:49 +0800, Ethan Zhao wrote: > so, yup, basically, the signal integrity is not good enough. > Though the function could work, its performance will be impacted. FWIW I've replaced the motherboard and this is gone. So it's likely a signal integrity issue of the motherboard.

Re: [PATCH 0/3] Add data type profiling support for powerpc

2024-04-01 Thread Namhyung Kim
Hello, Sorry for the super late reply. On Fri, Mar 8, 2024 at 11:25 PM Athira Rajeev wrote: > > The patchset from Namhyung added support for data type profiling > in perf tool. This enabled support to associate PMU samples to data > types they refer using DWARF debug information. With the upstr

Re: [PATCH 3/3] tools/perf/arch/powerc: Add get_arch_regnum for powerpc

2024-04-01 Thread Namhyung Kim
Hello, On Tue, Mar 26, 2024 at 2:35 AM Tiezhu Yang wrote: > > Hi Athira and Namhyung, > > On 03/09/2024 03:25 PM, Athira Rajeev wrote: > > The function get_dwarf_regnum() returns a DWARF register number > > from a register name string. This calls arch specific function > > get_arch_regnum to retu

[PATCH v3] scsi: sg: Avoid race in error handling & drop bogus warn

2024-04-01 Thread Alexander Wetzel
commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") introduced an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy() was used after scsi_device_put(). sg_device_destroy() is accessing the parent scsi_device request_queue which will already be set to NULL when the

Re: [PATCH v2] scsi: sg: Avoid race in error handling & drop bogus warn

2024-04-01 Thread Alexander Wetzel
On 01.04.24 19:09, Bart Van Assche wrote: On 4/1/24 03:03, Alexander Wetzel wrote: commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") introduced an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy() was used after scsi_device_put(). Isn't that too negative? I

Re: [PATCH v2] scsi: sg: Avoid race in error handling & drop bogus warn

2024-04-01 Thread Bart Van Assche
On 4/1/24 03:03, Alexander Wetzel wrote: commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") introduced an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy() was used after scsi_device_put(). Isn't that too negative? I think that the WARN_ON_ONCE() mentioned ab

Re: [PATCHv12 4/4] watchdog/softlockup: report the most frequent interrupts

2024-04-01 Thread Doug Anderson
Hi, On Mon, Mar 25, 2024 at 2:48 AM Bitao Hu wrote: > > Hi, Thomas > > On 2024/3/24 04:43, Thomas Gleixner wrote: > > On Wed, Mar 06 2024 at 20:52, Bitao Hu wrote: > >> +if (__this_cpu_read(snapshot_taken)) { > >> +for_each_active_irq(i) { > >> +count = kstat_g

Re: [PATCH] powerpc: align memory_limit to 16MB in early_parse_mem

2024-04-01 Thread Joel Savitz
On Tue, Mar 26, 2024 at 12:45 AM Joel Savitz wrote: > > On Fri, Mar 8, 2024 at 5:18 AM Aneesh Kumar K.V > wrote: > > > > Joel Savitz writes: > > > > > On 64-bit powerpc, usage of a non-16MB-aligned value for the mem= kernel > > > cmdline parameter results in a system hang at boot. > > > > > > F

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

2024-04-01 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 read

[PATCH v2] scsi: sg: Avoid race in error handling & drop bogus warn

2024-04-01 Thread Alexander Wetzel
commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") introduced an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy() was used after scsi_device_put(). sg_device_destroy() is accessing the parent scsi_device request_queue which will already be set to NULL when the

[PATCH] scsi: sg: Avoid race in error handling & drop bogus warn

2024-04-01 Thread Alexander Wetzel
commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") introduced an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy() after scsi_device_put() when handling errors. sg_device_destroy() is accessing the parent scsi_device request_queue which will already be set to NU

[PATCH v2] powerpc: Fix PS3 allmodconfig warning

2024-04-01 Thread Geoff Levand
The struct ps3_notification_device in the ps3_probe_thread routine is too large to be on the stack, causing a warning for an allmodconfig build with clang. Change the struct ps3_notification_device from a variable on the stack to a dynamically allocated variable. Reported-by: Arnd Bergmann Signe