Re: [PATCH] powerpc: build-time fixup alternate feature relative addresses

2024-03-12 Thread Christophe Leroy
Le 29/01/2024 à 07:25, Sathvika Vasireddy a écrit : > Hi Christophe, Nick > > On 1/26/24 12:32 AM, Christophe Leroy wrote: >> Hi Nic, >> >> Le 21/05/2017 à 03:01, Nicholas Piggin a écrit : >>> Implement build-time fixup of alternate feature relative addresses for >>> the out-of-line ("else") pat

Re: [PATCH 1/2] powerpc: Flush checkpointed gpr state for 32-bit processes in ptrace

2024-03-12 Thread Christophe Leroy
Le 19/06/2018 à 21:54, Pedro Franco de Carvalho a écrit : > Would something like this be ok? > > I factored out the calls to flush_fp_to_thread and flush_altivec_to_thread, > although I don't really understand why these are necessary. The > tm_cvsx_get/set > functions also calls flush_vsx_to_th

Re: [PATCH] powerpc/kernel: Fix potential spectre v1 in syscall

2024-03-12 Thread Christophe Leroy
+Nathan as this is RTAS related. Le 21/08/2018 à 20:42, Breno Leitao a écrit : > The rtas syscall reads a value from a user-provided structure and uses it > to index an array, being a possible area for a potential spectre v1 attack. > This is the code that exposes this problem. > > args.ret

Re: [PATCH v5 02/10] locking/mutex: introduce devm_mutex_init

2024-03-12 Thread Andy Shevchenko
On Tue, Mar 12, 2024 at 7:41 AM Christophe Leroy wrote: > Le 12/03/2024 à 01:01, George Stark a écrit : > > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > > Découvrez pourquoi ceci est important à > > https://aka.ms/LearnAboutSenderIdentification ] > > On 3/7/24 13:34, A

Re: [PATCH] powerpc/kernel: Fix potential spectre v1 in syscall

2024-03-12 Thread Breno Leitao
On Tue, Mar 12, 2024 at 08:17:42AM +, Christophe Leroy wrote: > +Nathan as this is RTAS related. > > Le 21/08/2018 à 20:42, Breno Leitao a écrit : > > The rtas syscall reads a value from a user-provided structure and uses it > > to index an array, being a possible area for a potential spectre

kexec verbose dumps with 6.8 [was: [PATCH v4 1/7] kexec_file: add kexec_file flag to control debug printing]

2024-03-12 Thread Jiri Slaby
On 13. 12. 23, 6:57, Baoquan He wrote: When specifying 'kexec -c -d', kexec_load interface will print loading information, e.g the regions where kernel/initrd/purgatory/cmdline are put, the memmap passed to 2nd kernel taken as system RAM ranges, and printing all contents of struct kexec_segment,

Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-12 Thread Michael Ellerman
Rob Herring writes: > On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote: >> On 3/7/24 16:52, Rob Herring wrote: >> > On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote: >> > > Stefan Berger writes: >> > > > linux,sml-base holds the address of a buffer with the TPM log. T

Re: [PATCH 2/2] tpm: of: If available Use linux,sml-log to get the log and its size

2024-03-12 Thread Michael Ellerman
Stefan Berger writes: > On 3/7/24 15:00, Jarkko Sakkinen wrote: >> On Thu Mar 7, 2024 at 9:57 PM EET, Jarkko Sakkinen wrote: >>> in short summary: s/Use/use/ >>> >>> On Wed Mar 6, 2024 at 5:55 PM EET, Stefan Berger wrote: If linux,sml-log is available use it to get the TPM log rather than the

Re: [PATCH] powerpc/kernel: Fix potential spectre v1 in syscall

2024-03-12 Thread Michael Ellerman
Breno Leitao writes: > On Tue, Mar 12, 2024 at 08:17:42AM +, Christophe Leroy wrote: >> +Nathan as this is RTAS related. >> >> Le 21/08/2018 à 20:42, Breno Leitao a écrit : >> > The rtas syscall reads a value from a user-provided structure and uses it >> > to index an array, being a possible

Re: [RFC PATCH v2 2/3] dt-bindings: tpm: Add linux,sml-log to ibm,vtpm.yaml

2024-03-12 Thread Lukas Wunner
On Mon, Mar 11, 2024 at 09:20:29AM -0400, Stefan Berger wrote: > Add linux,sml-log, which carries the firmware TPM log in a uint8-array, to > the properties. Either this property is required or both linux,sml-base and > linux,sml-size are required. Add a test case for verification. > > Fixes: 8200

Re: [PATCH v5 02/10] locking/mutex: introduce devm_mutex_init

