From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 1/4] arm64: Add CONFIG_DEBUG_SET_MODULE_RONX support
Date: Wed, 4 Jun 2014 19:00:26 +0100 [thread overview]
Message-ID: <20140604180026.GC27881@arm.com> (raw)
In-Reply-To: <538E6EC2.5000004@codeaurora.org>
On Wed, Jun 04, 2014 at 01:56:34AM +0100, Laura Abbott wrote:
> On 6/3/2014 8:22 AM, Will Deacon wrote:
> >> +int set_memory_ro(unsigned long addr, int numpages)
> >> +{
> >> + return change_memory_set_bit(addr, numpages, __pgprot(PTE_RDONLY));
> >> +}
> >> +EXPORT_SYMBOL_GPL(set_memory_ro);
> >> +
> >> +int set_memory_rw(unsigned long addr, int numpages)
> >> +{
> >> + return change_memory_clear_bit(addr, numpages, __pgprot(PTE_RDONLY));
> >> +}
> >> +EXPORT_SYMBOL_GPL(set_memory_rw);
> >
> > I'm slightly worried about the interaction with this and PTE_WRITE (see
> > linux-next). If the kernel pages are marked as PTE_DIRTY | PTE_WRITE, then
> > setting read-only is a weird contradiction. Can you take PTE_WRITE into
> > account for these two please?
> >
>
> It sounds like the solution should be to set/clear PTE_WRITE as appropriate
> here, is my understanding correct?
You got it! You can look at set_pte_at if you're unsure (bearing in mind
that kernel mappings are always dirty).
Will
next prev parent reply other threads:[~2014-06-04 18:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 20:57 [PATCHv2 0/4] Page protections for arm64 Laura Abbott
2014-06-02 20:57 ` [PATCHv2 1/4] arm64: Add CONFIG_DEBUG_SET_MODULE_RONX support Laura Abbott
2014-06-03 15:22 ` Will Deacon
2014-06-03 15:31 ` Steve Capper
2014-06-03 15:37 ` Will Deacon
2014-06-03 16:04 ` Steve Capper
2014-06-04 0:56 ` Laura Abbott
2014-06-04 18:00 ` Will Deacon [this message]
2014-06-02 20:57 ` [PATCHv2 2/4] arm64: Treat handle_arch_irq as a function pointer Laura Abbott
2014-06-03 9:13 ` Mark Rutland
2014-06-03 9:36 ` Ard Biesheuvel
2014-06-02 20:57 ` [PATCHv2 3/4] arm64: Switch to ldr for loading the stub vectors Laura Abbott
2014-06-03 15:22 ` Will Deacon
2014-06-02 20:57 ` [PATCHv2 4/4] arm64: add better page protections to arm64 Laura Abbott
2014-06-03 16:04 ` Steve Capper
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=20140604180026.GC27881@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).