linux-next: manual merge of the risc-v tree with the mm tree

From: Stephen Rothwell
Date: Thu Apr 03 2025 - 19:55:01 EST


Hi all,

Today's linux-next merge of the risc-v tree got a conflict in:

arch/riscv/include/asm/pgtable.h

between commit:

012d57e6ee75 ("mm: introduce a common definition of mk_pte()")

from the mm tree and commit:

03dc00a2b678 ("riscv: Support huge pfnmaps")

from the risc-v tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc arch/riscv/include/asm/pgtable.h
index 293a7776fe07,428e48e5f57d..000000000000
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@@ -339,6 -343,16 +343,14 @@@ static inline pte_t pfn_pte(unsigned lo
return __pte((pfn << _PAGE_PFN_SHIFT) | prot_val);
}

-#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
-
+ #define pte_pgprot pte_pgprot
+ static inline pgprot_t pte_pgprot(pte_t pte)
+ {
+ unsigned long pfn = pte_pfn(pte);
+
+ return __pgprot(pte_val(pfn_pte(pfn, __pgprot(0))) ^ pte_val(pte));
+ }
+
static inline int pte_present(pte_t pte)
{
return (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROT_NONE));

Attachment: pgpOQGkZXBojL.pgp
Description: OpenPGP digital signature