Re: [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently

2025-06-24 Thread Anshuman Khandual
On 19/06/25 1:12 AM, Lorenzo Stoakes wrote: > The core kernel code is currently very inconsistent in its use of > vm_flags_t vs. unsigned long. This prevents us from changing the type of > vm_flags_t in the future and is simply not correct, so correct this. > > While this results in rather a lo

Re: [PATCH 3/3] mm: update architecture and driver code to use vm_flags_t

2025-06-24 Thread Anshuman Khandual
> - unsigned long end, unsigned long vm_flags); > + unsigned long end, vm_flags_t vm_flags); > > bool current_is_ksgxd(void); > void sgx_encl_release(struct kref *ref); > diff --git a/tools/testing/vma/vma_internal.h > b/tools/testing/vma/vma_internal.h > index 7919d7141537..b9eb8c889f96 100644 > --- a/tools/testing/vma/vma_internal.h > +++ b/tools/testing/vma/vma_internal.h > @@ -1220,7 +1220,7 @@ static inline void vma_set_page_prot(struct > vm_area_struct *vma) > WRITE_ONCE(vma->vm_page_prot, vm_page_prot); > } > > -static inline bool arch_validate_flags(unsigned long) > +static inline bool arch_validate_flags(vm_flags_t) > { > return true; > } Reviewed-by: Anshuman Khandual

Re: [PATCH 1/3] mm: change vm_get_page_prot() to accept vm_flags_t argument

2025-06-24 Thread Anshuman Khandual
e 100644 > --- a/tools/testing/vma/vma_internal.h > +++ b/tools/testing/vma/vma_internal.h > @@ -581,7 +581,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, > pgprot_t newprot) > return __pgprot(pgprot_val(oldprot) | pgprot_val(newprot)); > } > > -static inline pgprot_t vm_get_page_prot(unsigned long vm_flags) > +static inline pgprot_t vm_get_page_prot(vm_flags_t vm_flags) > { > return __pgprot(vm_flags); > } LGTM Reviewed-by: Anshuman Khandual

Re: [PATCH 0/3] use vm_flags_t consistently

2025-06-24 Thread Anshuman Khandual
On 19/06/25 1:12 AM, Lorenzo Stoakes wrote: > The VMA flags field vma->vm_flags is of type vm_flags_t. Right now this is > exactly equivalent to unsigned long, but it should not be assumed to be. > > Much code that references vma->vm_flags already correctly uses vm_flags_t, > but a fairly large ch

[PATCH V2 2/3] mm/ptdump: Split effective_prot() into level specific callbacks

2025-04-06 Thread Anshuman Khandual
...@vger.kernel.org Cc: linux-ri...@lists.infradead.org Cc: linux...@kvack.org Signed-off-by: Anshuman Khandual --- arch/x86/mm/dump_pagetables.c | 32 +++- include/linux/ptdump.h| 6 +- mm/ptdump.c | 20 ++-- 3 files changed, 46

[PATCH V2 3/3] arm64/mm: Define ptdesc_t

2025-04-06 Thread Anshuman Khandual
values etc which are used at all page table levels. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Mark Rutland Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Cc: linux-...@vger.kernel.org Suggested-by: Ryan Roberts Signed-off-by: Anshuman Khandual --- arch

[PATCH V2 1/3] mm/ptdump: Split note_page() into level specific callbacks

2025-04-06 Thread Anshuman Khandual
Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/ptdump.h | 16 +-- arch/arm64/mm

[PATCH V2 0/3] mm/ptdump: Drop assumption that pxd_val() is u64

2025-04-06 Thread Anshuman Khandual
@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Anshuman Khandual (3): mm/ptdump: Split note_page() into level specific callbacks mm/ptdump: Split effective_prot() into level specific callbacks arm64/mm: Define ptdesc_t arch/arm64

Re: [PATCH 1/2] mm/ptdump: Split note_page() into level specific callbacks

