diff mbox series

[RFC,3/9] sh/mm: Make pmd_t similar to pte_t

Message ID 20201130113602.959570640@infradead.org (mailing list archive)
State New
Headers show
Series Clean up i386-PAE | expand

Commit Message

Peter Zijlstra Nov. 30, 2020, 11:27 a.m. UTC
Just like 64bit pte_t, have a low/high split in pmd_t.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/sh/include/asm/pgtable-3level.h |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

David Laight Nov. 30, 2020, 2:10 p.m. UTC | #1
From: Peter Zijlstra
> Sent: 30 November 2020 11:27
> 
> Just like 64bit pte_t, have a low/high split in pmd_t.
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  arch/sh/include/asm/pgtable-3level.h |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> --- a/arch/sh/include/asm/pgtable-3level.h
> +++ b/arch/sh/include/asm/pgtable-3level.h
> @@ -28,9 +28,15 @@
>  #define pmd_ERROR(e) \
>  	printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))
> 
> -typedef struct { unsigned long long pmd; } pmd_t;
> +typedef struct {
> +	struct {
> +		unsigned long pmd_low;
> +		unsigned long pmd_high;
> +	};
> +	unsigned long long pmd;
> +} pmd_t;

Would it be better to use u32 and u64?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Peter Zijlstra Nov. 30, 2020, 2:21 p.m. UTC | #2
On Mon, Nov 30, 2020 at 02:10:42PM +0000, David Laight wrote:
> From: Peter Zijlstra
> > Sent: 30 November 2020 11:27
> > 
> > Just like 64bit pte_t, have a low/high split in pmd_t.
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> >  arch/sh/include/asm/pgtable-3level.h |   10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > --- a/arch/sh/include/asm/pgtable-3level.h
> > +++ b/arch/sh/include/asm/pgtable-3level.h
> > @@ -28,9 +28,15 @@
> >  #define pmd_ERROR(e) \
> >  	printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))
> > 
> > -typedef struct { unsigned long long pmd; } pmd_t;
> > +typedef struct {
> > +	struct {
> > +		unsigned long pmd_low;
> > +		unsigned long pmd_high;
> > +	};
> > +	unsigned long long pmd;
> > +} pmd_t;
> 
> Would it be better to use u32 and u64?

That would be inconsistent with the rest of SH. If you want to go clean
up SH, have at, but that's not what this series is for.
diff mbox series

Patch

--- a/arch/sh/include/asm/pgtable-3level.h
+++ b/arch/sh/include/asm/pgtable-3level.h
@@ -28,9 +28,15 @@ 
 #define pmd_ERROR(e) \
 	printk("%s:%d: bad pmd %016llx.\n", __FILE__, __LINE__, pmd_val(e))
 
-typedef struct { unsigned long long pmd; } pmd_t;
+typedef struct {
+	struct {
+		unsigned long pmd_low;
+		unsigned long pmd_high;
+	};
+	unsigned long long pmd;
+} pmd_t;
 #define pmd_val(x)	((x).pmd)
-#define __pmd(x)	((pmd_t) { (x) } )
+#define __pmd(x)	((pmd_t) { .pmd = (x) } )
 
 static inline unsigned long pud_page_vaddr(pud_t pud)
 {