2024-03-12 Thread George Stark
Hello Christophe Thanks for the review You were right about typecheck - it was meant to check errors even if CONFIG_DEBUG_MUTEXES was off. Here's new version based on the comments: diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 67edc4ca2bee..9193b163038f 100644 --- a/include

Re: [PATCH v5 02/10] locking/mutex: introduce devm_mutex_init

2024-03-12 Thread Christophe Leroy
Le 12/03/2024 à 12:39, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hello Christophe > > Thanks for the review > You were right about typecheck -

Re: [PATCH] powerpc/kernel: Fix potential spectre v1 in syscall

2024-03-12 Thread Breno Leitao
On Tue, Mar 12, 2024 at 10:07:54PM +1100, Michael Ellerman wrote: > Breno Leitao writes: > > On Tue, Mar 12, 2024 at 08:17:42AM +, Christophe Leroy wrote: > >> +Nathan as this is RTAS related. > >> > >> Le 21/08/2018 à 20:42, Breno Leitao a écrit : > >> > The rtas syscall reads a value from a

Re: [RFC PATCH v2 2/3] dt-bindings: tpm: Add linux,sml-log to ibm,vtpm.yaml

2024-03-12 Thread Stefan Berger
On 3/12/24 07:11, Lukas Wunner wrote: On Mon, Mar 11, 2024 at 09:20:29AM -0400, Stefan Berger wrote: Add linux,sml-log, which carries the firmware TPM log in a uint8-array, to the properties. Either this property is required or both linux,sml-base and linux,sml-size are required. Add a test c

Re: [PATCH v5 02/10] locking/mutex: introduce devm_mutex_init

2024-03-12 Thread George Stark
Hello Christophe On 3/12/24 14:51, Christophe Leroy wrote: Le 12/03/2024 à 12:39, George Stark a écrit : [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] ... You don't need that

Re: [RFC PATCH v2 3/3] tpm: of: If available use linux,sml-log to get the log and its size

2024-03-12 Thread Jarkko Sakkinen
On Mon Mar 11, 2024 at 10:33 PM EET, Stefan Berger wrote: > > > On 3/11/24 16:25, Jarkko Sakkinen wrote: > > On Mon Mar 11, 2024 at 3:20 PM EET, Stefan Berger wrote: > >> If linux,sml-log is available use it to get the TPM log rather than the > >> pointer found in linux,sml-base. This resolves an i

Re: [PATCH 2/2] tpm: of: If available Use linux,sml-log to get the log and its size

2024-03-12 Thread Jarkko Sakkinen
On Tue Mar 12, 2024 at 12:35 PM EET, Michael Ellerman wrote: > Stefan Berger writes: > > On 3/7/24 15:00, Jarkko Sakkinen wrote: > >> On Thu Mar 7, 2024 at 9:57 PM EET, Jarkko Sakkinen wrote: > >>> in short summary: s/Use/use/ > >>> > >>> On Wed Mar 6, 2024 at 5:55 PM EET, Stefan Berger wrote: > >

Re: [RFC PATCH v2 2/3] dt-bindings: tpm: Add linux,sml-log to ibm,vtpm.yaml

2024-03-12 Thread Jarkko Sakkinen
On Tue Mar 12, 2024 at 1:11 PM EET, Lukas Wunner wrote: > On Mon, Mar 11, 2024 at 09:20:29AM -0400, Stefan Berger wrote: > > Add linux,sml-log, which carries the firmware TPM log in a uint8-array, to > > the properties. Either this property is required or both linux,sml-base and > > linux,sml-size

Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-12 Thread Rob Herring
On Tue, Mar 12, 2024 at 09:32:50PM +1100, Michael Ellerman wrote: > Rob Herring writes: > > On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote: > >> On 3/7/24 16:52, Rob Herring wrote: > >> > On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote: > >> > > Stefan Berger write

[PATCH 00/14] Add support for suppressing warning backtraces

2024-03-12 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 useful

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

2024-03-12 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 a

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

2024-03-12 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. Sign

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

2024-03-12 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. Signed-off-by: Guenter Roeck --- lib/kunit/Mak

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

2024-03-12 Thread Guenter Roeck
Document API functions for suppressing warning backtraces. Signed-off-by: Guenter Roeck --- Documentation/dev-tools/kunit/usage.rst | 30 - 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kun

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

2024-03-12 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 log

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

2024-03-12 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()) WA

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

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

2024-03-12 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 and CONFIG_DEBUG_BUGVERBOSE are ena

[RFC PATCH 0/3] powerpc: pSeries: vfio: iommu: Re-enable support for SPAPR TCE VFIO

2024-03-12 Thread Shivaprasad G Bhat
This patch-set fills the missing gaps on pSeries for VFIO SPAPR TCE sub-driver thereby re-enabling the VFIO support on POWER pSeries machines. Structure of the patchset = * Currently, due to [1] VFIO_IOMMU_UNMAP_{DMA,UNMAP} ioctls are broken on pSeries as it only supports

