From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: kernel test robot <lkp@intel.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: kbuild-all@lists.01.org
Subject: Re: [PATCH v1 3/8] powerpc/fsl_booke: Take exec flag into account when setting TLBCAMs
Date: Mon, 25 Oct 2021 23:57:03 +0200 [thread overview]
Message-ID: <bf8c7960-618b-0a51-3697-447daca33dd0@csgroup.eu> (raw)
In-Reply-To: <202110221445.ZMrc3M2c-lkp@intel.com>
On 22/10/2021 08:36, kernel test robot wrote:
> Hi Christophe,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on powerpc/next]
> [also build test ERROR on v5.15-rc6 next-20211021]
> [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/Christophe-Leroy/powerpc-booke-Disable-STRICT_KERNEL_RWX-DEBUG_PAGEALLOC-and-KFENCE/20211015-180535
> base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> config: powerpc-tqm8541_defconfig (attached as .config)
> compiler: powerpc-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/0day-ci/linux/commit/159ed9a0b39712475dfebed64d1bb9387a0b9ad5
> git remote add linux-review https://github.com/0day-ci/linux
> git fetch --no-tags linux-review Christophe-Leroy/powerpc-booke-Disable-STRICT_KERNEL_RWX-DEBUG_PAGEALLOC-and-KFENCE/20211015-180535
> git checkout 159ed9a0b39712475dfebed64d1bb9387a0b9ad5
> # save the attached .config to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash arch/powerpc/mm/nohash/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> arch/powerpc/mm/nohash/fsl_book3e.c:63:15: error: no previous prototype for 'tlbcam_sz' [-Werror=missing-prototypes]
> 63 | unsigned long tlbcam_sz(int idx)
> | ^~~~~~~~~
> arch/powerpc/mm/nohash/fsl_book3e.c: In function 'settlbcam':
>>> arch/powerpc/mm/nohash/fsl_book3e.c:126:40: error: '_PAGE_BAP_SX' undeclared (first use in this function)
> 126 | TLBCAM[index].MAS3 |= (flags & _PAGE_BAP_SX) ? MAS3_SX : 0;
> | ^~~~~~~~~~~~
> arch/powerpc/mm/nohash/fsl_book3e.c:126:40: note: each undeclared identifier is reported only once for each function it appears in
> cc1: all warnings being treated as errors
>
Thanks Robot for reporting that.
The problem is not trivial and is in fact deeper, we have a
misdefinition of _PAGE_EXEC on book3e.
I sent a v2 which adds two patches at the begining of the series to
clear that problem, then I fixed this patch 3 (which has become patch 5)
to use _PAGE_EXEC instead of _PAGE_BAP_SX.
Christophe
>
> vim +/_PAGE_BAP_SX +126 arch/powerpc/mm/nohash/fsl_book3e.c
>
> 114
> 115 TLBCAM[index].MAS0 = MAS0_TLBSEL(1) | MAS0_ESEL(index) | MAS0_NV(index+1);
> 116 TLBCAM[index].MAS1 = MAS1_VALID | MAS1_IPROT | MAS1_TSIZE(tsize) | MAS1_TID(pid);
> 117 TLBCAM[index].MAS2 = virt & PAGE_MASK;
> 118
> 119 TLBCAM[index].MAS2 |= (flags & _PAGE_WRITETHRU) ? MAS2_W : 0;
> 120 TLBCAM[index].MAS2 |= (flags & _PAGE_NO_CACHE) ? MAS2_I : 0;
> 121 TLBCAM[index].MAS2 |= (flags & _PAGE_COHERENT) ? MAS2_M : 0;
> 122 TLBCAM[index].MAS2 |= (flags & _PAGE_GUARDED) ? MAS2_G : 0;
> 123 TLBCAM[index].MAS2 |= (flags & _PAGE_ENDIAN) ? MAS2_E : 0;
> 124
> 125 TLBCAM[index].MAS3 = (phys & MAS3_RPN) | MAS3_SR;
> > 126 TLBCAM[index].MAS3 |= (flags & _PAGE_BAP_SX) ? MAS3_SX : 0;
> 127 TLBCAM[index].MAS3 |= (flags & _PAGE_RW) ? MAS3_SW : 0;
> 128 if (mmu_has_feature(MMU_FTR_BIG_PHYS))
> 129 TLBCAM[index].MAS7 = (u64)phys >> 32;
> 130
> 131 /* Below is unlikely -- only for large user pages or similar */
> 132 if (pte_user(__pte(flags))) {
> 133 TLBCAM[index].MAS3 |= MAS3_UR;
> 134 TLBCAM[index].MAS3 |= (flags & _PAGE_EXEC) ? MAS3_UX : 0;
> 135 TLBCAM[index].MAS3 |= (flags & _PAGE_RW) ? MAS3_UW : 0;
> 136 }
> 137
> 138 tlbcam_addrs[index].start = virt;
> 139 tlbcam_addrs[index].limit = virt + size - 1;
> 140 tlbcam_addrs[index].phys = phys;
> 141 }
> 142
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
next prev parent reply other threads:[~2021-10-25 21:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 10:02 [PATCH v1 1/8] powerpc/booke: Disable STRICT_KERNEL_RWX, DEBUG_PAGEALLOC and KFENCE Christophe Leroy
2021-10-15 10:02 ` [PATCH v1 2/8] powerpc/fsl_booke: Rename fsl_booke.c to fsl_book3e.c Christophe Leroy
2021-10-15 10:02 ` [PATCH v1 3/8] powerpc/fsl_booke: Take exec flag into account when setting TLBCAMs Christophe Leroy
[not found] ` <202110221445.ZMrc3M2c-lkp@intel.com>
2021-10-25 21:57 ` Christophe Leroy [this message]
2021-10-15 10:02 ` [PATCH v1 4/8] powerpc/fsl_booke: Enable reloading of TLBCAM without switching to AS1 Christophe Leroy
2021-10-15 10:02 ` [PATCH v1 5/8] powerpc/fsl_booke: Tell map_mem_in_cams() if init is done Christophe Leroy
2021-10-15 10:02 ` [PATCH v1 6/8] powerpc/fsl_booke: Allocate separate TLBCAMs for readonly memory Christophe Leroy
2021-10-15 10:02 ` [PATCH v1 7/8] powerpc/fsl_booke: Update of TLBCAMs after init Christophe Leroy
2021-10-15 10:02 ` [PATCH v1 8/8] powerpc/fsl_booke: Enable STRICT_KERNEL_RWX Christophe Leroy
2021-11-02 10:11 ` [PATCH v1 1/8] powerpc/booke: Disable STRICT_KERNEL_RWX, DEBUG_PAGEALLOC and KFENCE Michael Ellerman
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=bf8c7960-618b-0a51-3697-447daca33dd0@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=kbuild-all@lists.01.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
/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