From: Mike Rapoport <rppt@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Dinh Nguyen <dinguyen@kernel.org>,
Guo Ren <guoren@kernel.org>, Helge Deller <deller@gmx.de>,
Huacai Chen <chenhuacai@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Matthew Wilcox <willy@infradead.org>,
Max Filippov <jcmvbkbc@gmail.com>,
Mike Rapoport <rppt@kernel.org>,
Mike Rapoport <rppt@linux.ibm.com>,
"Russell King (Oracle)" <linux@armlinux.org.uk>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
WANG Xuerui <kernel@xen0n.name>,
linux-arch@vger.kernel.org, linux-csky@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
linux-mm@kvack.org, linux-parisc@vger.kernel.org,
linux-xtensa@linux-xtensa.org, loongarch@lists.linux.dev
Subject: [PATCH v2 09/15] loongarch: drop definition of PTE_ORDER
Date: Tue, 5 Jul 2022 18:47:02 +0300 [thread overview]
Message-ID: <20220705154708.181258-10-rppt@kernel.org> (raw)
In-Reply-To: <20220705154708.181258-1-rppt@kernel.org>
From: Mike Rapoport <rppt@linux.ibm.com>
This is the order of the page table allocation, not the order of a PTE.
Since its always hardwired to 0, simply drop it.
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Huacai Chen <chenhuacai@kernel.org>
---
arch/loongarch/include/asm/pgtable.h | 9 ++++-----
arch/loongarch/kernel/asm-offsets.c | 1 -
arch/loongarch/mm/tlbex.S | 6 +++---
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h
index d9e86cfa53e2..e0bbfc31fe72 100644
--- a/arch/loongarch/include/asm/pgtable.h
+++ b/arch/loongarch/include/asm/pgtable.h
@@ -24,17 +24,16 @@
#define PGD_ORDER 0
#define PUD_ORDER 0
#define PMD_ORDER 0
-#define PTE_ORDER 0
#if CONFIG_PGTABLE_LEVELS == 2
-#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
+#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3))
#elif CONFIG_PGTABLE_LEVELS == 3
-#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
+#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3))
#define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE-1))
#define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))
#elif CONFIG_PGTABLE_LEVELS == 4
-#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3))
+#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3))
#define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE-1))
#define PUD_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3))
@@ -55,7 +54,7 @@
#if CONFIG_PGTABLE_LEVELS > 2
#define PTRS_PER_PMD ((PAGE_SIZE << PMD_ORDER) >> 3)
#endif
-#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) >> 3)
+#define PTRS_PER_PTE (PAGE_SIZE >> 3)
#define USER_PTRS_PER_PGD ((TASK_SIZE64 / PGDIR_SIZE)?(TASK_SIZE64 / PGDIR_SIZE):1)
diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/asm-offsets.c
index bfb65eb2844f..1a1166a7e61c 100644
--- a/arch/loongarch/kernel/asm-offsets.c
+++ b/arch/loongarch/kernel/asm-offsets.c
@@ -194,7 +194,6 @@ void output_mm_defines(void)
#ifndef __PAGETABLE_PMD_FOLDED
DEFINE(_PMD_ORDER, PMD_ORDER);
#endif
- DEFINE(_PTE_ORDER, PTE_ORDER);
BLANK();
DEFINE(_PMD_SHIFT, PMD_SHIFT);
DEFINE(_PGDIR_SHIFT, PGDIR_SHIFT);
diff --git a/arch/loongarch/mm/tlbex.S b/arch/loongarch/mm/tlbex.S
index 7eee40271577..e36c2c07dee3 100644
--- a/arch/loongarch/mm/tlbex.S
+++ b/arch/loongarch/mm/tlbex.S
@@ -83,7 +83,7 @@ vmalloc_done_load:
bne t0, $r0, tlb_huge_update_load
csrrd t0, LOONGARCH_CSR_BADV
- srli.d t0, t0, (PAGE_SHIFT + PTE_ORDER)
+ srli.d t0, t0, PAGE_SHIFT
andi t0, t0, (PTRS_PER_PTE - 1)
slli.d t0, t0, _PTE_T_LOG2
add.d t1, ra, t0
@@ -247,7 +247,7 @@ vmalloc_done_store:
bne t0, $r0, tlb_huge_update_store
csrrd t0, LOONGARCH_CSR_BADV
- srli.d t0, t0, (PAGE_SHIFT + PTE_ORDER)
+ srli.d t0, t0, PAGE_SHIFT
andi t0, t0, (PTRS_PER_PTE - 1)
slli.d t0, t0, _PTE_T_LOG2
add.d t1, ra, t0
@@ -414,7 +414,7 @@ vmalloc_done_modify:
bne t0, $r0, tlb_huge_update_modify
csrrd t0, LOONGARCH_CSR_BADV
- srli.d t0, t0, (PAGE_SHIFT + PTE_ORDER)
+ srli.d t0, t0, PAGE_SHIFT
andi t0, t0, (PTRS_PER_PTE - 1)
slli.d t0, t0, _PTE_T_LOG2
add.d t1, ra, t0
--
2.34.1
next prev parent reply other threads:[~2022-07-05 15:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 15:46 [PATCH v2 00/15] arch: make PxD_ORDER generically available Mike Rapoport
2022-07-05 15:46 ` [PATCH v2 01/15] csky: drop definition of PTE_ORDER Mike Rapoport
2022-07-05 15:46 ` [PATCH v2 02/15] csky: drop definition of PGD_ORDER Mike Rapoport
2022-07-05 15:46 ` [PATCH v2 03/15] mips: Rename PMD_ORDER to PMD_TABLE_ORDER Mike Rapoport
2022-07-05 15:46 ` [PATCH v2 04/15] mips: Rename PUD_ORDER to PUD_TABLE_ORDER Mike Rapoport
2022-07-05 15:46 ` [PATCH v2 05/15] mips: drop definitions of PTE_ORDER Mike Rapoport
2022-07-05 15:46 ` [PATCH v2 06/15] mips: Rename PGD_ORDER to PGD_TABLE_ORDER Mike Rapoport
2022-07-05 15:47 ` [PATCH v2 07/15] nios2: drop definition of PTE_ORDER Mike Rapoport
2022-07-11 22:55 ` Dinh Nguyen
2022-07-05 15:47 ` [PATCH v2 08/15] nios2: drop definition of PGD_ORDER Mike Rapoport
2022-07-11 22:55 ` Dinh Nguyen
2022-07-05 15:47 ` Mike Rapoport [this message]
2022-07-05 15:47 ` [PATCH v2 10/15] loongarch: drop definition of PMD_ORDER Mike Rapoport
2022-07-05 15:47 ` [PATCH v2 11/15] loongarch: drop definition of PUD_ORDER Mike Rapoport
2022-07-05 15:47 ` [PATCH v2 12/15] loongarch: drop definition of PGD_ORDER Mike Rapoport
2022-07-05 15:47 ` [PATCH v2 13/15] parisc: Rename PGD_ORDER to PGD_TABLE_ORDER Mike Rapoport
2022-07-05 15:47 ` [PATCH v2 14/15] xtensa: drop definition of PGD_ORDER Mike Rapoport
2022-07-05 16:03 ` Max Filippov
2022-07-05 15:47 ` [PATCH v2 15/15] ARM: head.S: rename PMD_ORDER to PMD_ENTRY_ORDER Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220705154708.181258-10-rppt@kernel.org \
--to=rppt@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=deller@gmx.de \
--cc=dinguyen@kernel.org \
--cc=guoren@kernel.org \
--cc=jcmvbkbc@gmail.com \
--cc=kernel@xen0n.name \
--cc=linux-arch@vger.kernel.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=linux@armlinux.org.uk \
--cc=loongarch@lists.linux.dev \
--cc=rppt@linux.ibm.com \
--cc=tsbogend@alpha.franken.de \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).