Message ID | 20200913114430.16102-1-gshan@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64/mm: Refactor {pgd, pud, pmd, pte}_ERROR() | expand |
Hi Gavin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on soc/for-next kvmarm/next v5.9-rc4 next-20200911]
[cannot apply to arm/for-next xlnx/master]
[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/Gavin-Shan/arm64-mm-Refactor-pgd-pud-pmd-pte-_ERROR/20200913-194714
base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
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 >>):
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from include/asm-generic/bug.h:20,
from arch/arm64/include/asm/bug.h:26,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from include/linux/pagemap.h:8,
from mm/pgtable-generic.c:10:
mm/pgtable-generic.c: In function 'pgd_clear_bad':
include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'pgdval_t' {aka 'long long unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
339 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
arch/arm64/include/asm/pgtable.h:697:2: note: in expansion of macro 'pr_err'
697 | pr_err("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
| ^~~~~~
mm/pgtable-generic.c:23:2: note: in expansion of macro 'pgd_ERROR'
23 | pgd_ERROR(*pgd);
| ^~~~~~~~~
In file included from include/linux/pgtable.h:6,
from include/linux/mm.h:33,
from include/linux/pagemap.h:8,
from mm/pgtable-generic.c:10:
arch/arm64/include/asm/pgtable.h:697:30: note: format string is defined here
697 | pr_err("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
| ~~~~~^
| |
| long unsigned int
| %016llx
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from include/asm-generic/bug.h:20,
from arch/arm64/include/asm/bug.h:26,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from include/linux/pagemap.h:8,
from mm/pgtable-generic.c:10:
mm/pgtable-generic.c: In function 'pud_clear_bad':
>> include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'pudval_t' {aka 'long long unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
339 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
arch/arm64/include/asm/pgtable.h:637:2: note: in expansion of macro 'pr_err'
637 | pr_err("%s:%d: bad pud %016lx.\n", __FILE__, __LINE__, pud_val(e))
| ^~~~~~
mm/pgtable-generic.c:38:2: note: in expansion of macro 'pud_ERROR'
38 | pud_ERROR(*pud);
| ^~~~~~~~~
In file included from include/linux/pgtable.h:6,
from include/linux/mm.h:33,
from include/linux/pagemap.h:8,
from mm/pgtable-generic.c:10:
arch/arm64/include/asm/pgtable.h:637:30: note: format string is defined here
637 | pr_err("%s:%d: bad pud %016lx.\n", __FILE__, __LINE__, pud_val(e))
| ~~~~~^
| |
| long unsigned int
| %016llx
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:15,
from include/asm-generic/bug.h:20,
from arch/arm64/include/asm/bug.h:26,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from include/linux/pagemap.h:8,
from mm/pgtable-generic.c:10:
mm/pgtable-generic.c: In function 'pmd_clear_bad':
include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'pmdval_t' {aka 'long long unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:339:9: note: in expansion of macro 'KERN_ERR'
339 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
arch/arm64/include/asm/pgtable.h:569:2: note: in expansion of macro 'pr_err'
569 | pr_err("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
| ^~~~~~
mm/pgtable-generic.c:50:2: note: in expansion of macro 'pmd_ERROR'
50 | pmd_ERROR(*pmd);
| ^~~~~~~~~
In file included from include/linux/pgtable.h:6,
from include/linux/mm.h:33,
from include/linux/pagemap.h:8,
from mm/pgtable-generic.c:10:
arch/arm64/include/asm/pgtable.h:569:30: note: format string is defined here
569 | pr_err("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
| ~~~~~^
| |
| long unsigned int
| %016llx
# https://github.com/0day-ci/linux/commit/cd252fb09dcb74b0e227cc8a28d08d32e217f084
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Gavin-Shan/arm64-mm-Refactor-pgd-pud-pmd-pte-_ERROR/20200913-194714
git checkout cd252fb09dcb74b0e227cc8a28d08d32e217f084
vim +5 include/linux/kern_levels.h
314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
On 9/14/20 8:19 AM, kernel test robot wrote: > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on arm64/for-next/core] > [also build test WARNING on soc/for-next kvmarm/next v5.9-rc4 next-20200911] > [cannot apply to arm/for-next xlnx/master] > [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/Gavin-Shan/arm64-mm-Refactor-pgd-pud-pmd-pte-_ERROR/20200913-194714 > base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core > config: arm64-defconfig (attached as .config) > compiler: aarch64-linux-gcc (GCC) 9.3.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 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 > > 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 >>): > > In file included from include/linux/printk.h:7, > from include/linux/kernel.h:15, > from include/asm-generic/bug.h:20, > from arch/arm64/include/asm/bug.h:26, > from include/linux/bug.h:5, > from include/linux/mmdebug.h:5, > from include/linux/mm.h:9, > from include/linux/pagemap.h:8, > from mm/pgtable-generic.c:10: > mm/pgtable-generic.c: In function 'pgd_clear_bad': > include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'pgdval_t' {aka 'long long unsigned int'} [-Wformat=] [...] I'm fixing this by passing "%016llx" instead of "%016lx" to pr_err() in v2. Thanks, Gavin
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index d5d3fbe73953..8d037615a392 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -35,11 +35,6 @@ extern struct page *vmemmap; -extern void __pte_error(const char *file, int line, unsigned long val); -extern void __pmd_error(const char *file, int line, unsigned long val); -extern void __pud_error(const char *file, int line, unsigned long val); -extern void __pgd_error(const char *file, int line, unsigned long val); - #ifdef CONFIG_TRANSPARENT_HUGEPAGE #define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE @@ -57,7 +52,8 @@ extern void __pgd_error(const char *file, int line, unsigned long val); extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; #define ZERO_PAGE(vaddr) phys_to_page(__pa_symbol(empty_zero_page)) -#define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte)) +#define pte_ERROR(e) \ + pr_err("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) /* * Macros to convert between a physical address and its placement in a @@ -541,7 +537,8 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) #if CONFIG_PGTABLE_LEVELS > 2 -#define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd_val(pmd)) +#define pmd_ERROR(e) \ + pr_err("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e)) #define pud_none(pud) (!pud_val(pud)) #define pud_bad(pud) (!(pud_val(pud) & PUD_TABLE_BIT)) @@ -608,7 +605,8 @@ static inline unsigned long pud_page_vaddr(pud_t pud) #if CONFIG_PGTABLE_LEVELS > 3 -#define pud_ERROR(pud) __pud_error(__FILE__, __LINE__, pud_val(pud)) +#define pud_ERROR(e) \ + pr_err("%s:%d: bad pud %016lx.\n", __FILE__, __LINE__, pud_val(e)) #define p4d_none(p4d) (!p4d_val(p4d)) #define p4d_bad(p4d) (!(p4d_val(p4d) & 2)) @@ -667,7 +665,8 @@ static inline unsigned long p4d_page_vaddr(p4d_t p4d) #endif /* CONFIG_PGTABLE_LEVELS > 3 */ -#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd)) +#define pgd_ERROR(e) \ + pr_err("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) #define pgd_set_fixmap(addr) ((pgd_t *)set_fixmap_offset(FIX_PGD, addr)) #define pgd_clear_fixmap() clear_fixmap(FIX_PGD) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 13ebd5ca2070..12fba7136dbd 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -935,26 +935,6 @@ asmlinkage void enter_from_user_mode(void) } NOKPROBE_SYMBOL(enter_from_user_mode); -void __pte_error(const char *file, int line, unsigned long val) -{ - pr_err("%s:%d: bad pte %016lx.\n", file, line, val); -} - -void __pmd_error(const char *file, int line, unsigned long val) -{ - pr_err("%s:%d: bad pmd %016lx.\n", file, line, val); -} - -void __pud_error(const char *file, int line, unsigned long val) -{ - pr_err("%s:%d: bad pud %016lx.\n", file, line, val); -} - -void __pgd_error(const char *file, int line, unsigned long val) -{ - pr_err("%s:%d: bad pgd %016lx.\n", file, line, val); -} - /* GENERIC_BUG traps */ int is_valid_bugaddr(unsigned long addr)
The function __{pgd, pud, pmd, pte}_error() are introduced so that they can be called by {pgd, pud, pmd, pte}_ERROR(). However, some of the functions could never be called when the corresponding page table level isn't enabled. For example, __{pud, pmd}_error() are unused when PUD and PMD are folded to PGD. This removes __{pgd, pud, pmd, pte}_error() and call pr_err() from {pgd, pud, pmd, pte}_ERROR() directly, similar to what x86/powerpc are doing. With this, the code looks a bit simplified either. Signed-off-by: Gavin Shan <gshan@redhat.com> --- arch/arm64/include/asm/pgtable.h | 17 ++++++++--------- arch/arm64/kernel/traps.c | 20 -------------------- 2 files changed, 8 insertions(+), 29 deletions(-)