All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: AliOS system security <alios_sys_security@linux.alibaba.com>,
	catalin.marinas@arm.com, will@kernel.org
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	AliOS system security <alios_sys_security@linux.alibaba.com>
Subject: Re: [PATCH] arm64: fix build error when use rodata_enabled
Date: Wed, 5 Jan 2022 18:22:29 +0800	[thread overview]
Message-ID: <202201051817.4KPMZJag-lkp@intel.com> (raw)
In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com>

Hi AliOS,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s032-20220105 (https://download.01.org/0day-ci/archive/20220105/202201051817.4KPMZJag-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/6af4245e93d33d4f4a79a560a707539be994f73e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
        git checkout 6af4245e93d33d4f4a79a560a707539be994f73e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
>> arch/arm64/mm/mmu.c:627:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     627 |         phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
         |         ^~~~~~~~~~~


vim +627 arch/arm64/mm/mmu.c

28b066da69b937 Ard Biesheuvel        2017-03-09  618  
51a0048beb4496 Will Deacon           2017-11-14  619  #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
51a0048beb4496 Will Deacon           2017-11-14  620  static int __init map_entry_trampoline(void)
51a0048beb4496 Will Deacon           2017-11-14  621  {
6af4245e93d33d AliOS system security 2022-01-05  622  	pgprot_t prot = PAGE_KERNEL_EXEC;
6af4245e93d33d AliOS system security 2022-01-05  623  #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
6af4245e93d33d AliOS system security 2022-01-05  624  	if (rodata_enabled)
6af4245e93d33d AliOS system security 2022-01-05  625  		prot = PAGE_KERNEL_ROX;
6af4245e93d33d AliOS system security 2022-01-05  626  #endif
51a0048beb4496 Will Deacon           2017-11-14 @627  	phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
51a0048beb4496 Will Deacon           2017-11-14  628  
51a0048beb4496 Will Deacon           2017-11-14  629  	/* The trampoline is always mapped and can therefore be global */
51a0048beb4496 Will Deacon           2017-11-14  630  	pgprot_val(prot) &= ~PTE_NG;
51a0048beb4496 Will Deacon           2017-11-14  631  
51a0048beb4496 Will Deacon           2017-11-14  632  	/* Map only the text into the trampoline page table */
51a0048beb4496 Will Deacon           2017-11-14  633  	memset(tramp_pg_dir, 0, PGD_SIZE);
51a0048beb4496 Will Deacon           2017-11-14  634  	__create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
475ba3fc194b64 Will Deacon           2019-04-08  635  			     prot, __pgd_pgtable_alloc, 0);
51a0048beb4496 Will Deacon           2017-11-14  636  
6c27c4082f4f70 Will Deacon           2017-12-06  637  	/* Map both the text and data into the kernel page table */
51a0048beb4496 Will Deacon           2017-11-14  638  	__set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
6c27c4082f4f70 Will Deacon           2017-12-06  639  	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
6c27c4082f4f70 Will Deacon           2017-12-06  640  		extern char __entry_tramp_data_start[];
6c27c4082f4f70 Will Deacon           2017-12-06  641  
6c27c4082f4f70 Will Deacon           2017-12-06  642  		__set_fixmap(FIX_ENTRY_TRAMP_DATA,
6c27c4082f4f70 Will Deacon           2017-12-06  643  			     __pa_symbol(__entry_tramp_data_start),
6c27c4082f4f70 Will Deacon           2017-12-06  644  			     PAGE_KERNEL_RO);
6c27c4082f4f70 Will Deacon           2017-12-06  645  	}
6c27c4082f4f70 Will Deacon           2017-12-06  646  
51a0048beb4496 Will Deacon           2017-11-14  647  	return 0;
51a0048beb4496 Will Deacon           2017-11-14  648  }
51a0048beb4496 Will Deacon           2017-11-14  649  core_initcall(map_entry_trampoline);
51a0048beb4496 Will Deacon           2017-11-14  650  #endif
51a0048beb4496 Will Deacon           2017-11-14  651  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] arm64: fix build error when use rodata_enabled
Date: Wed, 05 Jan 2022 18:22:29 +0800	[thread overview]
Message-ID: <202201051817.4KPMZJag-lkp@intel.com> (raw)
In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com>