2025-03-31 Thread Anshuman Khandual
On 3/31/25 14:29, Alexander Gordeev wrote: > On Mon, Mar 17, 2025 at 11:48:17AM +0530, Anshuman Khandual wrote: > > Hi Anshuman, > > ... >> --- a/include/linux/ptdump.h >> +++ b/include/linux/ptdump.h >> @@ -11,9 +11,12 @@ struct ptdump_range { &g

Re: [PATCH 1/2] mm/ptdump: Split note_page() into level specific callbacks

2025-03-24 Thread Anshuman Khandual
On 3/17/25 11:48, Anshuman Khandual wrote: > Last argument passed down in note_page() is u64 assuming pxd_val() returned > value (all page table levels) is 64 bit - which might not be the case going > ahead when D128 page tables is enabled on arm64 platform. Besides pxd_val() > is v

Re: [PATCH 2/2] arm64/ptdump: Replace u64 with pteval_t

2025-03-17 Thread Anshuman Khandual
On 3/17/25 14:58, Ryan Roberts wrote: > On 17/03/2025 06:18, Anshuman Khandual wrote: >> Page table entry's value, mask and protection are represented with pteval_t >> data type format not u64 that has been assumed while dumping the page table >> entries. Replace a

[PATCH 0/2] mm/ptdump: Drop assumption that pxd_val() is u64

2025-03-17 Thread Anshuman Khandual
r Cc: Andrew Morton Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Anshuman Khandual (2): mm/ptdump: Split note_page() into level specific call

[PATCH 2/2] arm64/ptdump: Replace u64 with pteval_t

2025-03-16 Thread Anshuman Khandual
x-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/ptdump.h | 8 arch/arm64/mm/ptdump.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/ptdump.h b/arch/arm64/in

[PATCH 1/2] mm/ptdump: Split note_page() into level specific callbacks

2025-03-16 Thread Anshuman Khandual
Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/ptdump.h | 16 +-- arch/arm64/mm

[RFC 1/2] mm/ptdump: Split note_page() into level specific callbacks

2025-03-11 Thread Anshuman Khandual
...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/ptdump.h | 10 arch/arm64/mm/ptdump.c | 37 ++-- arch/powerpc/mm/ptdump/ptdump.c | 37 ++-- arch

[RFC 2/2] arm64/ptdump: Replace u64 with pteval_t

2025-03-10 Thread Anshuman Khandual
x-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/ptdump.h | 12 ++-- arch/arm64/mm/ptdump.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/include/asm/ptdump.h b/arch/

[RFC 0/2] mm/ptdump: Drop assumption that pxd_val() is u64

2025-03-10 Thread Anshuman Khandual
r Cc: Ingo Molnar Cc: Andrew Morton Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Anshuman Khandual (2): mm/ptdump: Split note_page() into

Re: [PATCH V3 5/5] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-26 Thread Anshuman Khandual
On 2/27/25 01:23, Catalin Marinas wrote: > On Wed, Feb 26, 2025 at 05:54:04PM +0530, Anshuman Khandual wrote: >> diff --git a/arch/arm64/include/asm/ptdump.h >> b/arch/arm64/include/asm/ptdump.h >> index 6cf4aae05219..b2931d1ae0fb 100644 >> --- a/arch/arm64/include

[PATCH V3 5/5] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-26 Thread Anshuman Khandual
k.org Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 2 +- arch/arm64/include/asm/ptdump.h | 4 ++-- arch/arm64/kvm/Kconfig | 4 ++-- arch/arm64/mm/Makefile | 2 +- arch/powerpc/Kconfig| 2 +- arch/powerpc/mm/Makefile| 2 +- arch/

[PATCH V3 3/5] docs: arm64: Drop PTDUMP config options from ptdump.rst

2025-02-26 Thread Anshuman Khandual
Price Signed-off-by: Anshuman Khandual --- Documentation/arch/arm64/ptdump.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/arch/arm64/ptdump.rst b/Documentation/arch/arm64/ptdump.rst index 5dcfc5d7cddf..51eb902ba41a 100644 --- a/Documentation/arch/arm64/ptdump.rst +++ b

[PATCH V3 4/5] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP

2025-02-26 Thread Anshuman Khandual
...@vger.kernel.org Reviewed-by: Steven Price Signed-off-by: Anshuman Khandual --- mm/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index 41a58536531d..a51a1149909a 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -186,6 +186,7 @@ config

[PATCH V3 2/5] arch/powerpc: Drop GENERIC_PTDUMP from mpc885_ads_defconfig

2025-02-26 Thread Anshuman Khandual
...@vger.kernel.org Fixes: e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") Suggested-by: Christophe Leroy Signed-off-by: Anshuman Khandual --- arch/powerpc/configs/mpc885_ads_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/power

[PATCH V3 1/5] configs: Drop GENERIC_PTDUMP from debug.config

2025-02-26 Thread Anshuman Khandual
x-ker...@vger.kernel.org Reviewed-by: Steven Price Signed-off-by: Anshuman Khandual --- kernel/configs/debug.config | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/configs/debug.config b/kernel/configs/debug.config index 20552f163930..8aafd050b754 100644 --- a/kernel/configs/debug.c

[PATCH V3 0/5] mm: Rework generic PTDUMP configs

2025-02-26 Thread Anshuman Khandual
el.org/all/20250213040934.3245750-1-anshuman.khand...@arm.com/ Anshuman Khandual (5): configs: Drop GENERIC_PTDUMP from debug.config arch/powerpc: Drop GENERIC_PTDUMP from mpc885_ads_defconfig docs: arm64: Drop PTDUMP config options from ptdump.rst mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP

Re: [PATCH V2 5/5] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-24 Thread Anshuman Khandual
On 2/24/25 17:31, Christophe Leroy wrote: > > > Le 17/02/2025 à 05:22, Anshuman Khandual a écrit : >> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >> is c

Re: [PATCH V2 2/5] arch/powerpc: Drop GENERIC_PTDUMP from mpc885_ads_defconfig

2025-02-24 Thread Anshuman Khandual
On 2/24/25 17:34, Christophe Leroy wrote: > > > Le 17/02/2025 à 05:22, Anshuman Khandual a écrit : >> GENERIC_PTDUMP gets selected on powerpc explicitly and hence can be dropped >> off from mpc885_ads_defconfig. >> >> Cc: Madhavan Srinivasan >> Cc: M

[PATCH] mm/ioremap: Pass pgprot_t to ioremap_prot() instead of unsigned long

2025-02-18 Thread Anshuman Khandual
s Co-developed-by: Anshuman Khandual Signed-off-by: Anshuman Khandual --- This patch applies on v6.14-rc3 and has been tested on arm64 platform. Although it builds on multiple platforms here. arch/arc/mm/ioremap.c | 6 ++ arch/arm64/include/asm/io.h | 6 +++--- arch/

[PATCH V2 5/5] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-16 Thread Anshuman Khandual
k.org Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 2 +- arch/arm64/include/asm/ptdump.h | 4 ++-- arch/arm64/kvm/Kconfig | 4 ++-- arch/arm64/mm/Makefile | 2 +- arch/powerpc/Kconfig| 2 +- arch/powerpc/mm/Makefile| 2 +- arch/

[PATCH V2 4/5] mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP

2025-02-16 Thread Anshuman Khandual
...@vger.kernel.org Reviewed-by: Steven Price Signed-off-by: Anshuman Khandual --- mm/Kconfig.debug | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index 41a58536531d..a51a1149909a 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -186,6 +186,7 @@ config

[PATCH V2 3/5] docs: arm64: Drop PTDUMP config options from ptdump.rst

2025-02-16 Thread Anshuman Khandual
Price Signed-off-by: Anshuman Khandual --- Documentation/arch/arm64/ptdump.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/arch/arm64/ptdump.rst b/Documentation/arch/arm64/ptdump.rst index 5dcfc5d7cddf..51eb902ba41a 100644 --- a/Documentation/arch/arm64/ptdump.rst +++ b

[PATCH V2 2/5] arch/powerpc: Drop GENERIC_PTDUMP from mpc885_ads_defconfig

2025-02-16 Thread Anshuman Khandual
GENERIC_PTDUMP gets selected on powerpc explicitly and hence can be dropped off from mpc885_ads_defconfig. Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual

[PATCH V2 1/5] configs: Drop GENERIC_PTDUMP from debug.config

2025-02-16 Thread Anshuman Khandual
x-ker...@vger.kernel.org Reviewed-by: Steven Price Signed-off-by: Anshuman Khandual --- kernel/configs/debug.config | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/configs/debug.config b/kernel/configs/debug.config index 20552f163930..8aafd050b754 100644 --- a/kernel/configs/debug.c

[PATCH V2 0/5] mm: Rework generic PTDUMP configs

2025-02-16 Thread Anshuman Khandual
ptdump.rst Changes in V1: https://lore.kernel.org/all/20250213040934.3245750-1-anshuman.khand...@arm.com/ Anshuman Khandual (5): configs: Drop GENERIC_PTDUMP from debug.config arch/powerpc: Drop GENERIC_PTDUMP from mpc885_ads_defconfig docs: arm64: Drop PTDUMP config options from ptdump.rst

Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-13 Thread Anshuman Khandual
On 2/13/25 17:19, Christophe Leroy wrote: > > > Le 13/02/2025 à 12:23, Steven Price a écrit : >> On 13/02/2025 04:09, Anshuman Khandual wrote: >>> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >>> But generic ptdump gets enabl

Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-13 Thread Anshuman Khandual
On 2/13/25 16:53, Steven Price wrote: > On 13/02/2025 04:09, Anshuman Khandual wrote: >> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >> is confusing as they sound

Re: [PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-13 Thread Anshuman Khandual
On 2/13/25 13:08, Christophe Leroy wrote: > > > Le 13/02/2025 à 05:09, Anshuman Khandual a écrit : >> Platforms subscribe into generic ptdump implementation via GENERIC_PTDUMP. >> But generic ptdump gets enabled via PTDUMP_CORE. These configs combination >> is c

[PATCH 4/4] mm: Rename GENERIC_PTDUMP and PTDUMP_CORE

2025-02-12 Thread Anshuman Khandual
k.org Signed-off-by: Anshuman Khandual --- Documentation/arch/arm64/ptdump.rst | 4 ++-- arch/arm64/Kconfig| 2 +- arch/arm64/include/asm/ptdump.h | 4 ++-- arch/arm64/kvm/Kconfig| 4 ++-- arch/arm64/mm/Makefile

[PATCH 0/4] mm: Rework generic PTDUMP configs

2025-02-12 Thread Anshuman Khandual
: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Anshuman Khandual (4): configs: Drop GENERIC_PTDUMP from debug.config mm: Make DEBUG_WX depdendent on GENERIC_PTDUMP mm: Make GENERIC_PTDUMP dependent on MMU mm: Rename

Re: [PATCH V2] mm/ptdump: Drop GENERIC_PTDUMP

2025-02-05 Thread Anshuman Khandual
On 2/5/25 15:31, Mark Rutland wrote: > On Wed, Feb 05, 2025 at 10:30:39AM +0530, Anshuman Khandual wrote: >> GENERIC_PTDUMP does not guard any code but instead just used for platform's >> subscription into core ptdump defined under PTDUMP_CORE, which is selected. > >

[PATCH V2] mm/ptdump: Drop GENERIC_PTDUMP

2025-02-04 Thread Anshuman Khandual
: kvm...@lists.linux.dev Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Signed-off-by: Anshuman Khandual --- This patch applies on v6.14-rc1 Changes in V2: - Keep arch/powerpc/Kconfig alphabetically sorted per Christophe Ch

Re: [PATCH] mm/ptdump: Drop GENERIC_PTDUMP

2024-12-17 Thread Anshuman Khandual
On 12/17/24 13:17, Christophe Leroy wrote: > > > Le 17/12/2024 à 04:48, Anshuman Khandual a écrit : >> GENERIC_PTDUMP does not guard any code but instead just used for platform's >> subscription into core ptdump defined under PTDUMP_CORE, which is selected. >

[PATCH] mm/ptdump: Drop GENERIC_PTDUMP

2024-12-16 Thread Anshuman Khandual
: kvm...@lists.linux.dev Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ri...@lists.infradead.org Cc: linux-s...@vger.kernel.org Cc: linux...@kvack.org Signed-off-by: Anshuman Khandual --- This patch applies on v6.13-rc3 and has been tested on arm64, although it also clears build tests on impacted plat

Re: [RFC v3 -next] cma: Enforce non-zero pageblock_order during cma_init_reserved_mem()

2024-10-13 Thread Anshuman Khandual
return -EINVAL; > + } > + > /* ensure minimal alignment required by mm core */ > if (!IS_ALIGNED(base | size, CMA_MIN_ALIGNMENT_BYTES)) > return -EINVAL; > -- > 2.46.0 > > LGTM, hopefully this comment regarding CMA_MIN_ALIGNMENT_BYTES alignment requi

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-22 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Implement the PKEYS interface, using the Permission Overlay Extension. This commit message should contain some more details here considering the amount of code change proposed in this patch. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Dea

Re: [PATCH v4 18/29] arm64: add POE signal support

2024-07-22 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Add PKEY support to signals, by saving and restoring POR_EL0 from the > stackframe. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Mark Brown > Acked-by: Szabolcs Nagy Review

Re: [PATCH v4 17/29] arm64: implement PKEYS support

2024-07-16 Thread Anshuman Khandual
On 7/9/24 18:37, Kevin Brodsky wrote: > On 03/05/2024 15:01, Joey Gouly wrote: >> @@ -267,6 +294,28 @@ static inline unsigned long mm_untag_mask(struct >> mm_struct *mm) >> return -1UL >> 8; >> } >> >> +/* >> + * We only want to enforce protection keys on the current process >> + * beca

Re: [PATCH v4 22/29] arm64: add Permission Overlay Extension Kconfig

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Now that support for POE and Protection Keys has been implemented, add a > config to allow users to actually enable it. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Anshuman Khandual > ---

Re: [PATCH v4 19/29] arm64: enable PKEY support for CPUs with S1POE

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Now that PKEYs support has been implemented, enable it for CPUs that > support S1POE. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Acked-by: Catalin Marinas Reviewed-by: Anshuman Khandual > --- &

Re: [PATCH v4 20/29] arm64: enable POE and PIE to coexist

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Set the EL0/userspace indirection encodings to be the overlay enabled > variants of the permissions. Could you please explain the rationale for this ? Should POE variants for pte permissions be used (when available) instead of permission indirection ones. >

Re: [PATCH v4 21/29] arm64/ptrace: add support for FEAT_POE

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Add a regset for POE containing POR_EL0. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Mark Brown > Reviewed-by: Catalin Marinas Reviewed-by: Anshuman Khandual > --- > arch

Re: [PATCH v4 16/29] arm64: add pte_access_permitted_no_overlay()

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > We do not want take POE into account when clearing the MTE tags. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Anshuman Khandual > --- > arch/arm64/include/asm/pgtable.h | 11 +++

Re: [PATCH v4 15/29] arm64: handle PKEY/POE faults

2024-07-16 Thread Anshuman Khandual
A minor nit. The fault is related to POE in terms of the HW rather than PKEY which it is abstracted out in core MM. Hence it might be better to describe the fault as POE one rather than PKEY related. arm64/mm: Handle POE faults On 5/3/24 18:31, Joey Gouly wrote: > If a memory fault occurs that is

Re: [PATCH v4 14/29] arm64: mask out POIndex when modifying a PTE

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > When a PTE is modified, the POIndex must be masked off so that it can be > modified. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Catalin Marinas Reviewed-by: Anshuman Khandual > --- &

Re: [PATCH v4 13/29] arm64: convert protection key into vm_flags and pgprot values

2024-07-16 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > Modify arch_calc_vm_prot_bits() and vm_get_page_prot() such that the pkey > value is set in the vm_flags and then into the pgprot value. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/mman.h | 8 +

Re: [PATCH v4 12/29] arm64: add POIndex defines

2024-07-15 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > The 3-bit POIndex is stored in the PTE at bits 60..62. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/pgtable-hwdef.h | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/arch/arm64/incl

Re: [PATCH v4 11/29] arm64: re-order MTE VM_ flags

2024-07-15 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > To make it easier to share the generic PKEYs flags, move the MTE flag. The change looks good but too less details about it here. Please do consider adding some more description, on how moving the VM flags down the arch range helps going forward. > > Signed-

Re: [PATCH v4 10/29] arm64: enable the Permission Overlay Extension for EL0

2024-07-15 Thread Anshuman Khandual
m64/kernel/cpuinfo.c > index 09eeaa24d456..b9db812082b3 100644 > --- a/arch/arm64/kernel/cpuinfo.c > +++ b/arch/arm64/kernel/cpuinfo.c > @@ -143,6 +143,7 @@ static const char *const hwcap_str[] = { > [KERNEL_HWCAP_SME_SF8FMA] = "smesf8fma", > [KERNEL_HWCAP_SME_SF8DP4] = "smesf8dp4", > [KERNEL_HWCAP_SME_SF8DP2] = "smesf8dp2", > + [KERNEL_HWCAP_POE] = "poe", > }; > > #ifdef CONFIG_COMPAT This LGTM but as Joey mentioned earlier, what happens when another new feature gets added later which needs to be exposed to userspace, add HWCAP3 ? Reviewed-by: Anshuman Khandual

Re: [PATCH v4 09/29] KVM: arm64: use `at s1e1a` for POE

2024-07-15 Thread Anshuman Khandual
if (!ret) > tmp = read_sysreg_par(); > else > tmp = SYS_PAR_EL1_F; /* back to the guest */ Since the idea is to get the IPA, using OP_AT_S1E1A instead, makes sense when POE is enabled. Reviewed-by: Anshuman Khandual

