Content-Type: multipart/mixed; boundary="===============2710005748450114035==" MIME-Version: 1.0 From: kernel test robot 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 Message-ID: <202201051817.4KPMZJag-lkp@intel.com> In-Reply-To: <1641352075-25200-1-git-send-email-alios_sys_security@linux.alibaba.com> List-Id: --===============2710005748450114035== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/arm6= 4-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/arc= hive/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/6af4245e93d33d4f4a79a560a= 707539be994f73e git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review AliOS-system-security/arm64-fix-bu= ild-error-when-use-rodata_enabled/20220105-110838 git checkout 6af4245e93d33d4f4a79a560a707539be994f73e # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=3Dbuild_dir ARCH=3Da= rm64 SHELL=3D/bin/bash arch/arm64/mm/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot 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 a= nd code [-Wdeclaration-after-statement] 627 | phys_addr_t pa_start =3D __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_K= ERNEL_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 =3D PA= GE_KERNEL_EXEC; 6af4245e93d33d AliOS system security 2022-01-05 623 #if defined(CONFIG_ST= RICT_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 =3D PAGE_KERNE= L_ROX; 6af4245e93d33d AliOS system security 2022-01-05 626 #endif 51a0048beb4496 Will Deacon 2017-11-14 @627 phys_addr_t pa_start= =3D __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) &= =3D ~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_p= gtable_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_ENT= RY_TRAMP_TEXT, pa_start, prot); 6c27c4082f4f70 Will Deacon 2017-12-06 639 if (IS_ENABLED(CONFI= G_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_EN= TRY_TRAMP_DATA, 6c27c4082f4f70 Will Deacon 2017-12-06 643 __pa_symbol(_= _entry_tramp_data_start), 6c27c4082f4f70 Will Deacon 2017-12-06 644 PAGE_KERNEL_R= O); 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_ent= ry_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 --===============2710005748450114035==--