[RFC PATCH 1/3] powerpc/pseries/iommu: Bring back userspace view for single level TCE tables

2024-03-12 Thread Shivaprasad G Bhat
The commit 090bad39b237a ("powerpc/powernv: Add indirect levels to it_userspace") which implemented the tce indirect levels support for PowerNV ended up removing the single level support which existed by default(generic tce_iommu_userspace_view_alloc/free() calls). On pSeries the TCEs are single le

[RFC PATCH 2/3] powerpc/iommu: Move pSeries specific functions to pseries/iommu.c

2024-03-12 Thread Shivaprasad G Bhat
The PowerNV specific table_group_ops are defined in powernv/pci-ioda.c. The pSeries specific table_group_ops are sitting in the generic powerpc file. Move it to where it actually belong(pseries/iommu.c). Only code movement, no functional changes intended. Signed-off-by: Shivaprasad G Bhat --- a

[RFC PATCH 3/3] pseries/iommu: Enable DDW for VFIO TCE create

2024-03-12 Thread Shivaprasad G Bhat
The commit 9d67c9433509 ("powerpc/iommu: Add \"borrowing\" iommu_table_group_ops") implemented the "borrow" mechanism for the pSeries SPAPR TCE. It did implement this support partially that it left out creating the DDW if not present already. The patch here attempts to fix the missing gaps. - Exp

Re: [PATCH v5 02/10] locking/mutex: introduce devm_mutex_init

2024-03-12 Thread Christophe Leroy
Le 12/03/2024 à 16:30, George Stark a écrit : > [Vous ne recevez pas souvent de courriers de gnst...@salutedevices.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hello Christophe > > On 3/12/24 14:51, Christophe Leroy wrote: >> >> >> Le 12

Re: [PATCH 2/2] tpm: of: If available Use linux,sml-log to get the log and its size

2024-03-12 Thread Stefan Berger
On 3/12/24 11:50, Jarkko Sakkinen wrote: On Tue Mar 12, 2024 at 12:35 PM EET, Michael Ellerman wrote: Stefan Berger writes: On 3/7/24 15:00, Jarkko Sakkinen wrote: On Thu Mar 7, 2024 at 9:57 PM EET, Jarkko Sakkinen wrote: in short summary: s/Use/use/ On Wed Mar 6, 2024 at 5:55 PM EET, St

Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-12 Thread Stefan Berger
On 3/12/24 12:22, Rob Herring wrote: On Tue, Mar 12, 2024 at 09:32:50PM +1100, Michael Ellerman wrote: Rob Herring writes: On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote: On 3/7/24 16:52, Rob Herring wrote: On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote:

Re: [RFC PATCH v2 3/3] tpm: of: If available use linux,sml-log to get the log and its size

2024-03-12 Thread Stefan Berger
On 3/12/24 11:43, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 10:33 PM EET, Stefan Berger wrote: On 3/11/24 16:25, Jarkko Sakkinen wrote: On Mon Mar 11, 2024 at 3:20 PM EET, Stefan Berger wrote: If linux,sml-log is available use it to get the TPM log rather than the pointer found in lin

Re: [PATCH RFC 00/13] mm/treewide: Remove pXd_huge() API

2024-03-12 Thread Peter Xu
Hi, Christophe, On Mon, Mar 11, 2024 at 09:58:47AM +, Christophe Leroy wrote: > Hi Peter, and nice job you are doing in cleaning up things around _huge > stuff. Thanks. I appreciate your help along the way on Power. > > One thing that might be worth looking at also at some point is the me

Re: [PATCH 01/14] bug/kunit: Core support for suppressing warning backtraces

2024-03-12 Thread Kees Cook
On Tue, Mar 12, 2024 at 10:02:56AM -0700, Guenter Roeck wrote: > 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 intentio

Re: [PATCH 02/14] kunit: bug: Count suppressed warning backtraces

2024-03-12 Thread Kees Cook
On Tue, Mar 12, 2024 at 10:02:57AM -0700, Guenter Roeck wrote: > 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 > archite

Re: [PATCH 03/14] kunit: Add test cases for backtrace warning suppression

2024-03-12 Thread Kees Cook
On Tue, Mar 12, 2024 at 10:02:58AM -0700, Guenter Roeck wrote: > 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 architect

Re: [PATCH 04/14] kunit: Add documentation for warning backtrace suppression API

2024-03-12 Thread Kees Cook
On Tue, Mar 12, 2024 at 10:02:59AM -0700, Guenter Roeck wrote: > Document API functions for suppressing warning backtraces. > > Signed-off-by: Guenter Roeck Reviewed-by: Kees Cook -- Kees Cook

[PATCH v3 07/12] powerpc: Use initializer for struct vm_unmapped_area_info

2024-03-12 Thread Rick Edgecombe
Future changes will need to add a new member to struct vm_unmapped_area_info. This would cause trouble for any call site that doesn't initialize the struct. Currently every caller sets each member manually, so if new members are added they will be uninitialized and the core code parsing the struct

Re: kexec verbose dumps with 6.8 [was: [PATCH v4 1/7] kexec_file: add kexec_file flag to control debug printing]

2024-03-12 Thread Baoquan He
Hi Jiri, On 03/12/24 at 10:58am, Jiri Slaby wrote: > On 13. 12. 23, 6:57, Baoquan He wrote: ... snip... > > --- a/include/linux/kexec.h > > +++ b/include/linux/kexec.h > ... > > @@ -500,6 +500,13 @@ static inline int crash_hotplug_memory_support(void) { > > return 0; } > > static inline unsign

[PATCH v10 09/12] powerpc: mm: Add common pud_pfn stub for all platforms

2024-03-12 Thread Rohan McLure
Prior to this commit, pud_pfn was implemented with BUILD_BUG as the inline function for 64-bit Book3S systems but is never included, as its invocations in generic code are guarded by calls to pud_devmap which return zero on such systems. A future patch will provide support for page table checks, th

[PATCH v10 01/12] Revert "mm/page_table_check: remove unused parameter in [__]page_table_check_pud_set"

2024-03-12 Thread Rohan McLure
This reverts commit 6d144436d954311f2dbacb5bf7b084042448d83e. 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 of the access. riscv: Respect change to delete mm, a

[PATCH v10 04/12] Revert "mm/page_table_check: remove unused parameter in [__]page_table_check_pud_clear"

2024-03-12 Thread Rohan McLure
This reverts commit 931c38e16499a057e30a3033f4d6a9c242f0f156. 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 of the access. Signed-off-by: Rohan McLure --- arc

[PATCH v10 06/12] Revert "mm/page_table_check: remove unused parameter in [__]page_table_check_pte_clear"

2024-03-12 Thread Rohan McLure
This reverts commit aa232204c4689427cefa55fe975692b57291523a. 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 of the access. Signed-off-by: Rohan McLure --- arc

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

2024-03-12 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 v10 10/12] poweprc: mm: Implement *_user_accessible_page() for ptes

