public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 3/4] module: use a structure to encapsulate layout.
Date: Mon, 9 Nov 2015 10:54:38 -0600	[thread overview]
Message-ID: <20151109165438.GA3914@treble.redhat.com> (raw)
In-Reply-To: <1447043037-10833-4-git-send-email-rusty@rustcorp.com.au>

On Mon, Nov 09, 2015 at 02:53:56PM +1030, Rusty Russell wrote:

> diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
> index b15933c31b2f..26e23a2a29e9 100644
> --- a/arch/ia64/kernel/module.c
> +++ b/arch/ia64/kernel/module.c
> @@ -486,13 +486,13 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
>  static inline int
>  in_init (const struct module *mod, uint64_t addr)
>  {
> -	return addr - (uint64_t) mod->module_init < mod->init_size;
> +	return addr - (uint64_t) mod->init_layout.base < mod->init_layout.size;
>  }
>  
>  static inline int
>  in_core (const struct module *mod, uint64_t addr)
>  {
> -	return addr - (uint64_t) mod->module_core < mod->core_size;
> +	return addr - (uint64_t) mod->corelayout.base < mod->core_layout.size;

s/corelayout/core_layout/

> diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c
> index d1d35ccffed3..2e4383c49ee2 100644
> --- a/arch/x86/kernel/livepatch.c
> +++ b/arch/x86/kernel/livepatch.c
> @@ -41,8 +41,8 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
>  	int ret, numpages, size = 4;
>  	bool readonly;
>  	unsigned long val;
> -	unsigned long core = (unsigned long)mod->module_core;
> -	unsigned long core_size = mod->core_size;
> +	unsigned long core = (unsigned long)mod->core_layout.base;
> +	unsigned long core_size = mod->core_layout.size;
>  
>  	switch (type) {
>  	case R_X86_64_NONE:
> @@ -65,7 +65,7 @@ int klp_write_module_reloc(struct module *mod, unsigned long type,
>  		return -EINVAL;
>  	}
>  
> -	if (loc < core || loc >= core + core_size)
> +	if (loc < core || loc >= core + core_layout.size)

No need to change this line (and in fact it fails the build).


I'm also seeing another build failure in linux-next, thanks to a patch
we just merged on Friday:

/home/jpoimboe/git/linux/arch/x86/kernel/livepatch.c: In function ‘klp_write_module_reloc’:
/home/jpoimboe/git/linux/arch/x86/kernel/livepatch.c:75:22: error: ‘struct module’ has no member named ‘core_ro_size’
  if (loc < core + mod->core_ro_size)
                        ^

Assuming the above build failures are fixed,

Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>


-- 
Josh

  parent reply	other threads:[~2015-11-09 16:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  4:23 [PATCH 0/4] module RO/NX cleanups Rusty Russell
2015-11-09  4:23 ` [PATCH 1/4] module: Use the same logic for setting and unsetting RO/NX Rusty Russell
2015-11-09  4:23 ` [PATCH 2/4] gcov: use within_module() helper Rusty Russell
2015-11-09  8:19   ` Peter Oberparleiter
2015-11-09  4:23 ` [PATCH 3/4] module: use a structure to encapsulate layout Rusty Russell
2015-11-09  9:41   ` Peter Zijlstra
2015-11-10  1:41     ` Rusty Russell
2015-11-09 16:54   ` Josh Poimboeuf [this message]
2015-11-09  4:23 ` [PATCH 4/4] module: clean up RO/NX handling Rusty Russell
2015-11-09 19:51   ` Josh Poimboeuf
2015-11-10  1:57     ` Rusty Russell
2015-11-10  4:27       ` Josh Poimboeuf
2015-11-12  1:28         ` Rusty Russell
2015-11-12  3:41           ` Josh Poimboeuf

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=20151109165438.GA3914@treble.redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    /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