[-- Attachment #1: Type: text/plain, Size: 5050 bytes --]

Hi AliOS,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s032-20220105 (https://download.01.org/0day-ci/archive/20220105/202201051817.4KPMZJag-lkp(a)intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/6af4245e93d33d4f4a79a560a707539be994f73e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
        git checkout 6af4245e93d33d4f4a79a560a707539be994f73e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
>> arch/arm64/mm/mmu.c:627:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     627 |         phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
         |         ^~~~~~~~~~~


vim +627 arch/arm64/mm/mmu.c

28b066da69b937 Ard Biesheuvel        2017-03-09  618  
51a0048beb4496 Will Deacon           2017-11-14  619  #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
51a0048beb4496 Will Deacon           2017-11-14  620  static int __init map_entry_trampoline(void)
51a0048beb4496 Will Deacon           2017-11-14  621  {
6af4245e93d33d AliOS system security 2022-01-05  622  	pgprot_t prot = PAGE_KERNEL_EXEC;
6af4245e93d33d AliOS system security 2022-01-05  623  #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
6af4245e93d33d AliOS system security 2022-01-05  624  	if (rodata_enabled)
6af4245e93d33d AliOS system security 2022-01-05  625  		prot = PAGE_KERNEL_ROX;
6af4245e93d33d AliOS system security 2022-01-05  626  #endif
51a0048beb4496 Will Deacon           2017-11-14 @627  	phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
51a0048beb4496 Will Deacon           2017-11-14  628  
51a0048beb4496 Will Deacon           2017-11-14  629  	/* The trampoline is always mapped and can therefore be global */
51a0048beb4496 Will Deacon           2017-11-14  630  	pgprot_val(prot) &= ~PTE_NG;
51a0048beb4496 Will Deacon           2017-11-14  631  
51a0048beb4496 Will Deacon           2017-11-14  632  	/* Map only the text into the trampoline page table */
51a0048beb4496 Will Deacon           2017-11-14  633  	memset(tramp_pg_dir, 0, PGD_SIZE);
51a0048beb4496 Will Deacon           2017-11-14  634  	__create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
475ba3fc194b64 Will Deacon           2019-04-08  635  			     prot, __pgd_pgtable_alloc, 0);
51a0048beb4496 Will Deacon           2017-11-14  636  
6c27c4082f4f70 Will Deacon           2017-12-06  637  	/* Map both the text and data into the kernel page table */
51a0048beb4496 Will Deacon           2017-11-14  638  	__set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
6c27c4082f4f70 Will Deacon           2017-12-06  639  	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
6c27c4082f4f70 Will Deacon           2017-12-06  640  		extern char __entry_tramp_data_start[];
6c27c4082f4f70 Will Deacon           2017-12-06  641  
6c27c4082f4f70 Will Deacon           2017-12-06  642  		__set_fixmap(FIX_ENTRY_TRAMP_DATA,
6c27c4082f4f70 Will Deacon           2017-12-06  643  			     __pa_symbol(__entry_tramp_data_start),
6c27c4082f4f70 Will Deacon           2017-12-06  644  			     PAGE_KERNEL_RO);
6c27c4082f4f70 Will Deacon           2017-12-06  645  	}
6c27c4082f4f70 Will Deacon           2017-12-06  646  
51a0048beb4496 Will Deacon           2017-11-14  647  	return 0;
51a0048beb4496 Will Deacon           2017-11-14  648  }
51a0048beb4496 Will Deacon           2017-11-14  649  core_initcall(map_entry_trampoline);
51a0048beb4496 Will Deacon           2017-11-14  650  #endif
51a0048beb4496 Will Deacon           2017-11-14  651  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: AliOS system security <alios_sys_security@linux.alibaba.com>,
	catalin.marinas@arm.com, will@kernel.org
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	AliOS system security <alios_sys_security@linux.alibaba.com>
Subject: Re: [PATCH] arm64: fix build error when use rodata_enabled
Date: Wed, 5 Jan 2022 18:22:29 +0800	[thread overview]
Message-ID: <202201051817.4KPMZJag-lkp@intel.com> (raw)
In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com>

