[PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-22 Thread David Hildenbrand
We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). Signed-off-by: David Hildenbrand --- arch/arm/include/asm/pgtable.h | 2 ++ arch/arm64/include/asm/pgtable.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Ryan Roberts
On 22/01/2024 19:41, David Hildenbrand wrote: > We want to make use of pte_next_pfn() outside of set_ptes(). Let's > simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). > > Signed-off-by: David Hildenbrand > --- > arch/arm/include/asm/pgtable.h | 2 ++ > arch/arm64/include/asm/pgtable.h

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread David Hildenbrand
On 23.01.24 11:34, Ryan Roberts wrote: On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). Signed-off-by: David Hildenbrand --- arch/arm/include/asm/pgtable.h | 2 ++ arc

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread David Hildenbrand
On 23.01.24 11:48, David Hildenbrand wrote: On 23.01.24 11:34, Ryan Roberts wrote: On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). Signed-off-by: David Hildenbrand ---

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Ryan Roberts
On 23/01/2024 10:48, David Hildenbrand wrote: > On 23.01.24 11:34, Ryan Roberts wrote: >> On 22/01/2024 19:41, David Hildenbrand wrote: >>> We want to make use of pte_next_pfn() outside of set_ptes(). Let's >>> simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). >>> >>> Signed-off-by: David H

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 11:48, David Hildenbrand a écrit : > On 23.01.24 11:34, Ryan Roberts wrote: >> On 22/01/2024 19:41, David Hildenbrand wrote: >>> We want to make use of pte_next_pfn() outside of set_ptes(). Let's >>> simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). >>> >>> Signed-off-by:

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 12:08, Ryan Roberts a écrit : > On 23/01/2024 10:48, David Hildenbrand wrote: >> On 23.01.24 11:34, Ryan Roberts wrote: >>> On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT, requ

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Ryan Roberts
On 23/01/2024 11:02, David Hildenbrand wrote: > On 23.01.24 11:48, David Hildenbrand wrote: >> On 23.01.24 11:34, Ryan Roberts wrote: >>> On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT, required

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread David Hildenbrand
If high bits are used for something else, then we might produce a garbage PTE on overflow, but that shouldn't really matter I concluded for folio_pte_batch() purposes, we'd not detect "belongs to this folio batch" either way. Exactly. Maybe it's likely cleaner to also have a custom pte_next

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread David Hildenbrand
On 23.01.24 12:17, Ryan Roberts wrote: On 23/01/2024 11:02, David Hildenbrand wrote: On 23.01.24 11:48, David Hildenbrand wrote: On 23.01.24 11:34, Ryan Roberts wrote: On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy defi

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Ryan Roberts
On 23/01/2024 11:31, David Hildenbrand wrote: >>> If high bits are used for something else, then we might produce a garbage PTE on overflow, but that shouldn't really matter I concluded for folio_pte_batch() purposes, we'd not detect "belongs to this folio batch" either wa

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread David Hildenbrand
On 23.01.24 12:38, Ryan Roberts wrote: On 23/01/2024 11:31, David Hildenbrand wrote: If high bits are used for something else, then we might produce a garbage PTE on overflow, but that shouldn't really matter I concluded for folio_pte_batch() purposes, we'd not detect "belongs to this folio ba

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Ryan Roberts
On 23/01/2024 11:33, David Hildenbrand wrote: > On 23.01.24 12:17, Ryan Roberts wrote: >> On 23/01/2024 11:02, David Hildenbrand wrote: >>> On 23.01.24 11:48, David Hildenbrand wrote: On 23.01.24 11:34, Ryan Roberts wrote: > On 22/01/2024 19:41, David Hildenbrand wrote: >> We want to m

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 12:38, Ryan Roberts a écrit : > On 23/01/2024 11:31, David Hildenbrand wrote: > If high bits are used for > something else, then we might produce a garbage PTE on overflow, but that > shouldn't really matter I concluded for folio_pte_batch() purposes, we'd >

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread David Hildenbrand
On 23.01.24 12:48, Christophe Leroy wrote: Le 23/01/2024 à 12:38, Ryan Roberts a écrit : On 23/01/2024 11:31, David Hildenbrand wrote: If high bits are used for something else, then we might produce a garbage PTE on overflow, but that shouldn't really matter I concluded for folio_pte_batch(

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Matthew Wilcox
On Tue, Jan 23, 2024 at 10:34:21AM +, Ryan Roberts wrote: > > +#define PFN_PTE_SHIFT PAGE_SHIFT > > I think this is buggy. And so is the arm64 implementation of set_ptes(). It > works fine for 48-bit output address, but for 52-bit OAs, the high bits are > not > kept contigously,

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Ryan Roberts
On 23/01/2024 15:01, Matthew Wilcox wrote: > On Tue, Jan 23, 2024 at 10:34:21AM +, Ryan Roberts wrote: >>> +#define PFN_PTE_SHIFT PAGE_SHIFT >> >> I think this is buggy. And so is the arm64 implementation of set_ptes(). It >> works fine for 48-bit output address, but for 52-bit OAs

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Aneesh Kumar K . V
David Hildenbrand writes: > On 23.01.24 12:38, Ryan Roberts wrote: >> On 23/01/2024 11:31, David Hildenbrand wrote: > >> If high bits are used for >> something else, then we might produce a garbage PTE on overflow, but that >> shouldn't really matter I concluded for folio_pte_batc

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Aneesh Kumar K . V
David Hildenbrand writes: >>> If high bits are used for something else, then we might produce a garbage PTE on overflow, but that shouldn't really matter I concluded for folio_pte_batch() purposes, we'd not detect "belongs to this folio batch" either way. >>> >>> Exactly