Re: [PATCH v4 08/29] KVM: arm64: make kvm_at() take an OP_AT_*

2024-07-15 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > To allow using newer instructions that current assemblers don't know about, > replace the `at` instruction with the underlying SYS instruction. > > Signed-off-by: Joey Gouly > Cc: Marc Zyngier > Cc: Oliver Upton > Cc: Catalin Marinas > Cc: Will Deacon >

Re: [PATCH v4 06/29] arm64: context switch POR_EL0 register

2024-07-15 Thread Anshuman Khandual
On 5/3/24 18:31, Joey Gouly wrote: > POR_EL0 is a register that can be modified by userspace directly, > so it must be context switched. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/cpufeature.h | 6 ++ > arch/arm64/include/asm/pr

Re: [PATCH v4 03/29] mm: use ARCH_PKEY_BITS to define VM_PKEY_BITN

2024-07-15 Thread Anshuman Khandual
+#if CONFIG_ARCH_PKEY_BITS > 4 > # define VM_PKEY_BIT4 VM_HIGH_ARCH_4 > #else > # define VM_PKEY_BIT4 0 Agree with Dave that this is not very clean but does the job i.e getting rid of the platform #ifdef which in itself is an improvement. Reviewed-by: Anshuman Khandual

Re: [PATCH v4 05/29] arm64: cpufeature: add Permission Overlay Extension cpucap

