Kunit: kernel/resource.c: In function 'gfr_start': include/linux/mm.h:101:35: error: 'MAX_PHYSMEM_BITS' undeclared (first use in this function)

From: Naresh Kamboju
Date: Mon Sep 09 2024 - 16:00:25 EST


The arm kunit builds failed on the Linux next-20240909 due to following
build warnings / errors with gcc-13 and clang-19 with extra Kconfigs

CONFIG_OF_KUNIT_TEST=y
CONFIG_KASAN=y
CONFIG_KUNIT=y
CONFIG_KUNIT_ALL_TESTS=y

First seen on next-20240909
Good: next-20240906
BAD: next-20240909

Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>

build log:
--------
In file included from include/linux/ioport.h:15,
from kernel/resource.c:15:
kernel/resource.c: In function 'gfr_start':
include/linux/mm.h:101:35: error: 'MAX_PHYSMEM_BITS' undeclared (first
use in this function)
101 | # define PHYSMEM_END ((1ULL << MAX_PHYSMEM_BITS) - 1)
| ^~~~~~~~~~~~~~~~

Build Log links,
--------
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20240909/testrun/25079447/suite/build/test/gcc-13-lkftconfig-kunit/log

Build failed comparison:
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20240909/testrun/25079447/suite/build/test/gcc-13-lkftconfig-kunit/history/

metadata:
----
git describe: next-20240909
git repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next
git sha: 100cc857359b5d731407d1038f7e76cd0e871d94
kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2lpXzTGrlTRMzsi0ZQdQUUn8rKy/config
build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2lpXzTGrlTRMzsi0ZQdQUUn8rKy/
toolchain: gcc-13, clang-19 and clang-nightly
config: multi_v5_defconfig + kunit
arch: arm

Steps to reproduce:
---------
- # tuxmake --runtime podman --target-arch arm --toolchain gcc-13
--kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2lpXzTGrlTRMzsi0ZQdQUUn8rKy/config
- # tuxmake --runtime podman --target-arch arm --toolchain gcc-13
--kconfig multi_v5_defconfig --kconfig-add CONFIG_KUNIT=y
--kconfig-add CONFIG_KUNIT_ALL_TESTS=y

--
Linaro LKFT
https://lkft.linaro.org