/bin/bash: line 1: 45878 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -D__NDS32_EL__ --arch=nds32 -mlittle-endian -m32 -Wp,-MMD,ker...
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 66f4beaa6c1d28161f534471484b2daa2de1dce0
commit: 60f2415e19d3948641149ac6aca137a7be1d1952 sched: Make schedstats helpers independent of fair sched class
date: 6 weeks ago
config: nds32-randconfig-s031-20211015 (attached as .config)
compiler: nds32le-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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 60f2415e19d3948641149ac6aca137a7be1d1952
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=nds32
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
include/linux/rtmutex.h:68:58: sparse: sparse: got $
kernel/sched/fair.c: note: in included file (through include/linux/sched.h, kernel/sched/sched.h):
include/linux/seccomp.h:96:63: sparse: sparse: Expected ) in function declarator
include/linux/seccomp.h:96:63: sparse: sparse: got $
include/linux/seccomp.h:99:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/seccomp.h:99:1: sparse: sparse: got }
include/linux/seccomp.h:103:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/seccomp.h:103:1: sparse: sparse: got }
include/linux/seccomp.h:116:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/seccomp.h:116:1: sparse: sparse: got }
include/linux/seccomp.h:122:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/seccomp.h:122:1: sparse: sparse: got }
kernel/sched/fair.c: note: in included file (through include/linux/nodemask.h, include/linux/sched.h, kernel/sched/sched.h):
include/linux/numa.h:50:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/numa.h:50:1: sparse: sparse: got }
include/linux/numa.h:54:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/numa.h:54:1: sparse: sparse: got }
include/linux/numa.h:58:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/numa.h:58:1: sparse: sparse: got }
kernel/sched/fair.c: note: in included file (through include/linux/sched.h, kernel/sched/sched.h):
include/linux/nodemask.h:98:54: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:98:54: sparse: sparse: got }
include/linux/nodemask.h:99:19: sparse: sparse: Expected ; at end of declaration
include/linux/nodemask.h:99:19: sparse: sparse: got _unused_nodemask_arg_
include/linux/nodemask.h:109:68: sparse: sparse: Expected ) in function declarator
include/linux/nodemask.h:109:68: sparse: sparse: got *
include/linux/nodemask.h:112:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:112:1: sparse: sparse: got }
include/linux/nodemask.h:116:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:116:1: sparse: sparse: got }
include/linux/nodemask.h:131:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:131:1: sparse: sparse: got }
include/linux/nodemask.h:137:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:137:1: sparse: sparse: got }
include/linux/nodemask.h:143:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:143:1: sparse: sparse: got }
include/linux/nodemask.h:149:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:149:1: sparse: sparse: got }
include/linux/nodemask.h:159:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:159:1: sparse: sparse: got }
include/linux/nodemask.h:167:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:167:1: sparse: sparse: got }
include/linux/nodemask.h:175:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:175:1: sparse: sparse: got }
include/linux/nodemask.h:183:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:183:1: sparse: sparse: got }
include/linux/nodemask.h:191:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:191:1: sparse: sparse: got }
include/linux/nodemask.h:199:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:199:1: sparse: sparse: got }
include/linux/nodemask.h:207:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:207:1: sparse: sparse: got }
include/linux/nodemask.h:215:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:215:1: sparse: sparse: got }
include/linux/nodemask.h:223:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:223:1: sparse: sparse: got }
include/linux/nodemask.h:229:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:229:1: sparse: sparse: got }
include/linux/nodemask.h:235:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:235:1: sparse: sparse: got }
include/linux/nodemask.h:241:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:241:1: sparse: sparse: got }
include/linux/nodemask.h:249:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:249:1: sparse: sparse: got }
include/linux/nodemask.h:257:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:257:1: sparse: sparse: got }
include/linux/nodemask.h:265:16: sparse: sparse: Expected ) in nested declarator
include/linux/nodemask.h:265:16: sparse: sparse: got <
include/linux/nodemask.h:265:16: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:265:16: sparse: sparse: got }
include/linux/nodemask.h:266:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:266:1: sparse: sparse: got }
include/linux/nodemask.h:271:16: sparse: sparse: Expected ) in nested declarator
include/linux/nodemask.h:271:16: sparse: sparse: got <
include/linux/nodemask.h:271:16: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:271:16: sparse: sparse: got }
include/linux/nodemask.h:272:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:272:1: sparse: sparse: got }
include/linux/nodemask.h:281:53: sparse: sparse: Expected ) in function declarator
include/linux/nodemask.h:281:53: sparse: sparse: got *
include/linux/nodemask.h:284:9: sparse: sparse: Expected ) in function declarator
include/linux/nodemask.h:284:9: sparse: sparse: got (
include/linux/nodemask.h:285:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:285:1: sparse: sparse: got }
include/linux/nodemask.h:301:16: sparse: sparse: Expected ) in nested declarator
include/linux/nodemask.h:301:16: sparse: sparse: got <
include/linux/nodemask.h:301:16: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:301:16: sparse: sparse: got }
include/linux/nodemask.h:303:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:303:1: sparse: sparse: got }
include/linux/nodemask.h:337:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:337:1: sparse: sparse: got }
include/linux/nodemask.h:343:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:343:1: sparse: sparse: got }
include/linux/nodemask.h:351:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:351:1: sparse: sparse: got }
include/linux/nodemask.h:359:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:359:1: sparse: sparse: got }
include/linux/nodemask.h:367:1: sparse: sparse: Expected ; at the end of type declaration
include/linux/nodemask.h:367:1: sparse: sparse: too many errors
>> /bin/bash: line 1: 45878 Segmentation fault sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise -Wno-return-void -Wno-unknown-attribute -fdiagnostic-prefix -D__CHECK_ENDIAN__ -D__NDS32_EL__ --arch=nds32 -mlittle-endian -m32 -Wp,-MMD,kernel/sched/.fair.o.d -nostdinc -isystem /opt/cross/gcc-11.2.0-nolibc/nds32le-linux/bin/../lib/gcc/nds32le-linux/11.2.0/include -Iarch/nds32/include -I./arch/nds32/include/generated -Iinclude -I./include -Iarch/nds32/include/uapi -I./arch/nds32/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map== -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sched-prolog-epilog -mcmodel=large -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft -EL -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=1024 -fno-stack-protector -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-stack-clash-protection -fno-inline-functions-called-once -falign-functions=64 -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wpacked-not-aligned -Wstringop-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -I kernel/sched -I ./kernel/sched -DKBUILD_MODFILE='"kernel/sched/fair"' -DKBUILD_BASENAME='"fair"' -DKBUILD_MODNAME='"fair"' -D__KBUILD_MODNAME=kmod_fair kernel/sched/fair.c
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 weeks, 4 days
[kbuild] drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1433 amdgpu_discovery_get_vcn_info() error: buffer overflow 'adev->vcn.vcn_codec_disable_mask' 2 <= 3
by Dan Carpenter
[ kbuild bot sent this warning on May 4 but I never heard back and it's
May 27 now so sending a duplicate warning is probably for the best. -dan]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7e284070abe53d448517b80493863595af4ab5f0
commit: 622469c87fc3e6c90a980be3e2287d82bd55c977 drm/amdgpu/discovery: add a function to parse the vcn info table
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220527/202205271546.oV14N2r8-lk... )
compiler: arceb-elf-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:1433 amdgpu_discovery_get_vcn_info() error: buffer overflow 'adev->vcn.vcn_codec_disable_mask' 2 <= 3
vim +1433 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
622469c87fc3e6 Alex Deucher 2022-03-30 1403 int amdgpu_discovery_get_vcn_info(struct amdgpu_device *adev)
622469c87fc3e6 Alex Deucher 2022-03-30 1404 {
622469c87fc3e6 Alex Deucher 2022-03-30 1405 struct binary_header *bhdr;
622469c87fc3e6 Alex Deucher 2022-03-30 1406 union vcn_info *vcn_info;
622469c87fc3e6 Alex Deucher 2022-03-30 1407 u16 offset;
622469c87fc3e6 Alex Deucher 2022-03-30 1408 int v;
622469c87fc3e6 Alex Deucher 2022-03-30 1409
622469c87fc3e6 Alex Deucher 2022-03-30 1410 if (!adev->mman.discovery_bin) {
622469c87fc3e6 Alex Deucher 2022-03-30 1411 DRM_ERROR("ip discovery uninitialized\n");
622469c87fc3e6 Alex Deucher 2022-03-30 1412 return -EINVAL;
622469c87fc3e6 Alex Deucher 2022-03-30 1413 }
622469c87fc3e6 Alex Deucher 2022-03-30 1414
622469c87fc3e6 Alex Deucher 2022-03-30 1415 if (adev->vcn.num_vcn_inst > VCN_INFO_TABLE_MAX_NUM_INSTANCES) {
Capped to 4
622469c87fc3e6 Alex Deucher 2022-03-30 1416 dev_err(adev->dev, "invalid vcn instances\n");
622469c87fc3e6 Alex Deucher 2022-03-30 1417 return -EINVAL;
622469c87fc3e6 Alex Deucher 2022-03-30 1418 }
622469c87fc3e6 Alex Deucher 2022-03-30 1419
622469c87fc3e6 Alex Deucher 2022-03-30 1420 bhdr = (struct binary_header *)adev->mman.discovery_bin;
622469c87fc3e6 Alex Deucher 2022-03-30 1421 offset = le16_to_cpu(bhdr->table_list[VCN_INFO].offset);
622469c87fc3e6 Alex Deucher 2022-03-30 1422
622469c87fc3e6 Alex Deucher 2022-03-30 1423 if (!offset) {
622469c87fc3e6 Alex Deucher 2022-03-30 1424 dev_err(adev->dev, "invalid vcn table offset\n");
622469c87fc3e6 Alex Deucher 2022-03-30 1425 return -EINVAL;
622469c87fc3e6 Alex Deucher 2022-03-30 1426 }
622469c87fc3e6 Alex Deucher 2022-03-30 1427
622469c87fc3e6 Alex Deucher 2022-03-30 1428 vcn_info = (union vcn_info *)(adev->mman.discovery_bin + offset);
622469c87fc3e6 Alex Deucher 2022-03-30 1429
622469c87fc3e6 Alex Deucher 2022-03-30 1430 switch (le16_to_cpu(vcn_info->v1.header.version_major)) {
622469c87fc3e6 Alex Deucher 2022-03-30 1431 case 1:
622469c87fc3e6 Alex Deucher 2022-03-30 1432 for (v = 0; v < adev->vcn.num_vcn_inst; v++) {
622469c87fc3e6 Alex Deucher 2022-03-30 @1433 adev->vcn.vcn_codec_disable_mask[v] =
But this array doesn't have 4 elements
622469c87fc3e6 Alex Deucher 2022-03-30 1434 le32_to_cpu(vcn_info->v1.instance_info[v].fuse_data.all_bits);
622469c87fc3e6 Alex Deucher 2022-03-30 1435 }
622469c87fc3e6 Alex Deucher 2022-03-30 1436 break;
622469c87fc3e6 Alex Deucher 2022-03-30 1437 default:
622469c87fc3e6 Alex Deucher 2022-03-30 1438 dev_err(adev->dev,
622469c87fc3e6 Alex Deucher 2022-03-30 1439 "Unhandled VCN info table %d.%d\n",
622469c87fc3e6 Alex Deucher 2022-03-30 1440 le16_to_cpu(vcn_info->v1.header.version_major),
622469c87fc3e6 Alex Deucher 2022-03-30 1441 le16_to_cpu(vcn_info->v1.header.version_minor));
622469c87fc3e6 Alex Deucher 2022-03-30 1442 return -EINVAL;
622469c87fc3e6 Alex Deucher 2022-03-30 1443 }
622469c87fc3e6 Alex Deucher 2022-03-30 1444 return 0;
f39f5bb1c9d68d Xiaojie Yuan 2019-06-20 1445 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
3 weeks, 2 days
Re: arch/arm64/kernel/fpsimd.c:1944:55: sparse: sparse: dereference of noderef expression
by Catalin Marinas
On Sat, May 28, 2022 at 06:49:01AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 8291eaafed36f575f23951f3ce18407f480e9ecf
> commit: e0838f6373e5cb72516fc4c26bba309097e2a80a arm64/sme: Save and restore streaming mode over EFI runtime calls
> date: 5 weeks ago
> config: arm64-randconfig-s032-20220527 (https://download.01.org/0day-ci/archive/20220528/202205280635.XKlMkfKD-lk...)
> compiler: aarch64-linux-gcc (GCC) 11.3.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-14-g5a0004b5-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout e0838f6373e5cb72516fc4c26bba309097e2a80a
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kernel/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp(a)intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
> >> arch/arm64/kernel/fpsimd.c:1944:55: sparse: sparse: dereference of noderef expression
>
> vim +1944 arch/arm64/kernel/fpsimd.c
>
> 1916
> 1917 /*
> 1918 * __efi_fpsimd_end(): clean up FPSIMD after an EFI runtime services call
> 1919 */
> 1920 void __efi_fpsimd_end(void)
> 1921 {
> 1922 if (!system_supports_fpsimd())
> 1923 return;
> 1924
> 1925 if (!__this_cpu_xchg(efi_fpsimd_state_used, false)) {
> 1926 kernel_neon_end();
> 1927 } else {
> 1928 if (system_supports_sve() &&
> 1929 likely(__this_cpu_read(efi_sve_state_used))) {
> 1930 char const *sve_state = this_cpu_ptr(efi_sve_state);
> 1931 bool ffr = true;
> 1932
> 1933 /*
> 1934 * Restore streaming mode; EFI calls are
> 1935 * normal function calls so should not return in
> 1936 * streaming mode.
> 1937 */
> 1938 if (system_supports_sme()) {
> 1939 if (__this_cpu_read(efi_sm_state)) {
> 1940 sysreg_clear_set_s(SYS_SVCR_EL0,
> 1941 0,
> 1942 SYS_SVCR_EL0_SM_MASK);
> 1943 if (!system_supports_fa64())
> > 1944 ffr = efi_sm_state;
This looks wrong indeed. IIUC, something like below but waiting for Mark
to confirm:
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 819979398127..ac521b3403d6 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -1965,7 +1965,7 @@ void __efi_fpsimd_end(void)
0,
SVCR_SM_MASK);
if (!system_supports_fa64())
- ffr = efi_sm_state;
+ ffr = false;
}
}
--
Catalin
3 weeks, 2 days
[PATCH] ftrace/fgraph: fix increased missing-prototypes warnings
by Chengming Zhou
After commit e999995c84c3 ("ftrace: cleanup ftrace_graph_caller enable
and disable") merged into the linux-next tree, the kernel test robot
(lkp(a)intel.com) has send out report that there are increased missing-prototypes
warnings caused by that commit.
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 \
O=build_dir ARCH=sh SHELL=/bin/bash kernel/trace/
warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Wmissing-prototypes]
warning: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Wmissing-prototypes]
warning: no previous prototype for 'ftrace_return_to_handler' [-Wmissing-prototypes]
warning: no previous prototype for 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes]
BTW there are so many missing-prototypes warnings if build kernel with "W=1".
The increased warnings for 'ftrace_[enable,disable]_ftrace_graph_caller'
is caused by CONFIG_FUNCTION_GRAPH_TRACER && !CONFIG_DYNAMIC_FTRACE,
so the declarations in <linux/ftrace.h> can't be seen in fgraph.c.
And this warning can't reproduce on x86_64 since x86_64 select
HAVE_FUNCTION_GRAPH_TRACER only when DYNAMIC_FTRACE, so fgraph.c will
always see the declarations in <linux/ftrace.h>.
This patch fix the increased warnings by put the definitions in
CONFIG_DYNAMIC_FTRACE although there are no real problems exist.
Signed-off-by: Chengming Zhou <zhouchengming(a)bytedance.com>
---
kernel/trace/fgraph.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 289311680c29..2cd374294be7 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trace/fgraph.c
@@ -30,6 +30,7 @@ int ftrace_graph_active;
/* Both enabled by default (can be cleared by function_graph tracer flags */
static bool fgraph_sleep_time = true;
+#ifdef CONFIG_DYNAMIC_FTRACE
/*
* archs can override this function if they must do something
* to enable hook for graph tracer.
@@ -47,6 +48,7 @@ int __weak ftrace_disable_ftrace_graph_caller(void)
{
return 0;
}
+#endif
/**
* ftrace_graph_stop - set to permanently disable function graph tracing
--
2.36.0
3 weeks, 3 days
Re: kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
by Toke Høiland-Jørgensen
kernel test robot <lkp(a)intel.com> writes:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: eaea45fc0e7b6ae439526b4a41d91230c8517336
> commit: 782347b6bcad07ddb574422e01e22c92e05928c8 xdp: Add proper __rcu annotations to redirect map entries
> date: 11 months ago
> config: ia64-randconfig-s031-20220522 (https://download.01.org/0day-ci/archive/20220522/202205222029.xpW3PM1y-lk...)
> compiler: ia64-linux-gcc (GCC) 11.3.0
Hmm, so this is ia64-only? Some kind of macro breakage? Paul, any ideas?
-Toke
> 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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 782347b6bcad07ddb574422e01e22c92e05928c8
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash kernel/bpf/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp(a)intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
> kernel/bpf/devmap.c:561:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_dtab_netdev *dst @@ got struct bpf_dtab_netdev [noderef] __rcu * @@
> kernel/bpf/devmap.c:561:29: sparse: expected struct bpf_dtab_netdev *dst
> kernel/bpf/devmap.c:561:29: sparse: got struct bpf_dtab_netdev [noderef] __rcu *
> kernel/bpf/devmap.c:657:29: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct bpf_dtab_netdev *dst @@ got struct bpf_dtab_netdev [noderef] __rcu * @@
> kernel/bpf/devmap.c:657:29: sparse: expected struct bpf_dtab_netdev *dst
> kernel/bpf/devmap.c:657:29: sparse: got struct bpf_dtab_netdev [noderef] __rcu *
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>>> kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression
>
> vim +/__rcu +1030 kernel/bpf/devmap.c
>
> 990
> 991 static int dev_map_notification(struct notifier_block *notifier,
> 992 ulong event, void *ptr)
> 993 {
> 994 struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
> 995 struct bpf_dtab *dtab;
> 996 int i, cpu;
> 997
> 998 switch (event) {
> 999 case NETDEV_REGISTER:
> 1000 if (!netdev->netdev_ops->ndo_xdp_xmit || netdev->xdp_bulkq)
> 1001 break;
> 1002
> 1003 /* will be freed in free_netdev() */
> 1004 netdev->xdp_bulkq = alloc_percpu(struct xdp_dev_bulk_queue);
> 1005 if (!netdev->xdp_bulkq)
> 1006 return NOTIFY_BAD;
> 1007
> 1008 for_each_possible_cpu(cpu)
> 1009 per_cpu_ptr(netdev->xdp_bulkq, cpu)->dev = netdev;
> 1010 break;
> 1011 case NETDEV_UNREGISTER:
> 1012 /* This rcu_read_lock/unlock pair is needed because
> 1013 * dev_map_list is an RCU list AND to ensure a delete
> 1014 * operation does not free a netdev_map entry while we
> 1015 * are comparing it against the netdev being unregistered.
> 1016 */
> 1017 rcu_read_lock();
> 1018 list_for_each_entry_rcu(dtab, &dev_map_list, list) {
> 1019 if (dtab->map.map_type == BPF_MAP_TYPE_DEVMAP_HASH) {
> 1020 dev_map_hash_remove_netdev(dtab, netdev);
> 1021 continue;
> 1022 }
> 1023
> 1024 for (i = 0; i < dtab->map.max_entries; i++) {
> 1025 struct bpf_dtab_netdev *dev, *odev;
> 1026
> 1027 dev = rcu_dereference(dtab->netdev_map[i]);
> 1028 if (!dev || netdev != dev->dev)
> 1029 continue;
>> 1030 odev = unrcu_pointer(cmpxchg(&dtab->netdev_map[i], RCU_INITIALIZER(dev), NULL));
> 1031 if (dev == odev)
> 1032 call_rcu(&dev->rcu,
> 1033 __dev_map_entry_free);
> 1034 }
> 1035 }
> 1036 rcu_read_unlock();
> 1037 break;
> 1038 default:
> 1039 break;
> 1040 }
> 1041 return NOTIFY_OK;
> 1042 }
> 1043
>
> --
> 0-DAY CI Kernel Test Service
> https://01.org/lkp
3 weeks, 3 days
【JR西日本:Club J-WEST】お客様への重要なお知らせです。
by JR西日本 Club J-WEST事務局
お客様へ
日頃より「JR西日本」をご利用いただきありがとうございます。
「JR西日本」は 2022 年 5 月 28 日(日)にサービスをリニューアルいたしました。これ に伴い、「JR西日本」利用規約・会員規約を変更し、最後にログインをした日より起算し て2年以上「JR西日本」のご利用(ログイン)が確認できない「JR西日本」アカウント は、自動的に退会処理させていただくことといたしました。なお、対象アカウントの自動退 会処理を、本規約に基づき、2022 年 6 月 28 日より順次、実施させていただきます。
24時間以上ログインしておらず、「JR西日本」を使い続けたい場合は、2022年5月28日までに一度ログインしてください。
⇒ログインはこちら
※えきねっとトップページ右上のログインボタンよりログインしてください。
なお、アカウントが退会処理された場合も、新たにアカウント登録(無料登録)していた だくことですぐに「えきねっと」をご利用いただくことができますので、今後もご愛顧いた だけますようよろしくお願いいたします。
Copyright © JR East Net Station Co.,Ltd. All Rights Reserved.
3 weeks, 4 days
Re: vmlinux.o: warning: objtool: __fentry__+0x16: return with modified stack frame
by Josh Poimboeuf
On Tue, May 31, 2022 at 06:30:07AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: e11a93567d3f1e843300ed98ff049a4335db8015
> commit: 72064474964724c59ddff58a581a31b1ede75cf9 objtool: Make stack validation frame-pointer-specific
> date: 6 weeks ago
> config: x86_64-buildonly-randconfig-r006-20220530 (https://download.01.org/0day-ci/archive/20220531/202205310609.Rw55oP08-lk...)
> compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
> reproduce (this is a W=1 build):
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 72064474964724c59ddff58a581a31b1ede75cf9
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp(a)intel.com>
>
> All warnings (new ones prefixed by >>):
>
> vmlinux.o: warning: objtool: ibt_selftest+0x11: sibling call from callable instruction with modified stack frame
> >> vmlinux.o: warning: objtool: __fentry__+0x16: return with modified stack frame
Here's a fix for this warning. Will post a proper patch tomorrow-ish.
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 03364dc40d8d..4c8b6ae802ac 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -36,10 +36,6 @@ KCSAN_SANITIZE := n
OBJECT_FILES_NON_STANDARD_test_nx.o := y
-ifdef CONFIG_FRAME_POINTER
-OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y
-endif
-
# If instrumentation of this dir is enabled, boot hangs during first second.
# Probably could be more selective here, but note that files related to irqs,
# boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
index 4ec13608d3c6..db7c396064ef 100644
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@ -175,6 +175,7 @@ SYM_INNER_LABEL(ftrace_caller_end, SYM_L_GLOBAL)
jmp ftrace_epilogue
SYM_FUNC_END(ftrace_caller);
+STACK_FRAME_NON_STANDARD_FP(ftrace_caller)
SYM_FUNC_START(ftrace_epilogue)
/*
@@ -282,6 +283,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL)
jmp ftrace_epilogue
SYM_FUNC_END(ftrace_regs_caller)
+STACK_FRAME_NON_STANDARD_FP(ftrace_regs_caller)
#else /* ! CONFIG_DYNAMIC_FTRACE */
@@ -311,6 +313,8 @@ trace:
jmp ftrace_stub
SYM_FUNC_END(__fentry__)
EXPORT_SYMBOL(__fentry__)
+STACK_FRAME_NON_STANDARD_FP(__fentry__)
+
#endif /* CONFIG_DYNAMIC_FTRACE */
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 6491fa8fba6d..15b940ec1eac 100644
--- a/include/linux/objtool.h
+++ b/include/linux/objtool.h
@@ -143,6 +143,12 @@ struct unwind_hint {
.popsection
.endm
+.macro STACK_FRAME_NON_STANDARD_FP func:req
+#ifdef CONFIG_FRAME_POINTER
+ STACK_FRAME_NON_STANDARD \func
+#endif
+.endm
+
.macro ANNOTATE_NOENDBR
.Lhere_\@:
.pushsection .discard.noendbr
diff --git a/tools/include/linux/objtool.h b/tools/include/linux/objtool.h
index 6491fa8fba6d..15b940ec1eac 100644
--- a/tools/include/linux/objtool.h
+++ b/tools/include/linux/objtool.h
@@ -143,6 +143,12 @@ struct unwind_hint {
.popsection
.endm
+.macro STACK_FRAME_NON_STANDARD_FP func:req
+#ifdef CONFIG_FRAME_POINTER
+ STACK_FRAME_NON_STANDARD \func
+#endif
+.endm
+
.macro ANNOTATE_NOENDBR
.Lhere_\@:
.pushsection .discard.noendbr
3 weeks, 4 days
Re: arch/arm64/kernel/signal.c:663:43: sparse: sparse: incorrect type in argument 1 (different address spaces)
by Catalin Marinas
On Sat, May 28, 2022 at 07:40:31AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: bf272460d744112bacd4c4d562592decbf0edf64
> commit: a1f4ccd25cc256255813f584f10e5527369d4a02 arm64/sme: Provide Kconfig for SME
> date: 5 weeks ago
> config: arm64-randconfig-s032-20220527 (https://download.01.org/0day-ci/archive/20220528/202205280710.c7k1K4sD-lk...)
> compiler: aarch64-linux-gcc (GCC) 11.3.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-14-g5a0004b5-dirty
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout a1f4ccd25cc256255813f584f10e5527369d4a02
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/kernel/
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp(a)intel.com>
>
>
> sparse warnings: (new ones prefixed by >>)
> >> arch/arm64/kernel/signal.c:663:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct user_ctxs [noderef] __user *user @@ got struct user_ctxs * @@
> arch/arm64/kernel/signal.c:663:43: sparse: expected struct user_ctxs [noderef] __user *user
> arch/arm64/kernel/signal.c:663:43: sparse: got struct user_ctxs *
> arch/arm64/kernel/signal.c:933:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void ( [noderef] [usertype] __user *[assigned] [usertype] sigtramp )( ... ) @@ got void * @@
> arch/arm64/kernel/signal.c:933:26: sparse: expected void ( [noderef] [usertype] __user *[assigned] [usertype] sigtramp )( ... )
> arch/arm64/kernel/signal.c:933:26: sparse: got void *
> >> arch/arm64/kernel/signal.c:394:35: sparse: sparse: dereference of noderef expression
> >> arch/arm64/kernel/signal.c:394:35: sparse: sparse: dereference of noderef expression
> arch/arm64/kernel/signal.c:428:53: sparse: sparse: dereference of noderef expression
> arch/arm64/kernel/signal.c:428:53: sparse: sparse: dereference of noderef expression
>
> vim +663 arch/arm64/kernel/signal.c
>
> 47ccb02868cead Dave Martin 2017-06-15 620
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 621 static int restore_sigframe(struct pt_regs *regs,
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 622 struct rt_sigframe __user *sf)
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 623 {
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 624 sigset_t set;
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 625 int i, err;
> 47ccb02868cead Dave Martin 2017-06-15 626 struct user_ctxs user;
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 627
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 628 err = __copy_from_user(&set, &sf->uc.uc_sigmask, sizeof(set));
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 629 if (err == 0)
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 630 set_current_blocked(&set);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 631
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 632 for (i = 0; i < 31; i++)
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 633 __get_user_error(regs->regs[i], &sf->uc.uc_mcontext.regs[i],
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 634 err);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 635 __get_user_error(regs->sp, &sf->uc.uc_mcontext.sp, err);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 636 __get_user_error(regs->pc, &sf->uc.uc_mcontext.pc, err);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 637 __get_user_error(regs->pstate, &sf->uc.uc_mcontext.pstate, err);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 638
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 639 /*
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 640 * Avoid sys_rt_sigreturn() restarting.
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 641 */
> 17c28958600928 Dave Martin 2017-08-01 642 forget_syscall(regs);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 643
> dbd4d7ca563fd0 Mark Rutland 2016-03-01 644 err |= !valid_user_regs(®s->user_regs, current);
> 47ccb02868cead Dave Martin 2017-06-15 645 if (err == 0)
> 47ccb02868cead Dave Martin 2017-06-15 646 err = parse_user_sigframe(&user, sf);
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 647
> 6d502b6ba1b267 Suzuki K Poulose 2020-01-13 648 if (err == 0 && system_supports_fpsimd()) {
> 8cd969d28fd284 Dave Martin 2017-10-31 649 if (!user.fpsimd)
> 8cd969d28fd284 Dave Martin 2017-10-31 650 return -EINVAL;
> 8cd969d28fd284 Dave Martin 2017-10-31 651
> 8cd969d28fd284 Dave Martin 2017-10-31 652 if (user.sve) {
> 8cd969d28fd284 Dave Martin 2017-10-31 653 if (!system_supports_sve())
> 8cd969d28fd284 Dave Martin 2017-10-31 654 return -EINVAL;
> 8cd969d28fd284 Dave Martin 2017-10-31 655
> 8cd969d28fd284 Dave Martin 2017-10-31 656 err = restore_sve_fpsimd_context(&user);
> 8cd969d28fd284 Dave Martin 2017-10-31 657 } else {
> 47ccb02868cead Dave Martin 2017-06-15 658 err = restore_fpsimd_context(user.fpsimd);
> 8cd969d28fd284 Dave Martin 2017-10-31 659 }
> 8cd969d28fd284 Dave Martin 2017-10-31 660 }
> 2c020ed8d148f7 Catalin Marinas 2012-03-05 661
> 39782210eb7e87 Mark Brown 2022-04-19 662 if (err == 0 && system_supports_sme() && user.za)
> 39782210eb7e87 Mark Brown 2022-04-19 @663 err = restore_za_context(&user);
I think the restore_za_context() definition is wrong. struct user_ctxs
__user *user shouldn't have the '__user' annotation, that's for the
pointers inside the structure. So:
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index edb2d9206a78..b0980fbb6bc7 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -385,7 +385,7 @@ static int preserve_za_context(struct za_context __user *ctx)
return err ? -EFAULT : 0;
}
-static int restore_za_context(struct user_ctxs __user *user)
+static int restore_za_context(struct user_ctxs *user)
{
int err;
unsigned int vq;
I'll do some proper patches tomorrow and send them for -rc1.
--
Catalin
3 weeks, 4 days
【JR西日本:Club J-WEST】お客様への重要なお知らせです。
by JR西日本 Club J-WEST事務局
お客様へ
日頃より「JR西日本」をご利用いただきありがとうございます。
「JR西日本」は 2022 年 5 月 28 日(日)にサービスをリニューアルいたしました。これ に伴い、「JR西日本」利用規約・会員規約を変更し、最後にログインをした日より起算し て2年以上「JR西日本」のご利用(ログイン)が確認できない「JR西日本」アカウント は、自動的に退会処理させていただくことといたしました。なお、対象アカウントの自動退 会処理を、本規約に基づき、2022 年 6 月 28 日より順次、実施させていただきます。
24時間以上ログインしておらず、「JR西日本」を使い続けたい場合は、2022年5月28日までに一度ログインしてください。
⇒ログインはこちら
※えきねっとトップページ右上のログインボタンよりログインしてください。
なお、アカウントが退会処理された場合も、新たにアカウント登録(無料登録)していた だくことですぐに「えきねっと」をご利用いただくことができますので、今後もご愛顧いた だけますようよろしくお願いいたします。
Copyright © JR East Net Station Co.,Ltd. All Rights Reserved.
3 weeks, 4 days