2024-07-15 Thread Anshuman Khandual
> @@ -45,6 +45,7 @@ HAS_MOPS > HAS_NESTED_VIRT > HAS_PAN > HAS_S1PIE > +HAS_S1POE > HAS_RAS_EXTN > HAS_RNG > HAS_SB Reviewed-by: Anshuman Khandual

Re: [PATCH v4 04/29] arm64: disable trapping of POR_EL0 to EL2

2024-07-15 Thread Anshuman Khandual
ng of POR_EL0 */ > + orr x0, x0, #HFGxTR_EL2_nPOR_EL0 > + > .Lset_fgt_\@: > msr_s SYS_HFGRTR_EL2, x0 > msr_s SYS_HFGWTR_EL2, x0 Reviewed-by: Anshuman Khandual

[PATCH] mm/hugetlb: Move page order check inside hugetlb_cma_reserve()

2024-02-08 Thread Anshuman Khandual
m-ker...@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on v6.8-rc3 arch/arm64/mm/hugetlbpage.c | 7 --- arch/powerpc/mm/hugetlbpage.c | 4 +--- mm/hugetlb.c

Re: [PATCH] mm/debug_vm_pgtable: Fix BUG_ON with pud advanced test

2024-01-28 Thread Anshuman Khandual
On 1/29/24 11:56, Aneesh Kumar K.V wrote: > On 1/29/24 11:52 AM, Anshuman Khandual wrote: >> >> >> On 1/29/24 11:30, Aneesh Kumar K.V (IBM) wrote: >>> Architectures like powerpc add debug checks to ensure we find only devmap >>> PUD pte entries

