diff mbox series

[v3,05/34] c6x: mm: Add p?d_large() definitions

Message ID 20190227170608.27963-6-steven.price@arm.com (mailing list archive)
State New, archived
Headers show
Series Convert x86 & arm64 to use generic page walk | expand

Commit Message

Steven Price Feb. 27, 2019, 5:05 p.m. UTC
walk_page_range() is going to be allowed to walk page tables other than
those of user space. For this it needs to know when it has reached a
'leaf' entry in the page tables. This information is provided by the
p?d_large() functions/macros.

For c6x there's no MMU so there's never a large page, so just add stubs.

CC: Mark Salter <msalter@redhat.com>
CC: Aurelien Jacquiot <jacquiot.aurelien@gmail.com>
CC: linux-c6x-dev@linux-c6x.org
Signed-off-by: Steven Price <steven.price@arm.com>
---
 arch/c6x/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kirill A . Shutemov March 1, 2019, 9:48 p.m. UTC | #1
On Wed, Feb 27, 2019 at 05:05:39PM +0000, Steven Price wrote:
> walk_page_range() is going to be allowed to walk page tables other than
> those of user space. For this it needs to know when it has reached a
> 'leaf' entry in the page tables. This information is provided by the
> p?d_large() functions/macros.
> 
> For c6x there's no MMU so there's never a large page, so just add stubs.

Other option would be to provide the stubs via generic headers form !MMU.
Steven Price March 4, 2019, 12:01 p.m. UTC | #2
On 01/03/2019 21:48, Kirill A. Shutemov wrote:
> On Wed, Feb 27, 2019 at 05:05:39PM +0000, Steven Price wrote:
>> walk_page_range() is going to be allowed to walk page tables other than
>> those of user space. For this it needs to know when it has reached a
>> 'leaf' entry in the page tables. This information is provided by the
>> p?d_large() functions/macros.
>>
>> For c6x there's no MMU so there's never a large page, so just add stubs.
> 
> Other option would be to provide the stubs via generic headers form !MMU.
> 

I agree that could be done, but equally the definitions of
p?d_present/p?d_none/p?d_bad etc could be provided by a generic header
for !MMU but currently are not. It makes sense to keep the p?d_large
definitions next to the others.

I'd prefer to stick with a (relatively) small change here - it's already
quite a long series! But this is certainly something that could be
tidied up for !MMU archs.

Steve
Kirill A . Shutemov March 4, 2019, 1:11 p.m. UTC | #3
On Mon, Mar 04, 2019 at 12:01:37PM +0000, Steven Price wrote:
> On 01/03/2019 21:48, Kirill A. Shutemov wrote:
> > On Wed, Feb 27, 2019 at 05:05:39PM +0000, Steven Price wrote:
> >> walk_page_range() is going to be allowed to walk page tables other than
> >> those of user space. For this it needs to know when it has reached a
> >> 'leaf' entry in the page tables. This information is provided by the
> >> p?d_large() functions/macros.
> >>
> >> For c6x there's no MMU so there's never a large page, so just add stubs.
> > 
> > Other option would be to provide the stubs via generic headers form !MMU.
> > 
> 
> I agree that could be done, but equally the definitions of
> p?d_present/p?d_none/p?d_bad etc could be provided by a generic header
> for !MMU but currently are not. It makes sense to keep the p?d_large
> definitions next to the others.
> 
> I'd prefer to stick with a (relatively) small change here - it's already
> quite a long series! But this is certainly something that could be
> tidied up for !MMU archs.

Agreed.
diff mbox series

Patch

diff --git a/arch/c6x/include/asm/pgtable.h b/arch/c6x/include/asm/pgtable.h
index ec4db6df5e0d..d532b7df9001 100644
--- a/arch/c6x/include/asm/pgtable.h
+++ b/arch/c6x/include/asm/pgtable.h
@@ -26,6 +26,7 @@ 
 #define pgd_present(pgd)	(1)
 #define pgd_none(pgd)		(0)
 #define pgd_bad(pgd)		(0)
+#define pgd_large(pgd)		(0)
 #define pgd_clear(pgdp)
 #define kern_addr_valid(addr) (1)
 
@@ -34,6 +35,7 @@ 
 #define pmd_present(x)		(pmd_val(x))
 #define pmd_clear(xp)		do { set_pmd(xp, __pmd(0)); } while (0)
 #define pmd_bad(x)		(pmd_val(x) & ~PAGE_MASK)
+#define pmd_large(pgd)		(0)
 
 #define PAGE_NONE		__pgprot(0)    /* these mean nothing to NO_MM */
 #define PAGE_SHARED		__pgprot(0)    /* these mean nothing to NO_MM */