2024-03-12 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 v10 02/12] Revert "mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_set"

2024-03-12 Thread Rohan McLure
This reverts commit a3b837130b5865521fa8662aceaa6ebc8d29389a. 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 of the access. riscv: Respect change to delete mm, a

[PATCH v10 12/12] powerpc: mm: Support page table check

2024-03-12 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 v10 08/12] powerpc: mm: Replace p{u,m,4}d_is_leaf with p{u,m,4}_leaf

2024-03-12 Thread Rohan McLure
Replace occurrences of p{u,m,4}d_is_leaf with p{u,m,4}_leaf, as the latter is the name given to checking that a higher-level entry in multi-level paging contains a page translation entry (pte) throughout all other archs. Reviewed-by: Christophe Leroy Signed-off-by: Rohan McLure --- v9: No longer

[PATCH v10 00/12] Support page table check PowerPC

2024-03-12 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 v10 05/12] Revert "mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_clear"

2024-03-12 Thread Rohan McLure
This reverts commit 1831414cd729a34af937d56ad684a66599de6344. 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 of the access. Signed-off-by: Rohan McLure --- arc

[PATCH v10 03/12] mm: Provide addr parameter to page_table_check_pte_set()

2024-03-12 Thread Rohan McLure
To provide support for powerpc platforms, provide an address 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 from the addr paramete

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

2024-03-12 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

Re: kexec verbose dumps with 6.8 [was: [PATCH v4 1/7] kexec_file: add kexec_file flag to control debug printing]

2024-03-12 Thread Jiri Slaby
Hi, On 13. 03. 24, 1:48, Baoquan He wrote: Hi Jiri, On 03/12/24 at 10:58am, Jiri Slaby wrote: On 13. 12. 23, 6:57, Baoquan He wrote: ... snip... --- a/include/linux/kexec.h +++ b/include/linux/kexec.h ... @@ -500,6 +500,13 @@ static inline int crash_hotplug_memory_support(void) { retur

Re: [PATCH v3 07/12] powerpc: Use initializer for struct vm_unmapped_area_info

2024-03-12 Thread Christophe Leroy
Le 12/03/2024 à 23:28, Rick Edgecombe a écrit : > Future changes will need to add a new member to struct > vm_unmapped_area_info. This would cause trouble for any call site that > doesn't initialize the struct. Currently every caller sets each member > manually, so if new members are added they w