Bug 19057 - [ANCK6.6.71-3 rc1][aarch64][倚天710机器]kernel-selftests测试套,arm64.tpidr2用例执行失败,报Segmentation fault
Summary: [ANCK6.6.71-3 rc1][aarch64][倚天710机器]kernel-selftests测试套,arm64.tpidr2用例执行失败,报S...
Status: RESOLVED WONTFIX
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: aarch64 Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: lv0322
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-26 13:28 UTC by zhixin01
Modified: 2025-06-26 11:07 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhixin01 alibaba_cloud_group 2025-02-26 13:28:58 UTC
[缺陷描述]:
kernel-selftests测试套,arm64.tpidr2用例执行失败,报Segmentation fault

测试日志:
#./tpidr2
Segmentation fault

[重现概率]:
必现

[重现环境]:
环境信息:倚天710机器
11.163.178.238

#uname -r
6.6.71-3_rc1.al8.aarch64

#cat /etc/os-release
NAME="Alibaba Cloud Linux"
VERSION="3 (Soaring Falcon)"
ID="alinux"
ID_LIKE="rhel fedora centos anolis"
VERSION_ID="3"
UPDATE_ID="10"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"

#lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  128
Socket(s):           1
NUMA node(s):        2
Vendor ID:           ARM
BIOS Vendor ID:      T-HEAD
Model:               0
Model name:          Neoverse-N2
BIOS Model name:     Yitian710-128
Stepping:            r0p0
CPU MHz:             2750.000
BogoMIPS:            100.00
Hypervisor vendor:   Alibaba
Virtualization type: full
L1d cache:           64K
L1i cache:           64K
L2 cache:            1024K
L3 cache:            65536K
NUMA node0 CPU(s):   0-63
NUMA node1 CPU(s):   64-127
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh

#free -h
              total        used        free      shared  buff/cache   available
Mem:          125Gi       3.6Gi       121Gi        12Mi       1.0Gi       122Gi
Swap:         2.0Gi          0B       2.0Gi

#cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/boot/vmlinuz-6.6.71-3_rc1.al8.aarch64 root=UUID=d0af582f-7147-41de-85e3-deb2e14cde99 ro biosdevname=0 rd.driver.pre=ahci iommu.passthrough=1 iommu.strict=0 nospectre_bhb ssbd=force-off systemd.unified_cgroup_hierarchy=0 cgroup.memory=nokmem console=ttyS0,115200 fsck.repair=yes crashkernel=0M-2G:0M,2G-256G:256M,256G-1024G:320M,1024G-:384M

[重现步骤]:
# 下载并编译用例
wget 内核对应src.rpm包(从这里获取https://koji.alibaba-inc.com/taskinfo?taskID=730244)
rpm -ivh xxx.src.rpm 默认安装到/root下
yum install yum-utils
yum-builddep -y /root/rpmbuild/SPECS/kernel.spec 自动安装前置依赖包 需要yum-utils
rpmbuild -bp /root/rpmbuild/SPECS/kernel.spec # 这个步骤会打相关的patch, 解压缩tar包,生成BUILD目录
cd /root/rpmbuild/BUILD/kernel-*/linux-*
make -C tools/testing/selftests/
cd /root/rpmbuild/BUILD/kernel-*/linux-*/tools/testing/selftests/arm64/abi;make
./tpidr2

[期望结果]:
用例执行pass

[实际结果]:
用例执行失败,报Segmentation fault

[原因定位]
根据https://project.aone.alibaba-inc.com/v2/project/797125/bug/60163092,修改编译命令gcc tpidr2.c -include ../../../../include/nolibc/nolibc.h -fno-asynchronous-unwind-tables -fno-ident -s -O0 -g3 -nostdlib -ffreestanding -lc
后,用例在6.6.71-3_rc1.al8.aarch64内核上全部skip

#./a.out
TAP version 13
1..5
# PID: 519310
# SME support not present
ok 0 skipped, TPIDR2 not supported
ok 1 skipped, TPIDR2 not supported
ok 2 skipped, TPIDR2 not supported
ok 3 skipped, TPIDR2 not supported
ok 4 skipped, TPIDR2 not supported
# Totals: pass:0 fail:0 xfail:0 xpass:0 skip:5 error:0
Comment 1 lv0322 alibaba_cloud_group 2025-03-07 14:29:37 UTC
已知问题,段错误发生在main函数之前,为编译器链接错误。使用新的编译命令后命令可以正常skip:gcc tpidr2.c -include ../../../../include/nolibc/nolibc.h -fno-asynchronous-unwind-tables -fno-ident -s -O0 -g3 -nostdlib -ffreestanding -lc。原测试用例中根据/proc/sys/abi/sme_default_vector_length文件是否存在判断跳过用例,系统无该文件,不支持该测试
Comment 2 zhixin01 alibaba_cloud_group 2025-03-11 11:27:00 UTC
按照上述描述,为编译器链接问题,关闭bug单。
Comment 3 yunhe123 alibaba_cloud_group 2025-06-26 11:07:29 UTC
社区ecs环境  6.6.88-cbp.git.1432012a7.an23.aarch64内核上也存在该问题,记录一下,确认不存在/proc/sys/abi/sme_default_vector_length文件,不支持该测试