Re: [PATCH] mm/debug_vm_pgtable: Fix BUG_ON with pud advanced test

2024-01-28 Thread Anshuman Khandual
On 1/29/24 11:30, Aneesh Kumar K.V (IBM) wrote: > Architectures like powerpc add debug checks to ensure we find only devmap > PUD pte entries. These debug checks are only done with CONFIG_DEBUG_VM. > This patch marks the ptes used for PUD advanced test devmap pte entries > so that we don't hit o

Re: mm/debug_vm_pgtable.c:860 warning triggered

2023-11-05 Thread Anshuman Khandual
Hello Daniel, This test just ensures that PFN is preserved during pte <--> swap pte transformations , and the warning here seems to have been caused by powerpc platform specific helpers and/or its pte_t representation. Adding powerpc folks and platform mailing list here. - Anshuman On 11/4/23

Re: [PATCH 0/4] Invalidate secondary IOMMU TLB on permission upgrade

2023-07-18 Thread Anshuman Khandual
On 7/18/23 13:26, Alistair Popple wrote: > The main change is to move secondary TLB invalidation mmu notifier > callbacks into the architecture specific TLB flushing functions. This > makes secondary TLB invalidation mostly match CPU invalidation while > still allowing efficient range based inva

Re: [PATCH V2] mm: Merge pte_mkhuge() call into arch_make_huge_pte()

