Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932361AbcLHNlm (ORCPT ); Thu, 8 Dec 2016 08:41:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43946 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752078AbcLHNll (ORCPT ); Thu, 8 Dec 2016 08:41:41 -0500 Date: Thu, 8 Dec 2016 21:41:36 +0800 From: Baoquan He To: kbuild test robot Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@redhat.com, x86@kernel.org, keescook@chromium.org, yinghai@kernel.org, bp@suse.de, thgarnie@google.com, kuleshovmail@gmail.com, luto@kernel.org, anderson@redhat.com, dyoung@redhat.com, xlpang@redhat.com Subject: Re: [PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at runtime Message-ID: <20161208134136.GA4087@x1> References: <1481183765-4166-3-git-send-email-bhe@redhat.com> <201612081759.GPvDNYoj%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612081759.GPvDNYoj%fengguang.wu@intel.com> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 08 Dec 2016 13:41:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10632 Lines: 183 Thanks, have changed. Will repost after i386 test is OK. On 12/08/16 at 05:41pm, kbuild test robot wrote: > Hi Baoquan, > > [auto build test ERROR on tip/x86/core] > [also build test ERROR on v4.9-rc8 next-20161208] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Baoquan-He/Determine-kernel-text-mapping-size-at-runtime-for-x86_64/20161208-172019 > config: x86_64-randconfig-x017-201649 (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: > # save the attached .config to linux build tree > make ARCH=x86_64 > > All error/warnings (new ones prefixed by >>): > > In file included from arch/x86/include/asm/page_types.h:47:0, > from arch/x86/include/asm/page.h:8, > from arch/x86/include/asm/thread_info.h:11, > from include/linux/thread_info.h:58, > from arch/x86/include/asm/preempt.h:6, > from include/linux/preempt.h:59, > from include/linux/spinlock.h:50, > from include/linux/seqlock.h:35, > from include/linux/time.h:5, > from include/uapi/linux/timex.h:56, > from include/linux/timex.h:56, > from include/linux/sched.h:19, > from arch/x86/kernel/setup.c:24: > arch/x86/kernel/setup.c: In function 'dump_kernel_offset': > arch/x86/include/asm/page_64_types.h:67:29: error: 'kernel_mapping_size' undeclared (first use in this function) > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > >> arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > #define MODULES_VADDR (__START_KERNEL_map + KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > >> include/linux/printk.h:271:35: note: in expansion of macro 'MODULES_VADDR' > printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) > ^~~~~~~~~~~ > >> arch/x86/kernel/setup.c:826:3: note: in expansion of macro 'pr_emerg' > pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n", > ^~~~~~~~ > arch/x86/include/asm/page_64_types.h:67:29: note: each undeclared identifier is reported only once for each function it appears in > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > >> arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > #define MODULES_VADDR (__START_KERNEL_map + KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > >> include/linux/printk.h:271:35: note: in expansion of macro 'MODULES_VADDR' > printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) > ^~~~~~~~~~~ > >> arch/x86/kernel/setup.c:826:3: note: in expansion of macro 'pr_emerg' > pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n", > ^~~~~~~~ > -- > In file included from include/uapi/linux/stddef.h:1:0, > from include/linux/stddef.h:4, > from include/uapi/linux/posix_types.h:4, > from include/uapi/linux/types.h:13, > from include/linux/types.h:5, > from include/linux/list.h:4, > from include/linux/module.h:9, > from include/linux/moduleloader.h:5, > from arch/x86/kernel/module.c:21: > arch/x86/kernel/module.c: In function 'module_alloc': > arch/x86/include/asm/page_64_types.h:67:29: error: 'kernel_mapping_size' undeclared (first use in this function) > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > include/linux/compiler.h:149:30: note: in definition of macro '__trace_if' > if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ > ^~~~ > >> arch/x86/kernel/module.c:83:2: note: in expansion of macro 'if' > if (PAGE_ALIGN(size) > MODULES_LEN) > ^~ > >> arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > #define MODULES_VADDR (__START_KERNEL_map + KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > >> arch/x86/include/asm/pgtable_64_types.h:71:38: note: in expansion of macro 'MODULES_VADDR' > #define MODULES_LEN (MODULES_END - MODULES_VADDR) > ^~~~~~~~~~~~~ > >> arch/x86/kernel/module.c:83:25: note: in expansion of macro 'MODULES_LEN' > if (PAGE_ALIGN(size) > MODULES_LEN) > ^~~~~~~~~~~ > arch/x86/include/asm/page_64_types.h:67:29: note: each undeclared identifier is reported only once for each function it appears in > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > include/linux/compiler.h:149:30: note: in definition of macro '__trace_if' > if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ > ^~~~ > >> arch/x86/kernel/module.c:83:2: note: in expansion of macro 'if' > if (PAGE_ALIGN(size) > MODULES_LEN) > ^~ > >> arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > #define MODULES_VADDR (__START_KERNEL_map + KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > >> arch/x86/include/asm/pgtable_64_types.h:71:38: note: in expansion of macro 'MODULES_VADDR' > #define MODULES_LEN (MODULES_END - MODULES_VADDR) > ^~~~~~~~~~~~~ > >> arch/x86/kernel/module.c:83:25: note: in expansion of macro 'MODULES_LEN' > if (PAGE_ALIGN(size) > MODULES_LEN) > ^~~~~~~~~~~ > -- > In file included from include/linux/linkage.h:4:0, > from include/linux/preempt.h:9, > from include/linux/spinlock.h:50, > from include/linux/mmzone.h:7, > from include/linux/bootmem.h:7, > from arch/x86/mm/physaddr.c:1: > arch/x86/mm/physaddr.c: In function '__virt_addr_valid': > arch/x86/include/asm/page_64_types.h:67:29: error: 'kernel_mapping_size' undeclared (first use in this function) > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > include/linux/compiler.h:149:30: note: in definition of macro '__trace_if' > if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ > ^~~~ > >> arch/x86/mm/physaddr.c:53:3: note: in expansion of macro 'if' > if (y >= KERNEL_MAPPING_SIZE) > ^~ > >> arch/x86/mm/physaddr.c:53:12: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > if (y >= KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > arch/x86/include/asm/page_64_types.h:67:29: note: each undeclared identifier is reported only once for each function it appears in > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > include/linux/compiler.h:149:30: note: in definition of macro '__trace_if' > if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ > ^~~~ > >> arch/x86/mm/physaddr.c:53:3: note: in expansion of macro 'if' > if (y >= KERNEL_MAPPING_SIZE) > ^~ > >> arch/x86/mm/physaddr.c:53:12: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > if (y >= KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > -- > In file included from arch/x86/include/asm/page_types.h:47:0, > from arch/x86/include/asm/page.h:8, > from arch/x86/include/asm/thread_info.h:11, > from include/linux/thread_info.h:58, > from arch/x86/include/asm/preempt.h:6, > from include/linux/preempt.h:59, > from include/linux/spinlock.h:50, > from include/linux/wait.h:8, > from include/linux/fs.h:5, > from include/linux/debugfs.h:18, > from arch/x86/mm/dump_pagetables.c:15: > arch/x86/mm/dump_pagetables.c: In function 'pt_dump_init': > arch/x86/include/asm/page_64_types.h:67:29: error: 'kernel_mapping_size' undeclared (first use in this function) > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > >> arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > #define MODULES_VADDR (__START_KERNEL_map + KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > >> arch/x86/mm/dump_pagetables.c:445:52: note: in expansion of macro 'MODULES_VADDR' > address_markers[MODULES_VADDR_NR].start_address = MODULES_VADDR; > ^~~~~~~~~~~~~ > arch/x86/include/asm/page_64_types.h:67:29: note: each undeclared identifier is reported only once for each function it appears in > #define KERNEL_MAPPING_SIZE kernel_mapping_size > ^ > >> arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro 'KERNEL_MAPPING_SIZE' > #define MODULES_VADDR (__START_KERNEL_map + KERNEL_MAPPING_SIZE) > ^~~~~~~~~~~~~~~~~~~ > >> arch/x86/mm/dump_pagetables.c:445:52: note: in expansion of macro 'MODULES_VADDR' > address_markers[MODULES_VADDR_NR].start_address = MODULES_VADDR; > ^~~~~~~~~~~~~ > > vim +/kernel_mapping_size +67 arch/x86/include/asm/page_64_types.h > > 61 * the next 1GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S). > 62 * Use 512MiB by default, leaving 1.5GiB for modules once the page tables > 63 * are fully set up. If kernel ASLR is configured, it can extend the > 64 * kernel page table mapping, reducing the size of the modules area. > 65 */ > 66 #define KERNEL_MAPPING_SIZE_EXT (1024 * 1024 * 1024) > > 67 #define KERNEL_MAPPING_SIZE kernel_mapping_size > 68 > 69 #endif /* _ASM_X86_PAGE_64_DEFS_H */ > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation