Re: [PATCH v4 00/15] Unified cross-architecture kernel-mode FPU API

2024-04-03 Thread Christian König
I only skimmed over the platform patches and spend only a few minutes on the amdgpu stuff. From what I've seen this series seems to make perfect sense to me, I just can't fully judge everything. So feel free to add Acked-by: Christian König but I strongly suggest that Harry and Rodrigo

Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback

2024-04-03 Thread Christophe Leroy
Le 03/04/2024 à 15:07, Jason Gunthorpe a écrit : > On Wed, Apr 03, 2024 at 12:26:43PM +, Christophe Leroy wrote: >> >> >> Le 03/04/2024 à 14:08, Jason Gunthorpe a écrit : >>> On Tue, Apr 02, 2024 at 07:35:45PM -0400, Peter Xu wrote: On Tue, Apr 02, 2024 at 07:53:20PM -0300, Jason

[PATCH v3 04/15] kunit: Add documentation for warning backtrace suppression API

2024-04-03 Thread Guenter Roeck
Document API functions for suppressing warning backtraces. Tested-by: Linux Kernel Functional Testing Acked-by: Dan Carpenter Reviewed-by: Kees Cook Signed-off-by: Guenter Roeck --- v2: - Rebased to v6.9-rc1 - Added Tested-by:, Acked-by:, and Reviewed-by: tags v3: - Rebased to v6.9-rc2

[PATCH v3 06/15] net: kunit: Suppress lock warning noise at end of dev_addr_lists tests

2024-04-03 Thread Guenter Roeck
dev_addr_lists_test generates lock warning noise at the end of tests if lock debugging is enabled. There are two sets of warnings. WARNING: CPU: 0 PID: 689 at kernel/locking/mutex.c:923 __mutex_unlock_slowpath.constprop.0+0x13c/0x368 DEBUG_LOCKS_WARN_ON(__owner_task(owner) != __get_current())

[PATCH v3 05/15] drm: Suppress intentional warning backtraces in scaling unit tests

2024-04-03 Thread Guenter Roeck
The drm_test_rect_calc_hscale and drm_test_rect_calc_vscale unit tests intentionally trigger warning backtraces by providing bad parameters to the tested functions. What is tested is the return value, not the existence of a warning backtrace. Suppress the backtraces to avoid clogging the kernel

[PATCH v3 01/15] bug/kunit: Core support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Some unit tests intentionally trigger warning backtraces by passing bad parameters to API functions. Such unit tests typically check the return value from those calls, not the existence of the warning backtrace. Such intentionally generated warning backtraces are neither desirable nor useful for

[PATCH v3 14/15] riscv: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

[PATCH v3 10/15] parisc: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

[PATCH v3 11/15] s390: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

[PATCH v3 12/15] sh: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

[PATCH v3 13/15] sh: Move defines needed for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Declaring the defines needed for suppressing warning inside '#ifdef CONFIG_DEBUG_BUGVERBOSE' results in a kerneldoc warning. .../bug.h:29: warning: expecting prototype for _EMIT_BUG_ENTRY(). Prototype was for HAVE_BUG_FUNCTION() instead Move the defines above the kerneldoc entry for

[PATCH v3 00/15] Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Some unit tests intentionally trigger warning backtraces by passing bad parameters to kernel API functions. Such unit tests typically check the return value from such calls, not the existence of the warning backtrace. Such intentionally generated warning backtraces are neither desirable nor

Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback

2024-04-03 Thread Jason Gunthorpe
On Wed, Apr 03, 2024 at 01:17:06PM +, Christophe Leroy wrote: > > That commit makes it sounds like the arch supports huge PUD's through > > the hugepte mechanism - it says a LTP test failed so something > > populated a huge PUD at least?? > > Not sure, I more see it just like a copy/paste of

Re: [PATCH 7/7] x86: mm: accelerate pagefault when badaccess

