[缺陷描述]: kernel-selftests测试arm64/vec-syscfg执行异常,Illegal instruction (core dumped) [重现概率]: 必现 [重现步骤] 1. 下载kernel-6.6.25-2_rc1.an23.src.rpm 2. rpm -i kernel-6.6.25-2_rc1.an23.src.rpm 3. yum-builddep -y /root/rpmbuild/SPECS/kernel.spec rpmbuild -bp /root/rpmbuild/SPECS/kernel.spec cd /root/rpmbuild/BUILD/kernel-6.6.25-2_rc1.an23/linux-6.6.25-2_rc1.an23.aarch64/tools/testing/selftests/arm64 4. make;./vec-syscfg [期望结果]: 用例执行PASS [实际结果]: [root@iZbp143ti4ccpaufkzata6Z arm64]# ./vec-syscfg TAP version 13 1..21 ok 1 SVE default vector length 16 ok 2 SVE minimum vector length 16 ok 3 SVE maximum vector length 16 ok 4 SVE current VL is 16 ok 5 SVE set VL 16 and have VL 16 ok 6 # SKIP SVE only one VL supported ok 7 # SKIP SVE only one VL supported ok 8 # SKIP SVE only one VL supported ok 9 # SKIP SVE only one VL supported Illegal instruction (core dumped) [root@iZbp143ti4ccpaufkzata6Z arm64]# echo $? 132 [实际结果]: 环境信息:云上ecs [root@iZbp143ti4ccpaufkzata6Z breakpoints]# uname -a Linux iZbp143ti4ccpaufkzata6Z 6.6.25-2_rc1.an23.aarch64 #1 SMP PREEMPT_DYNAMIC Thu Apr 11 15:02:38 CST 2024 aarch64 aarch64 aarch64 GNU/Linux [root@iZbp143ti4ccpaufkzata6Z breakpoints]# [root@iZbp143ti4ccpaufkzata6Z breakpoints]# cat /etc/os-release NAME="Anolis OS" VERSION="23" ID="anolis" VERSION_ID="23" PLATFORM_ID="platform:an23" PRETTY_NAME="Anolis OS 23" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" BUG_REPORT_URL="https://bugzilla.openanolis.cn/" [root@iZbp143ti4ccpaufkzata6Z breakpoints]# [root@iZbp143ti4ccpaufkzata6Z breakpoints]# [root@iZbp143ti4ccpaufkzata6Z breakpoints]# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 4.0M 0 4.0M 0% /dev tmpfs 16G 0 16G 0% /dev/shm tmpfs 6.1G 804K 6.1G 1% /run efivarfs 256K 18K 239K 7% /sys/firmware/efi/efivars /dev/nvme0n1p2 40G 13G 27G 33% / tmpfs 16G 3.1M 16G 1% /tmp /dev/nvme0n1p1 500M 6.5M 494M 2% /boot/efi tmpfs 3.1G 4.0K 3.1G 1% /run/user/0 [root@iZbp143ti4ccpaufkzata6Z breakpoints]# [root@iZbp143ti4ccpaufkzata6Z breakpoints]# free -g total used free shared buff/cache available Mem: 30 0 28 0 1 29 Swap: 0 0 0 [root@iZbp143ti4ccpaufkzata6Z breakpoints]# [root@iZbp143ti4ccpaufkzata6Z breakpoints]# cat /proc/cmdline BOOT_IMAGE=(hd0,gpt2)/boot/vmlinuz-6.6.25-2_rc1.an23.aarch64 root=UUID=6424d533-3c41-4ad9-89fa-1d3bf8c49fd3 ro rhgb crashkernel=0M-2G:0M,2G-64G:256M,64G-:384M iommu.passthrough=1 iommu.strict=0 cryptomgr.notests cgroup.memory=nokmem rcupdate.rcu_cpu_stall_timeout=300 quiet selinux=1 console=tty0 biosdevname=0 net.ifnames=0 console=ttyAMA0,115200n8 noibrs nvme_core.io_timeout=4294967295 nvme_core.admin_timeout=4294967295 [root@iZbp143ti4ccpaufkzata6Z breakpoints]# [root@iZbp143ti4ccpaufkzata6Z breakpoints]# lscpu Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Vendor ID: ARM BIOS Vendor ID: Alibaba Cloud Model name: Neoverse-N2 BIOS Model name: virt-rhel7.6.0 CPU @ 2.0GHz BIOS CPU family: 1 Model: 0 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 1 Stepping: r0p0 BogoMIPS: 100.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm 3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm ssbs sb dcpodp sve2 sveaes svepmull svebitperm svesh a3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh Caches (sum of all): L1d: 512 KiB (8 instances) L1i: 512 KiB (8 instances) L2: 8 MiB (8 instances) L3: 64 MiB (1 instance) NUMA: NUMA node(s): 1 NUMA node0 CPU(s): 0-7 Vulnerabilities: Gather data sampling: Not affected Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Reg file data sampling: Not affected Retbleed: Not affected Spec rstack overflow: Not affected Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Spectre v1: Mitigation; __user pointer sanitization Spectre v2: Mitigation; CSV2, BHB Srbds: Not affected Tsx async abort: Not affected
复现流程: 1. 下载kernel-6.6.25-2_rc1.an23.src.rpm 2. rpm -i kernel-6.6.25-2_rc1.an23.src.rpm 3. yum-builddep -y /root/rpmbuild/SPECS/kernel.spec rpmbuild -bp /root/rpmbuild/SPECS/kernel.spec cd /root/rpmbuild/BUILD/kernel-6.6.25-2_rc1.an23/linux-6.6.25-2_rc1.an23.aarch64/ make -C tools/testing/selftests/ 4. cd tools/testing/selftests/arm64/fp; ./vec-syscfg
该用例2023.12.19更新过,出现报错的代码行569左右有修改。用例问题,建议拉取上游最新代码 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/tools/testing/selftests/arm64/fp/vec-syscfg.c?h=v6.9-rc5&id=9a802ddb2123e5adec394d35cd539cc0b15bc830
已合入PR: https://gitee.com/anolis/cloud-kernel/pulls/3182
使用aarch64 ECS环境,安装rc3内核,对rc3 src kernel源码包进行编译,回归验证该问题单case通过 ============================================================ [root@localhost fp]# ./vec-syscfg TAP version 13 1..21 ok 1 SVE default vector length 16 ok 2 SVE minimum vector length 16 ok 3 SVE maximum vector length 16 ok 4 SVE current VL is 16 ok 5 SVE set VL 16 and have VL 16 ok 6 # SKIP SVE only one VL supported ok 7 # SKIP SVE only one VL supported ok 8 # SKIP SVE only one VL supported ok 9 # SKIP SVE only one VL supported ok 10 SVE prctl() set all VLs, 0 errors ok 11 # SKIP SME not supported ok 12 # SKIP SME not supported ok 13 # SKIP SME not supported ok 14 # SKIP SME not supported ok 15 # SKIP SME not supported ok 16 # SKIP SME not supported ok 17 # SKIP SME not supported ok 18 # SKIP SME not supported ok 19 # SKIP SME not supported ok 20 # SKIP SME not supported ok 21 # SKIP change_sve_with_za # Totals: pass:6 fail:0 xfail:0 xpass:0 skip:15 error:0 [root@localhost fp]# echo $? 0 [root@localhost fp]# uname -r 6.6.25-2_rc3.an23.aarch64 [root@localhost fp]# cat /etc/os-release NAME="Anolis OS" VERSION="23" ID="anolis" VERSION_ID="23" PLATFORM_ID="platform:an23" PRETTY_NAME="Anolis OS 23" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" BUG_REPORT_URL="https://bugzilla.openanolis.cn/" [root@localhost fp]# pwd /root/rpmbuild/BUILD/kernel-6.6.25-2_rc3.an23/linux-6.6.25-2_rc3.an23.aarch64/tools/testing/selftests/arm64/fp [root@localhost fp]#
测试回归通过,问题解决关闭。