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

Stephen Rothwell posted 1 patch 10 months, 1 week ago
linux-next: manual merge of the risc-v tree with the mm tree
Posted by Stephen Rothwell 10 months, 1 week ago
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));
Re: linux-next: manual merge of the risc-v tree with the mm tree
Posted by Stephen Rothwell 10 months ago
Hi all,

On Fri, 4 Apr 2025 10:54:40 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> 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.
> 
> 
> 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));


This is now a conflict between the mm tree and Linus' tree.
-- 
Cheers,
Stephen Rothwell