mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm64/mm: Change protval as 'pteval_t' in map_range()
@ 2024-11-11  7:52 Anshuman Khandual
  2024-11-11 10:07 ` Gavin Shan
  2024-11-12 16:10 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Anshuman Khandual @ 2024-11-11  7:52 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Anshuman Khandual, Catalin Marinas, Will Deacon, Ard Biesheuvel,
	Ryan Roberts, Mark Rutland, linux-kernel

pgprot_t has been defined as an encapsulated structure with pteval_t as its
element. Hence it is prudent to use pteval_t as the type instead of via the
size based u64. Besides pteval_t type might be different size later on with
FEAT_D128.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v6.12-rc7

 arch/arm64/kernel/pi/map_range.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/pi/map_range.c b/arch/arm64/kernel/pi/map_range.c
index 5410b2cac590..2b69e3beeef8 100644
--- a/arch/arm64/kernel/pi/map_range.c
+++ b/arch/arm64/kernel/pi/map_range.c
@@ -30,7 +30,7 @@ void __init map_range(u64 *pte, u64 start, u64 end, u64 pa, pgprot_t prot,
 		      int level, pte_t *tbl, bool may_use_cont, u64 va_offset)
 {
 	u64 cmask = (level == 3) ? CONT_PTE_SIZE - 1 : U64_MAX;
-	u64 protval = pgprot_val(prot) & ~PTE_TYPE_MASK;
+	pteval_t protval = pgprot_val(prot) & ~PTE_TYPE_MASK;
 	int lshift = (3 - level) * (PAGE_SHIFT - 3);
 	u64 lmask = (PAGE_SIZE << lshift) - 1;
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64/mm: Change protval as 'pteval_t' in map_range()
  2024-11-11  7:52 [PATCH] arm64/mm: Change protval as 'pteval_t' in map_range() Anshuman Khandual
@ 2024-11-11 10:07 ` Gavin Shan
  2024-11-12 16:10 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Gavin Shan @ 2024-11-11 10:07 UTC (permalink / raw)
  To: Anshuman Khandual, linux-arm-kernel
  Cc: Catalin Marinas, Will Deacon, Ard Biesheuvel, Ryan Roberts,
	Mark Rutland, linux-kernel

On 11/11/24 5:52 PM, Anshuman Khandual wrote:
> pgprot_t has been defined as an encapsulated structure with pteval_t as its
> element. Hence it is prudent to use pteval_t as the type instead of via the
> size based u64. Besides pteval_t type might be different size later on with
> FEAT_D128.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> This applies on v6.12-rc7
> 
>   arch/arm64/kernel/pi/map_range.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Gavin Shan <gshan@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64/mm: Change protval as 'pteval_t' in map_range()
  2024-11-11  7:52 [PATCH] arm64/mm: Change protval as 'pteval_t' in map_range() Anshuman Khandual
  2024-11-11 10:07 ` Gavin Shan
@ 2024-11-12 16:10 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2024-11-12 16:10 UTC (permalink / raw)
  To: linux-arm-kernel, Anshuman Khandual
  Cc: Will Deacon, Ard Biesheuvel, Ryan Roberts, Mark Rutland, linux-kernel

On Mon, 11 Nov 2024 13:22:49 +0530, Anshuman Khandual wrote:
> pgprot_t has been defined as an encapsulated structure with pteval_t as its
> element. Hence it is prudent to use pteval_t as the type instead of via the
> size based u64. Besides pteval_t type might be different size later on with
> FEAT_D128.
> 
> 

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64/mm: Change protval as 'pteval_t' in map_range()
      https://git.kernel.org/arm64/c/de7fb8d3a2c9

-- 
Catalin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-12 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-11  7:52 [PATCH] arm64/mm: Change protval as 'pteval_t' in map_range() Anshuman Khandual
2024-11-11 10:07 ` Gavin Shan
2024-11-12 16:10 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®