Skip to content

Commit 2e3f0ab

Browse files
committed
parisc: Fix pmd code to depend on PT_NLEVELS value, not on CONFIG_64BIT
Make the code which sets up the pmd depend on PT_NLEVELS == 3, not on CONFIG_64BIT. The reason is, that a 64bit kernel with a page size greater than 4k doesn't need the pmd and thus has PT_NLEVELS = 2. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 0e0da48 commit 2e3f0ab

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arch/parisc/include/asm/pgalloc.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
2626

2727
if (likely(pgd != NULL)) {
2828
memset(pgd, 0, PAGE_SIZE<<PGD_ALLOC_ORDER);
29-
#ifdef CONFIG_64BIT
29+
#if PT_NLEVELS == 3
3030
actual_pgd += PTRS_PER_PGD;
3131
/* Populate first pmd with allocated memory. We mark it
3232
* with PxD_FLAG_ATTACHED as a signal to the system that this
@@ -45,7 +45,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
4545

4646
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
4747
{
48-
#ifdef CONFIG_64BIT
48+
#if PT_NLEVELS == 3
4949
pgd -= PTRS_PER_PGD;
5050
#endif
5151
free_pages((unsigned long)pgd, PGD_ALLOC_ORDER);
@@ -72,7 +72,6 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
7272

7373
static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
7474
{
75-
#ifdef CONFIG_64BIT
7675
if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
7776
/*
7877
* This is the permanent pmd attached to the pgd;
@@ -82,7 +81,6 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
8281
*/
8382
mm_inc_nr_pmds(mm);
8483
return;
85-
#endif
8684
free_pages((unsigned long)pmd, PMD_ORDER);
8785
}
8886

@@ -104,7 +102,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
104102
static inline void
105103
pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
106104
{
107-
#ifdef CONFIG_64BIT
105+
#if PT_NLEVELS == 3
108106
/* preserve the gateway marker if this is the beginning of
109107
* the permanent pmd */
110108
if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)

0 commit comments

Comments
 (0)