linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Chris Metcalf <cmetcalf@mellanox.com>
Cc: linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [PATCH] tile: handle RO_AFTER_INIT_DATA
Date: Tue, 8 Nov 2016 08:15:43 +0100	[thread overview]
Message-ID: <20161108071543.GA3528@osiris> (raw)
In-Reply-To: <1478548227-3476-1-git-send-email-cmetcalf@mellanox.com>

On Mon, Nov 07, 2016 at 02:50:27PM -0500, Chris Metcalf wrote:
> This is the minimal change to handle RO_AFTER_INIT_DATA.
> The tile architecture already marks RO_DATA as read-only in
> the kernel, so grouping RO_AFTER_INIT_DATA with RO_DATA, as is
> done by default, means the kernel faults in init when it tries
> to write to RO_AFTER_INIT_DATA.  For now, just move it past the
> end of the RODATA section so it is not specially treated.
> ---
> This is just to fix 4.9; I will post a more complete fix shortly
> targeting 4.10.
> 
>  arch/tile/kernel/vmlinux.lds.S | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/tile/kernel/vmlinux.lds.S b/arch/tile/kernel/vmlinux.lds.S
> index e1baf094fba4..dcd7445c31a2 100644
> --- a/arch/tile/kernel/vmlinux.lds.S
> +++ b/arch/tile/kernel/vmlinux.lds.S
> @@ -1,3 +1,6 @@
> +/* Handle ro_after_init data on our own. */
> +#define RO_AFTER_INIT_DATA
> +
>  #include <asm-generic/vmlinux.lds.h>
>  #include <asm/page.h>
>  #include <asm/cache.h>
> @@ -87,6 +90,7 @@ SECTIONS
> 
>    _sdata = .;                   /* Start of data section */
>    RO_DATA_SECTION(PAGE_SIZE)
> +  RO_AFTER_INIT_DATA
>    RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
>    _edata = .;

imho, the minimal fix would be to just

#define __ro_after_init __read_mostly

within arch/tile/include/asm/cache.h. That's also what parisc currently
has.

  reply	other threads:[~2016-11-08  7:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 19:50 [PATCH] tile: handle RO_AFTER_INIT_DATA Chris Metcalf
2016-11-08  7:15 ` Heiko Carstens [this message]
2016-11-14 20:29   ` [PATCH v2] tile: handle __ro_after_init like parisc does Chris Metcalf
2016-11-14 21:12     ` Kees Cook
2016-11-15  7:41       ` Heiko Carstens

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=20161108071543.GA3528@osiris \
    --to=heiko.carstens@de.ibm.com \
    --cc=cmetcalf@mellanox.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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;
as well as URLs for NNTP newsgroup(s).