2024-04-03 Thread Suren Baghdasaryan
On Wed, Apr 3, 2024 at 12:58 AM Kefeng Wang wrote: > > > > On 2024/4/3 13:59, Suren Baghdasaryan wrote: > > On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang > > wrote: > >> > >> The vm_flags of vma already checked under per-VMA lock, if it is a > >> bad access, directly handle error and return,

Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback

2024-04-03 Thread Jason Gunthorpe
On Tue, Apr 02, 2024 at 07:35:45PM -0400, Peter Xu wrote: > On Tue, Apr 02, 2024 at 07:53:20PM -0300, Jason Gunthorpe wrote: > > On Tue, Apr 02, 2024 at 06:43:56PM -0400, Peter Xu wrote: > > > > > I actually tested this without hitting the issue (even though I didn't > > > mention it in the cover

[PATCH v3 03/15] kunit: Add test cases for backtrace warning suppression

2024-04-03 Thread Guenter Roeck
Add unit tests to verify that warning backtrace suppression works. If backtrace suppression does _not_ work, the unit tests will likely trigger unsuppressed backtraces, which should actually help to get the affected architectures / platforms fixed. Tested-by: Linux Kernel Functional Testing

[PATCH v3 02/15] kunit: bug: Count suppressed warning backtraces

2024-04-03 Thread Guenter Roeck
Count suppressed warning backtraces to enable code which suppresses warning backtraces to check if the expected backtrace(s) have been observed. Using atomics for the backtrace count resulted in build errors on some architectures due to include file recursion, so use a plain integer for now.

[PATCH v3 07/15] x86: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

Re: [PATCH v8 6/6] docs: trusted-encrypted: add DCP as new trust source

2024-04-03 Thread Bagas Sanjaya
On Wed, Apr 03, 2024 at 09:21:22AM +0200, David Gstir wrote: > diff --git a/Documentation/security/keys/trusted-encrypted.rst > b/Documentation/security/keys/trusted-encrypted.rst > index e989b9802f92..f4d7e162d5e4 100644 > --- a/Documentation/security/keys/trusted-encrypted.rst > +++

[PATCH v3 15/15] powerpc: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback

2024-04-03 Thread Christophe Leroy
Le 03/04/2024 à 14:08, Jason Gunthorpe a écrit : > On Tue, Apr 02, 2024 at 07:35:45PM -0400, Peter Xu wrote: >> On Tue, Apr 02, 2024 at 07:53:20PM -0300, Jason Gunthorpe wrote: >>> On Tue, Apr 02, 2024 at 06:43:56PM -0400, Peter Xu wrote: >>> I actually tested this without hitting the issue

Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback

2024-04-03 Thread Jason Gunthorpe
On Wed, Apr 03, 2024 at 12:26:43PM +, Christophe Leroy wrote: > > > Le 03/04/2024 à 14:08, Jason Gunthorpe a écrit : > > On Tue, Apr 02, 2024 at 07:35:45PM -0400, Peter Xu wrote: > >> On Tue, Apr 02, 2024 at 07:53:20PM -0300, Jason Gunthorpe wrote: > >>> On Tue, Apr 02, 2024 at 06:43:56PM

[PATCH v3 09/15] loongarch: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

[PATCH v3 08/15] arm64: Add support for suppressing warning backtraces

2024-04-03 Thread Guenter Roeck
Add name of functions triggering warning backtraces to the __bug_table object section to enable support for suppressing WARNING backtraces. To limit image size impact, the pointer to the function name is only added to the __bug_table section if both CONFIG_KUNIT_SUPPRESS_BACKTRACE and

Re: [PATCH 01/34] powerpc/fsl-soc: hide unused const variable

2024-04-03 Thread Christophe Leroy
Le 03/04/2024 à 10:06, Arnd Bergmann a écrit : > From: Arnd Bergmann > > vmpic_msi_feature is only used conditionally, which triggers a rare > -Werror=unused-const-variable= warning with gcc: > > arch/powerpc/sysdev/fsl_msi.c:567:37: error: 'vmpic_msi_feature' defined but > not used

[PATCH v8 3/6] KEYS: trusted: Introduce NXP DCP-backed trusted keys

2024-04-03 Thread David Gstir
DCP (Data Co-Processor) is the little brother of NXP's CAAM IP. Beside of accelerated crypto operations, it also offers support for hardware-bound keys. Using this feature it is possible to implement a blob mechanism similar to what CAAM offers. Unlike on CAAM, constructing and parsing the blob

[PATCH v8 2/6] KEYS: trusted: improve scalability of trust source config

2024-04-03 Thread David Gstir
Enabling trusted keys requires at least one trust source implementation (currently TPM, TEE or CAAM) to be enabled. Currently, this is done by checking each trust source's config option individually. This does not scale when more trust sources like the one for DCP are added, because the condition

[PATCH v2 1/7] arm64: mm: cleanup __do_page_fault()

2024-04-03 Thread Kefeng Wang
The __do_page_fault() only calls handle_mm_fault() after vm_flags checked, and it is only called by do_page_fault(), let's squash it into do_page_fault() to cleanup code. Reviewed-by: Suren Baghdasaryan Signed-off-by: Kefeng Wang --- arch/arm64/mm/fault.c | 27 +++ 1

[PATCH v2 0/7] arch/mm/fault: accelerate pagefault when badaccess

2024-04-03 Thread Kefeng Wang
After VMA lock-based page fault handling enabled, if bad access met under per-vma lock, it will fallback to mmap_lock-based handling, so it leads to unnessary mmap lock and vma find again. A test from lmbench shows 34% improve after this changes on arm64, lat_sig -P 1 prot lat_sig 0.29194 ->

[PATCH v2 2/7] arm64: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-03 Thread Kefeng Wang
The vm_flags of vma already checked under per-VMA lock, if it is a bad access, directly set fault to VM_FAULT_BADACCESS and handle error, no need to retry with mmap_lock again, the latency time reduces 34% in 'lat_sig -P 1 prot lat_sig' from lmbench testcase. Since the page faut is handled under

[PATCH v2 4/7] powerpc: mm: accelerate pagefault when badaccess

2024-04-03 Thread Kefeng Wang
The access_[pkey]_error() of vma already checked under per-VMA lock, if it is a bad access, directly handle error, no need to retry with mmap_lock again. In order to release the correct lock, pass the mm_struct into bad_access_pkey()/bad_access(), if mm is NULL, release vma lock, or release

[PATCH v8 0/6] DCP as trusted keys backend

2024-04-03 Thread David Gstir
This is a revival of the previous patch set submitted by Richard Weinberger: https://lore.kernel.org/linux-integrity/20210614201620.30451-1-rich...@nod.at/ After having been thoroughly reviewed by Jarkko, it would be great if this could go into 6.10. :-) v7 is here:

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

2024-04-03 Thread Aneesh Kumar K.V (IBM)
The value specified for the memory limit is used to set a restriction on memory usage. It is important to ensure that this restriction is within the linear map kernel address space range. The hash page table translation uses a 16MB page size to map the kernel linear map address space.

Re: [PATCH 7/7] x86: mm: accelerate pagefault when badaccess

2024-04-03 Thread Suren Baghdasaryan
On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang wrote: > > The vm_flags of vma already checked under per-VMA lock, if it is a > bad access, directly handle error and return, there is no need to > lock_mm_and_find_vma() and check vm_flags again. > > Signed-off-by: Kefeng Wang Looks safe to me. Using

Re: [PATCH 2/7] arm64: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-03 Thread Kefeng Wang
On 2024/4/3 13:30, Suren Baghdasaryan wrote: On Tue, Apr 2, 2024 at 10:19 PM Suren Baghdasaryan wrote: On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang wrote: The vm_flags of vma already checked under per-VMA lock, if it is a bad access, directly set fault to VM_FAULT_BADACCESS and handle

[PATCH v2 6/7] s390: mm: accelerate pagefault when badaccess

2024-04-03 Thread Kefeng Wang
The vm_flags of vma already checked under per-VMA lock, if it is a bad access, directly handle error, no need to retry with mmap_lock again. Since the page faut is handled under per-VMA lock, count it as a vma lock event with VMA_LOCK_SUCCESS. Signed-off-by: Kefeng Wang --- arch/s390/mm/fault.c

[PATCH v2 3/7] arm: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-03 Thread Kefeng Wang
The vm_flags of vma already checked under per-VMA lock, if it is a bad access, directly set fault to VM_FAULT_BADACCESS and handle error, no need to retry with mmap_lock again. Since the page faut is handled under per-VMA lock, count it as a vma lock event with VMA_LOCK_SUCCESS. Reviewed-by:

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

2024-04-03 Thread Arnd Bergmann
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 files instead of using macros or enums. In W=1 builds, we get warnings

Re: [PATCH v2 2/3] usb: typec: nvidia: drop driver owner assignment

2024-04-03 Thread Heikki Krogerus
On Sun, Mar 31, 2024 at 11:17:36AM +0200, Krzysztof Kozlowski wrote: > Core in typec_altmode_register_driver() already sets the .owner, so > driver does not need to. > > Signed-off-by: Krzysztof Kozlowski Reviewed-by: Heikki Krogerus > --- > > Changes in v2: > 1. None > --- >

[PATCH v8 1/6] crypto: mxs-dcp: Add support for hardware-bound keys

2024-04-03 Thread David Gstir
DCP (Data Co-Processor) is able to derive private keys for a fused random seed, which can be referenced by handle but not accessed by the CPU. Similarly, DCP is able to store arbitrary keys in four dedicated key slots located in its secure memory area (internal SRAM). These keys can be used to

Re: [PATCH 7/7] x86: mm: accelerate pagefault when badaccess

2024-04-03 Thread Kefeng Wang
On 2024/4/3 13:59, Suren Baghdasaryan wrote: On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang wrote: The vm_flags of vma already checked under per-VMA lock, if it is a bad access, directly handle error and return, there is no need to lock_mm_and_find_vma() and check vm_flags again.

[PATCH v2 2/2] PCI: Create helper to print TLP Header and Prefix Log

2024-04-03 Thread Ilpo Järvinen
Add pcie_print_tlp_log() helper to print TLP Header and Prefix Log. Print End-End Prefixes only if they are non-zero. Consolidate the few places which currently print TLP using custom formatting. The first attempt used pr_cont() instead of building a string first but it turns out pr_cont() is

[PATCH 01/34] powerpc/fsl-soc: hide unused const variable

2024-04-03 Thread Arnd Bergmann
From: Arnd Bergmann vmpic_msi_feature is only used conditionally, which triggers a rare -Werror=unused-const-variable= warning with gcc: arch/powerpc/sysdev/fsl_msi.c:567:37: error: 'vmpic_msi_feature' defined but not used [-Werror=unused-const-variable=] 567 | static const struct

[PATCH v2 1/2] PCI: Add TLP Prefix reading into pcie_read_tlp_log()

2024-04-03 Thread Ilpo Järvinen
pcie_read_tlp_log() handles only 4 TLP Header Log DWORDs but TLP Prefix Log (PCIe r6.1 secs 7.8.4.12 & 7.9.14.13) may also be present. Generalize pcie_read_tlp_log() and struct pcie_tlp_log to handle also TLP Prefix Log. The layout of relevant registers in AER and DPC Capability is not identical

[PATCH v2 0/2] PCI: Consolidate TLP Log reading and printing

2024-04-03 Thread Ilpo Järvinen
This series has the remaining patches of the AER & DPC TLP Log handling consolidation. v2: - Don't add EXPORT()s - Don't include igxbe changes - Don't use pr_cont() as it's incompatible with pci_err() and according to Andy Shevchenko should not be used in the first place Ilpo Järvinen (2):

Re: [PATCH v2 3/3] usb: typec: displayport: drop driver owner assignment

2024-04-03 Thread Heikki Krogerus
On Sun, Mar 31, 2024 at 11:17:37AM +0200, Krzysztof Kozlowski wrote: > Core in typec_altmode_register_driver() already sets the .owner, so > driver does not need to. > > Signed-off-by: Krzysztof Kozlowski Reviewed-by: Heikki Krogerus > --- > > Changes in v2: > 1. New patch > --- >

[PATCH 3/3] powerpc/mm: Update the memory limit based on direct mapping restrictions

2024-04-03 Thread Aneesh Kumar K.V (IBM)
memory limit value specified by the user are further updated such that the value is 16MB aligned. This is because hash translation mode use 16MB as direct mapping page size. Make sure we update the global variable 'memory_limit' with the 16MB aligned value such that all kernel components will see

[PATCH 2/3] powerpc/fadump: Don't update the user-specified memory limit

2024-04-03 Thread Aneesh Kumar K.V (IBM)
If the user specifies the memory limit, the kernel should honor it such that all allocation and reservations are made within the memory limit specified. fadump was breaking that rule. Remove the code which updates the memory limit such that fadump reservations are done within the limit specified.

Re: [PATCH v1 1/1] powerpc/52xx: Replace of_gpio.h by proper one

2024-04-03 Thread Andy Shevchenko
On Wed, Mar 13, 2024 at 03:56:45PM +0200, Andy Shevchenko wrote: > of_gpio.h is deprecated and subject to remove. > The driver doesn't use it directly, replace it > with what is really being used. Any comments on this? -- With Best Regards, Andy Shevchenko

Re: [PATCH] serial/pmac_zilog: Remove flawed mitigation for rx irq flood

2024-04-03 Thread Andy Shevchenko
Thu, Mar 28, 2024 at 03:11:33PM +1100, Finn Thain kirjoitti: > The mitigation was intended to stop the irq completely. That might have > been better than a hard lock-up but it turns out that you get a crash > anyway if you're using pmac_zilog as a serial console. > > That's because the pr_err()

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:13 AM Rohan McLure wrote: > > 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

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:11 AM Rohan McLure wrote: > > 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

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:11 AM Rohan McLure wrote: > > 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

[PATCH v8 6/6] docs: trusted-encrypted: add DCP as new trust source

2024-04-03 Thread David Gstir
Update the documentation for trusted and encrypted KEYS with DCP as new trust source: - Describe security properties of DCP trust source - Describe key usage - Document blob format Co-developed-by: Richard Weinberger Signed-off-by: Richard Weinberger Co-developed-by: David Oberhollenzer

[PATCH v8 5/6] docs: document DCP-backed trusted keys kernel params

2024-04-03 Thread David Gstir
Document the kernel parameters trusted.dcp_use_otp_key and trusted.dcp_skip_zk_test for DCP-backed trusted keys. Co-developed-by: Richard Weinberger Signed-off-by: Richard Weinberger Co-developed-by: David Oberhollenzer Signed-off-by: David Oberhollenzer Signed-off-by: David Gstir

[PATCH v8 4/6] MAINTAINERS: add entry for DCP-based trusted keys

2024-04-03 Thread David Gstir
This covers trusted keys backed by NXP's DCP (Data Co-Processor) chip found in smaller i.MX SoCs. Signed-off-by: David Gstir Acked-by: Jarkko Sakkinen --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 976a5cea1577..ca7f42ca9338 100644

[PATCH v2 5/7] riscv: mm: accelerate pagefault when badaccess

2024-04-03 Thread Kefeng Wang
The access_error() of vma already checked under per-VMA lock, if it is a bad access, directly handle error, no need to retry with mmap_lock again. Since the page faut is handled under per-VMA lock, count it as a vma lock event with VMA_LOCK_SUCCESS. Reviewed-by: Suren Baghdasaryan Signed-off-by:

[PATCH v2 7/7] x86: mm: accelerate pagefault when badaccess

2024-04-03 Thread Kefeng Wang
The access_error() of vma already checked under per-VMA lock, if it is a bad access, directly handle error, no need to retry with mmap_lock again. In order to release the correct lock, pass the mm_struct into bad_area_access_error(), if mm is NULL, release vma lock, or release mmap_lock. Since the

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:11 AM Rohan McLure wrote: > > 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

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:13 AM Rohan McLure wrote: > > 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

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:11 AM Rohan McLure wrote: > > 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

Re: [PATCH v2 0/7] arch/mm/fault: accelerate pagefault when badaccess

2024-04-03 Thread Andrew Morton
On Wed, 3 Apr 2024 16:37:58 +0800 Kefeng Wang wrote: > After VMA lock-based page fault handling enabled, if bad access met > under per-vma lock, it will fallback to mmap_lock-based handling, > so it leads to unnessary mmap lock and vma find again. A test from > lmbench shows 34% improve after

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:13 AM Rohan McLure wrote: > > 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

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:11 AM Rohan McLure wrote: > > 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

Re: [PATCH v3 00/15] Add support for suppressing warning backtraces

2024-04-03 Thread Kees Cook
On Wed, Apr 03, 2024 at 06:19:21AM -0700, Guenter Roeck wrote: > Some unit tests intentionally trigger warning backtraces by passing bad > parameters to kernel API functions. Such unit tests typically check the > return value from such calls, not the existence of the warning backtrace. > > Such

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

2024-04-03 Thread Pasha Tatashin
All patches in this series should be also CC'd to linux-ker...@vger.kernel.org.

Re: [PATCH 1/9] hyperv: Convert from tasklet to BH workqueue

2024-04-03 Thread Allen
> 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

Re: [PATCH 7/9] s390: Convert from tasklet to BH workqueue

2024-04-03 Thread Allen
> > > > Signed-off-by: Allen Pais > > --- > > drivers/s390/block/dasd.c | 42 > > drivers/s390/block/dasd_int.h | 10 +++--- > > drivers/s390/char/con3270.c| 27 > > drivers/s390/crypto/ap_bus.c | 24

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

2024-04-03 Thread Bart Van Assche
On 4/1/24 12:10 PM, Alexander Wetzel wrote: @@ -301,11 +302,12 @@ sg_open(struct inode *inode, struct file *filp) /* This driver's module count bumped by fops_get in */ /* Prevent the device driver from vanishing while we sleep */ - retval = scsi_device_get(sdp->device); +

Re: [PATCH v8 6/6] docs: trusted-encrypted: add DCP as new trust source

2024-04-03 Thread Jarkko Sakkinen
On Wed Apr 3, 2024 at 10:21 AM EEST, David Gstir wrote: > Update the documentation for trusted and encrypted KEYS with DCP as new > trust source: > > - Describe security properties of DCP trust source > - Describe key usage > - Document blob format > > Co-developed-by: Richard Weinberger >

Re: [PATCH v4 05/13] mm/arch: Provide pud_pfn() fallback

2024-04-03 Thread Peter Xu
On Wed, Apr 03, 2024 at 09:08:41AM -0300, Jason Gunthorpe wrote: > On Tue, Apr 02, 2024 at 07:35:45PM -0400, Peter Xu wrote: > > On Tue, Apr 02, 2024 at 07:53:20PM -0300, Jason Gunthorpe wrote: > > > On Tue, Apr 02, 2024 at 06:43:56PM -0400, Peter Xu wrote: > > > > > > > I actually tested this

Re: [RFC PATCH 1/8] mm: Provide pagesize to pmd_populate()

2024-04-03 Thread Christophe Leroy
Le 27/03/2024 à 17:57, Jason Gunthorpe a écrit : > On Wed, Mar 27, 2024 at 09:58:35AM +, Christophe Leroy wrote: >>> Just general remarks on the ones with huge pages: >>> >>>hash 64k and hugepage 16M/16G >>>radix 64k/radix hugepage 2M/1G >>>radix 4k/radix hugepage 2M/1G >>>

Re: [PATCH 1/7] arm64: mm: cleanup __do_page_fault()

2024-04-03 Thread Catalin Marinas
On Tue, Apr 02, 2024 at 03:51:36PM +0800, Kefeng Wang wrote: > The __do_page_fault() only check vma->flags and call handle_mm_fault(), > and only called by do_page_fault(), let's squash it into do_page_fault() > to cleanup code. > > Signed-off-by: Kefeng Wang Reviewed-by: Catalin Marinas

Re: [PATCH 2/7] arm64: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-03 Thread Catalin Marinas
On Tue, Apr 02, 2024 at 03:51:37PM +0800, Kefeng Wang wrote: > The vm_flags of vma already checked under per-VMA lock, if it is a > bad access, directly set fault to VM_FAULT_BADACCESS and handle error, > no need to lock_mm_and_find_vma() and check vm_flags again, the latency > time reduce 34% in

Re: [PATCH v3 06/15] net: kunit: Suppress lock warning noise at end of dev_addr_lists tests

2024-04-03 Thread Jakub Kicinski
On Wed, 3 Apr 2024 06:19:27 -0700 Guenter Roeck wrote: > dev_addr_lists_test generates lock warning noise at the end of tests > if lock debugging is enabled. There are two sets of warnings. > > WARNING: CPU: 0 PID: 689 at kernel/locking/mutex.c:923 >

Re: [PATCH v3 15/15] powerpc: Add support for suppressing warning backtraces

2024-04-03 Thread Michael Ellerman
Guenter Roeck writes: > Add name of functions triggering warning backtraces to the __bug_table > object section to enable support for suppressing WARNING backtraces. > > To limit image size impact, the pointer to the function name is only added > to the __bug_table section if both

[PATCH 1/2] powerpc: Apply __always_inline to interrupt_{enter,exit}_prepare()

2024-04-03 Thread Rohan McLure
In keeping with the advice given by Documentation/core-api/entry.rst, entry and exit handlers for interrupts should not be instrumented. Guarantee that the interrupt_{enter,exit}_prepare() routines are inlined so that they will inheret instrumentation from their caller. KCSAN kernels were

[PATCH 2/2] powerpc/64: Only warn for kuap locked when KCSAN not present

2024-04-03 Thread Rohan McLure
Arbitrary instrumented locations, including syscall handlers, can call arch_local_irq_restore() transitively when KCSAN is enabled, and in turn also replay_soft_interrupts_irqrestore(). The precondition on entry to this routine that is checked is that KUAP is enabled (user access prohibited).

Re: [PATCH] serial/pmac_zilog: Remove flawed mitigation for rx irq flood

2024-04-03 Thread Jiri Slaby
On 04. 04. 24, 0:29, Andy Shevchenko wrote: Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: "Aneesh Kumar K.V" Cc: "Naveen N. Rao" Cc: linux-m...@lists.linux-m68k.org Second, please move these Cc to be after the '---' line Sorry, but why?

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:13 AM Rohan McLure wrote: > > 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

[PATCH] asm-generic/mmiowb: Mark accesses to fix KCSAN warnings

2024-04-03 Thread Rohan McLure
Prior to this patch, data races are detectable by KCSAN of the following forms: [1] Asynchronous calls to mmiowb_set_pending() from an interrupt context or otherwise outside of a critical section [2] Interrupted critical sections, where the interrupt will itself acquire a lock In case

Re: [PATCH] serial/pmac_zilog: Remove flawed mitigation for rx irq flood

2024-04-03 Thread Finn Thain
On Thu, 4 Apr 2024, Andy Shevchenko wrote: > ... > > First of all, please read this > https://www.kernel.org/doc/html/latest/process/submitting-patches.html#backtraces-in-commit-messages > and amend the commit message accordingly. > Right -- the call chain is described in the commit log

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:13 AM Rohan McLure wrote: > > 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,

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

2024-04-03 Thread Pasha Tatashin
On Tue, Apr 2, 2024 at 1:13 AM Rohan McLure wrote: > > 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