All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Shixin <liushixin2@huawei.com>
To: Palmer Dabbelt <palmerdabbelt@google.com>
Cc: Guo Ren <guoren@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Anup Patel <Anup.Patel@wdc.com>,
	<linux-riscv@lists.infradead.org>
Subject: [PATCH -next 1/2] mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge
Date: Wed, 16 Jun 2021 10:38:32 +0800	[thread overview]
Message-ID: <20210616023833.92471-1-liushixin2@huawei.com> (raw)
In-Reply-To: <mhng-0e961c64-341d-4a36-863f-1eec0778a0eb@palmerdabbelt-glaptop>

From: Christophe Leroy <christophe.leroy@csgroup.eu>

For architectures with no PMD and/or no PUD, add stubs similar to what we
have for architectures without P4D.

Link: https://lkml.kernel.org/r/5ac5976419350e8e048d463a64cae449eb3ba4b0.1620795204.git.christophe.leroy@csgroup.eu
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Uladzislau Rezki <uladzislau.rezki@sony.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/linux/pgtable.h | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
index 46b13780c2c8..d41474a2d255 100644
--- a/include/linux/pgtable.h
+++ b/include/linux/pgtable.h
@@ -1371,10 +1371,34 @@ static inline int p4d_clear_huge(p4d_t *p4d)
 }
 #endif /* !__PAGETABLE_P4D_FOLDED */
 
+#ifndef __PAGETABLE_PUD_FOLDED
 int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot);
-int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);
 int pud_clear_huge(pud_t *pud);
+#else
+static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
+{
+	return 0;
+}
+static inline int pud_clear_huge(pud_t *pud)
+{
+	return 0;
+}
+#endif /* !__PAGETABLE_PUD_FOLDED */
+
+#ifndef __PAGETABLE_PMD_FOLDED
+int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);
 int pmd_clear_huge(pmd_t *pmd);
+#else
+static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
+{
+	return 0;
+}
+static inline int pmd_clear_huge(pmd_t *pmd)
+{
+	return 0;
+}
+#endif /* !__PAGETABLE_PMD_FOLDED */
+
 int p4d_free_pud_page(p4d_t *p4d, unsigned long addr);
 int pud_free_pmd_page(pud_t *pud, unsigned long addr);
 int pmd_free_pte_page(pmd_t *pmd, unsigned long addr);
-- 
2.18.0.huawei.25


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2021-06-16  2:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06 15:20 rebased ASID-based tlbflush Christoph Hellwig
2021-06-06 15:20 ` [PATCH 1/2] riscv: pass the mm_struct to __sbi_tlb_flush_range Christoph Hellwig
2021-06-06 16:43   ` Guo Ren
2021-06-06 15:20 ` [PATCH 2/2] riscv: add ASID-based tlbflushing methods Christoph Hellwig
2021-06-06 16:49   ` Guo Ren
2021-06-13  0:47 ` rebased ASID-based tlbflush Palmer Dabbelt
2021-06-13 13:08   ` Guo Ren
2021-06-15 11:20     ` Liu Shixin
2021-06-15 15:10       ` Palmer Dabbelt
2021-06-15 15:22         ` Guo Ren
2021-06-16  2:38         ` Liu Shixin [this message]
2021-06-16  2:38           ` [PATCH -next 2/2] riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT Liu Shixin
2021-06-13  9:31 ` rebased ASID-based tlbflush Guo Ren

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=20210616023833.92471-1-liushixin2@huawei.com \
    --to=liushixin2@huawei.com \
    --cc=Anup.Patel@wdc.com \
    --cc=guoren@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmerdabbelt@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.