Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbbKIQym (ORCPT ); Mon, 9 Nov 2015 11:54:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34899 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbbKIQyj (ORCPT ); Mon, 9 Nov 2015 11:54:39 -0500 Date: Mon, 9 Nov 2015 10:54:38 -0600 From: Josh Poimboeuf To: Rusty Russell Cc: linux-kernel@vger.kernel.org, Peter Zijlstra Subject: Re: [PATCH 3/4] module: use a structure to encapsulate layout. Message-ID: <20151109165438.GA3914@treble.redhat.com> References: <1447043037-10833-1-git-send-email-rusty@rustcorp.com.au> <1447043037-10833-4-git-send-email-rusty@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1447043037-10833-4-git-send-email-rusty@rustcorp.com.au> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2459 Lines: 67 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 -- Josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/