linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the risc-v-fixes tree with Linus' tree
@ 2022-09-15 22:05 Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2022-09-15 22:05 UTC (permalink / raw)
  To: Palmer Dabbelt, Paul Walmsley
  Cc: Linux Kernel Mailing List, Linux Next Mailing List,
	Palmer Dabbelt, Steven Price, Vladimir Isaev, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 2459 bytes --]

Hi all,

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

  arch/riscv/mm/pageattr.c

between commit:

  8782fb61cc84 ("mm: pagewalk: Fix race between unmap and page walker")

from Linus' tree and commit:

  92c5738923f9 ("riscv: Fix permissions for all mm's during mm init")

from the risc-v-fixes tree.

I fixed it up (I think - 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/mm/pageattr.c
index 86c56616e5de,74b8107ac743..000000000000
--- a/arch/riscv/mm/pageattr.c
+++ b/arch/riscv/mm/pageattr.c
@@@ -115,6 -115,55 +115,55 @@@ static int __set_memory_mm(struct mm_st
  		.clear_mask = clear_mask
  	};
  
 -	mmap_read_lock(mm);
++	mmap_write_lock(mm);
+ 	ret = walk_page_range_novma(mm, start, end, &pageattr_ops, NULL,
+ 				    &masks);
 -	mmap_read_unlock(mm);
++	mmap_write_unlock(mm);
+ 
+ 	return ret;
+ }
+ 
+ void fix_kernel_mem_early(char *startp, char *endp, pgprot_t set_mask,
+ 			  pgprot_t clear_mask)
+ {
+ 	struct task_struct *t, *s;
+ 
+ 	unsigned long start = (unsigned long)startp;
+ 	unsigned long end = PAGE_ALIGN((unsigned long)endp);
+ 
+ 	/*
+ 	 * In the SYSTEM_FREEING_INITMEM state we expect that all async code
+ 	 * is done and no new userspace task can be created.
+ 	 * So rcu_read_lock() should be enough here.
+ 	 */
+ 	WARN_ON(system_state != SYSTEM_FREEING_INITMEM);
+ 
+ 	__set_memory_mm(current->active_mm, start, end, set_mask, clear_mask);
+ 	__set_memory_mm(&init_mm, start, end, set_mask, clear_mask);
+ 
+ 	rcu_read_lock();
+ 	for_each_process(t) {
+ 		if (t->flags & PF_KTHREAD)
+ 			continue;
+ 		for_each_thread(t, s) {
+ 			if (s->mm) {
+ 				__set_memory_mm(s->mm, start, end, set_mask,
+ 						clear_mask);
+ 			}
+ 		}
+ 	}
+ 	rcu_read_unlock();
+ 
+ 	flush_tlb_kernel_range(start, end);
+ }
+ 
+ static int __set_memory(unsigned long addr, int numpages, pgprot_t set_mask,
+ 			pgprot_t clear_mask)
+ {
+ 	int ret;
+ 	unsigned long start = addr;
+ 	unsigned long end = start + PAGE_SIZE * numpages;
+ 
  	if (!numpages)
  		return 0;
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* linux-next: manual merge of the risc-v-fixes tree with Linus' tree
@ 2019-09-25 17:14 Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2019-09-25 17:14 UTC (permalink / raw)
  To: Mike Rapoport, Palmer Dabbelt, Paul Walmsley
  Cc: Linux Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

Hi all,

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

  arch/riscv/include/asm/pgtable.h

between commit:

  782de70c42930ba ("mm: consolidate pgtable_cache_init() and pgd_cache_init()")

from Linus' tree and commit:

  b6f2b2e600a27b7 ("RISC-V: Fix building error when CONFIG_SPARSEMEM_MANUAL=y")

from the risc-v-fixes 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 c60123f018f50,4f4162d90586d..0000000000000
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@@ -424,18 -436,11 +436,6 @@@ extern void *dtb_early_va
  extern void setup_bootmem(void);
  extern void paging_init(void);
  
- #define VMALLOC_SIZE     (KERN_VIRT_SIZE >> 1)
- #define VMALLOC_END      (PAGE_OFFSET - 1)
- #define VMALLOC_START    (PAGE_OFFSET - VMALLOC_SIZE)
- 
- #define FIXADDR_TOP      VMALLOC_START
- #ifdef CONFIG_64BIT
- #define FIXADDR_SIZE     PMD_SIZE
- #else
- #define FIXADDR_SIZE     PGDIR_SIZE
- #endif
- #define FIXADDR_START    (FIXADDR_TOP - FIXADDR_SIZE)
 -static inline void pgtable_cache_init(void)
 -{
 -	/* No page table caches to initialize */
 -}
--
  /*
   * Task size is 0x4000000000 for RV64 or 0x9fc00000 for RV32.
   * Note that PGDIR_SIZE must evenly divide TASK_SIZE.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-15 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 22:05 linux-next: manual merge of the risc-v-fixes tree with Linus' tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 17:14 Mark Brown

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).