mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	Steven Price <steven.price@arm.com>,
	Vladimir Isaev <vladimir.isaev@syntacore.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: linux-next: manual merge of the risc-v-fixes tree with Linus' tree
Date: Fri, 16 Sep 2022 08:05:10 +1000	[thread overview]
Message-ID: <20220916080510.359a8e3a@canb.auug.org.au> (raw)

[-- 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 --]

             reply	other threads:[~2022-09-15 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 22:05 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 17:14 Mark Brown

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=20220916080510.359a8e3a@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=steven.price@arm.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vladimir.isaev@syntacore.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®