Hi AliOS,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on v5.16-rc8 next-20220105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-randconfig-s032-20220105 (https://download.01.org/0day-ci/archive/20220105/202201051817.4KPMZJag-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/6af4245e93d33d4f4a79a560a707539be994f73e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review AliOS-system-security/arm64-fix-build-error-when-use-rodata_enabled/20220105-110838
        git checkout 6af4245e93d33d4f4a79a560a707539be994f73e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/arm64/mm/mmu.c: In function 'map_entry_trampoline':
>> arch/arm64/mm/mmu.c:627:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     627 |         phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
         |         ^~~~~~~~~~~


vim +627 arch/arm64/mm/mmu.c

28b066da69b937 Ard Biesheuvel        2017-03-09  618  
51a0048beb4496 Will Deacon           2017-11-14  619  #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
51a0048beb4496 Will Deacon           2017-11-14  620  static int __init map_entry_trampoline(void)
51a0048beb4496 Will Deacon           2017-11-14  621  {
6af4245e93d33d AliOS system security 2022-01-05  622  	pgprot_t prot = PAGE_KERNEL_EXEC;
6af4245e93d33d AliOS system security 2022-01-05  623  #if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
6af4245e93d33d AliOS system security 2022-01-05  624  	if (rodata_enabled)
6af4245e93d33d AliOS system security 2022-01-05  625  		prot = PAGE_KERNEL_ROX;
6af4245e93d33d AliOS system security 2022-01-05  626  #endif
51a0048beb4496 Will Deacon           2017-11-14 @627  	phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
51a0048beb4496 Will Deacon           2017-11-14  628  
51a0048beb4496 Will Deacon           2017-11-14  629  	/* The trampoline is always mapped and can therefore be global */
51a0048beb4496 Will Deacon           2017-11-14  630  	pgprot_val(prot) &= ~PTE_NG;
51a0048beb4496 Will Deacon           2017-11-14  631  
51a0048beb4496 Will Deacon           2017-11-14  632  	/* Map only the text into the trampoline page table */
51a0048beb4496 Will Deacon           2017-11-14  633  	memset(tramp_pg_dir, 0, PGD_SIZE);
51a0048beb4496 Will Deacon           2017-11-14  634  	__create_pgd_mapping(tramp_pg_dir, pa_start, TRAMP_VALIAS, PAGE_SIZE,
475ba3fc194b64 Will Deacon           2019-04-08  635  			     prot, __pgd_pgtable_alloc, 0);
51a0048beb4496 Will Deacon           2017-11-14  636  
6c27c4082f4f70 Will Deacon           2017-12-06  637  	/* Map both the text and data into the kernel page table */
51a0048beb4496 Will Deacon           2017-11-14  638  	__set_fixmap(FIX_ENTRY_TRAMP_TEXT, pa_start, prot);
6c27c4082f4f70 Will Deacon           2017-12-06  639  	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
6c27c4082f4f70 Will Deacon           2017-12-06  640  		extern char __entry_tramp_data_start[];
6c27c4082f4f70 Will Deacon           2017-12-06  641  
6c27c4082f4f70 Will Deacon           2017-12-06  642  		__set_fixmap(FIX_ENTRY_TRAMP_DATA,
6c27c4082f4f70 Will Deacon           2017-12-06  643  			     __pa_symbol(__entry_tramp_data_start),
6c27c4082f4f70 Will Deacon           2017-12-06  644  			     PAGE_KERNEL_RO);
6c27c4082f4f70 Will Deacon           2017-12-06  645  	}
6c27c4082f4f70 Will Deacon           2017-12-06  646  
51a0048beb4496 Will Deacon           2017-11-14  647  	return 0;
51a0048beb4496 Will Deacon           2017-11-14  648  }
51a0048beb4496 Will Deacon           2017-11-14  649  core_initcall(map_entry_trampoline);
51a0048beb4496 Will Deacon           2017-11-14  650  #endif
51a0048beb4496 Will Deacon           2017-11-14  651  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

  parent reply	other threads:[~2022-01-05 10:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05  3:07 [PATCH] arm64: fix build error when use rodata_enabled AliOS system security
2022-01-05  3:07 ` AliOS system security
2022-01-05  9:21 ` Anshuman Khandual
2022-01-05  9:21   ` Anshuman Khandual
2022-01-05 10:47   ` Mark Rutland
2022-01-05 10:47     ` Mark Rutland
     [not found]   ` <6f37012b-b082-457f-9aee-2315a461c031.alios_sys_security@linux.alibaba.com>
2022-01-05 12:48     ` 回复:[PATCH] " Anshuman Khandual
2022-01-05 12:48       ` Anshuman Khandual
2022-01-05 10:22 ` kernel test robot [this message]
2022-01-05 10:22   ` [PATCH] " kernel test robot
2022-01-05 10:22   ` kernel test robot

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=202201051817.4KPMZJag-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alios_sys_security@linux.alibaba.com \
    --cc=catalin.marinas@arm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.