2023-03-01 Thread Anshuman Khandual
On 3/1/23 12:26, Christophe Leroy wrote: > Hi, > > Le 03/02/2022 à 04:57, Anshuman Khandual a écrit : >> Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). >> Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning. >> Th

Re: [PATCH v7 1/2] mm/tlbbatch: Introduce arch_tlbbatch_should_defer()

2022-11-29 Thread Anshuman Khandual
On 11/30/22 07:53, Yicong Yang wrote: > On 2022/11/30 7:23, Andrew Morton wrote: >> On Thu, 17 Nov 2022 16:26:47 +0800 Yicong Yang wrote: >> >>> From: Anshuman Khandual >>> >>> The entire scheme of deferred TLB flush in reclaim path rests on the >&

Re: [PATCH v7 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-11-23 Thread Anshuman Khandual
HED_TLB. > > This patch extends arch_tlbbatch_add_mm() to take an address of the > target page to support the feature on arm64. Also rename it to > arch_tlbbatch_add_pending() to better match its function since we > don't need to handle the mm on arm64 and add_mm is not proper. >

Re: [PATCH v6 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-11-15 Thread Anshuman Khandual
On 11/16/22 07:26, Nadav Amit wrote: > On Nov 15, 2022, at 5:50 PM, Yicong Yang wrote: > >> !! External Email >> >> On 2022/11/16 7:38, Nadav Amit wrote: >>> On Nov 14, 2022, at 7:14 PM, Yicong Yang wrote: >>> diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbf

Re: [PATCH v5 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-11-14 Thread Anshuman Khandual
On 11/14/22 14:16, Yicong Yang wrote: > On 2022/11/14 11:29, Anshuman Khandual wrote: >> >> On 10/28/22 13:42, Yicong Yang wrote: >>> +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) >>> +{ >>> + /* >>> +* TLB batche

Re: [PATCH v5 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-11-13 Thread Anshuman Khandual
On 10/28/22 13:42, Yicong Yang wrote: > +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) > +{ > + /* > + * TLB batched flush is proved to be beneficial for systems with large > + * number of CPUs, especially system with more than 8 CPUs. TLB shutdown > + *

Re: [PATCH v4 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-10-27 Thread Anshuman Khandual
On 10/28/22 03:25, Barry Song wrote: > On Fri, Oct 28, 2022 at 3:19 AM Punit Agrawal > wrote: >> >> [ Apologies for chiming in late in the conversation ] >> >> Anshuman Khandual writes: >> >>> On 9/28/22 05:53, Barry Song wrote: >>>

Re: [PATCH v4 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-10-27 Thread Anshuman Khandual
On 10/28/22 03:37, Barry Song wrote: > On Thu, Oct 27, 2022 at 11:42 PM Anshuman Khandual > wrote: >> >> >> >> On 9/28/22 05:53, Barry Song wrote: >>> On Tue, Sep 27, 2022 at 10:15 PM Yicong Yang wrote: >>>> >>>> On 2022/9/27 14:

Re: [PATCH v4 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-10-27 Thread Anshuman Khandual
On 9/28/22 05:53, Barry Song wrote: > On Tue, Sep 27, 2022 at 10:15 PM Yicong Yang wrote: >> >> On 2022/9/27 14:16, Anshuman Khandual wrote: >>> [...] >>> >>> On 9/21/22 14:13, Yicong Yang wrote: >>>> +static inline bool arch_tlbbatch_shoul

Re: [PATCH v4 2/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-26 Thread Anshuman Khandual
[...] On 9/21/22 14:13, Yicong Yang wrote: > +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) > +{ > + /* for small systems with small number of CPUs, TLB shootdown is cheap > */ > + if (num_online_cpus() <= 4) It would be great to have some more inputs from others, w

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-21 Thread Anshuman Khandual
On 9/21/22 12:47, Nadav Amit wrote: > On Sep 20, 2022, at 11:53 PM, Anshuman Khandual > wrote: > >> ⚠ External Email >> >> On 8/22/22 13:51, Yicong Yang wrote: >>> +static inline void arch_tlbbatch_add_mm(struct a

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-20 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > +static inline void arch_tlbbatch_add_mm(struct arch_tlbflush_unmap_batch > *batch, > + struct mm_struct *mm, > + unsigned long uaddr) > +{ > + __flush_tlb_page_nosync(mm, uaddr); >

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-20 Thread Anshuman Khandual
On 9/21/22 07:21, Barry Song wrote: > On Wed, Sep 21, 2022 at 1:50 PM Barry Song <21cn...@gmail.com> wrote: >> >> On Tue, Sep 20, 2022 at 8:45 PM Anshuman Khandual >> wrote: >>> >>> >>> >>> On 9/20/22 09:09, Barry Song wrote: >

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-20 Thread Anshuman Khandual
On 9/20/22 09:09, Barry Song wrote: > On Tue, Sep 20, 2022 at 3:00 PM Anshuman Khandual > wrote: >> >> >> On 8/22/22 13:51, Yicong Yang wrote: >>> +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) >>> +{ >>> + return

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-19 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) > +{ > + return true; > +} This needs to be conditional on systems, where there will be performance improvements, and should not just be enabled all the time on all systems. num_online

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-18 Thread Anshuman Khandual
On 9/15/22 12:12, Barry Song wrote: > On Thu, Sep 15, 2022 at 6:07 PM Anshuman Khandual > wrote: >> >> >> >> On 9/9/22 11:05, Barry Song wrote: >>> On Fri, Sep 9, 2022 at 5:24 PM Anshuman Khandual >>> wrote: >>>> >>>&g

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-18 Thread Anshuman Khandual
On 9/15/22 20:01, Nadav Amit wrote: > > >> On Sep 14, 2022, at 11:42 PM, Barry Song <21cn...@gmail.com> wrote: >> >>> >>> The very idea behind TLB deferral is the opportunity it (might) provide >>> to accumulate address ranges and cpu masks so that individual TLB flush >>> can be replaced with

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-14 Thread Anshuman Khandual
On 9/9/22 11:05, Barry Song wrote: > On Fri, Sep 9, 2022 at 5:24 PM Anshuman Khandual > wrote: >> >> >> >> On 8/22/22 13:51, Yicong Yang wrote: >>> From: Barry Song >>> >>> on x86, batched and deferred tlb shootdown has lead to 90% &g

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-08 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > From: Barry Song > > on x86, batched and deferred tlb shootdown has lead to 90% > performance increase on tlb shootdown. on arm64, HW can do > tlb shootdown without software IPI. But sync tlbi is still > quite expensive. > > Even running a simplest progr

Re: [PATCH v3 3/4] mm: rmap: Extend tlbbatch APIs to fit new platforms

2022-09-08 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > From: Barry Song > > Add uaddr to tlbbatch APIs so that platforms like ARM64 are I guess 'uaddr' refers to a virtual address from the process address space itself ? Please be more specific. > able to apply this on their specific hardware features. For >

Re: [PATCH v3 1/4] Revert "Documentation/features: mark BATCHED_UNMAP_TLB_FLUSH doesn't apply to ARM64"

2022-09-08 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > From: Barry Song > > This reverts commit 6bfef171d0d74cb050112e0e49feb20bfddf7f42. > > I was wrong. Though ARM64 has hardware TLB flush, but it is not free > and it is still expensive. > We still have a good chance to enable batched and deferred TLB flus

Re: [PATCH v3 2/4] mm/tlbbatch: Introduce arch_tlbbatch_should_defer()

2022-09-08 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > From: Anshuman Khandual > > The entire scheme of deferred TLB flush in reclaim path rests on the > fact that the cost to refill TLB entries is less than flushing out > individual entries by sending IPI to remote CPUs. But architecture >

Re: [PATCH V7 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms

2022-07-11 Thread Anshuman Khandual
On 7/12/22 01:44, Andrew Morton wrote: > On Mon, 11 Jul 2022 12:35:34 +0530 Anshuman Khandual > wrote: > >> This series drops __SXXX/__PXXX macros from across platforms in the tree. > > I've updated mm-unstable to this version, thanks. I skipped the added-to-mm

[PATCH V7 26/26] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
: Andrew Morton Cc: linux...@kvack.org Cc: linux-ker...@vger.kernel.org Reviewed-by: Geert Uytterhoeven Reviewed-by: Christoph Hellwig Reviewed-by: Christophe Leroy Acked-by: Geert Uytterhoeven Signed-off-by: Anshuman Khandual --- arch/alpha/Kconfig | 1 - arch/arc/Kconfig| 1

[PATCH V7 25/26] sh/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
: Yoshinori Sato Cc: Rich Felker Cc: linux...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/sh/Kconfig | 1 + arch/sh/include/asm/pgtable.h | 17 - arch/sh/mm/mmap.c | 20 3 files changed, 21

[PATCH V7 24/26] um/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
Dike Cc: linux...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/um/Kconfig | 1 + arch/um/include/asm/pgtable.h | 17 - arch/um/kernel/mem.c | 20 arch/x86/um/mem_32.c | 2 +- 4

[PATCH V7 23/26] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm/Kconfig | 1 + arch/arm/include/asm/pgtable.h | 17 - arch/arm/lib/uaccess_with_memcpy.c | 2 +- arch/arm/mm

[PATCH V7 19/26] ia64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/ia64/Kconfig | 1 + arch/ia64/include/asm/pgtable.h | 18 -- arch/ia64/mm/init.c | 28 +++- 3 files changed, 28 insertions(+), 19

[PATCH V7 22/26] arc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
Gupta Cc: linux-snps-...@lists.infradead.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arc/Kconfig | 1 + arch/arc/include/asm/pgtable-bits-arcv2.h | 18 -- arch/arc/mm/mmap.c| 20

[PATCH V7 18/26] s390/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
Carstens Cc: Vasily Gorbik Cc: linux-s...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/s390/Kconfig | 1 + arch/s390/include/asm/pgtable.h | 17 - arch/s390/mm/mmap.c | 20 3 files changed

[PATCH V7 21/26] m68k/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
Bogendoerfer Cc: linux-m...@lists.linux-m68k.org Cc: linux-ker...@vger.kernel.org Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Anshuman Khandual --- arch/m68k/Kconfig| 1 + arch/m68k/include/asm/mcf_pgtable.h | 59

[PATCH V7 17/26] csky/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-07-11 Thread Anshuman Khandual
Uytterhoeven Cc: linux-c...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Acked-by: Guo Ren Signed-off-by: Anshuman Khandual --- arch/csky/Kconfig | 1 + arch/csky/include/asm/pgtable.h | 18 -- arch/csky/mm/init.c | 20 3 files

  1   2   3   4   5   6   7   8   9   10   >