Bug 3685 - [anck-4.19-x86_64 nightly ][kernel-selftests] vm.run_vmtests: va_128TBswitch子测试用例mmap flags包含MAP_FIXED时,返回-1 ENOMEM (Cannot allocate memory)
Summary: [anck-4.19-x86_64 nightly ][kernel-selftests] vm.run_vmtests: va_128TBswitch子...
Status: NEW
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: shuancue
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-10 17:06 UTC by wangpingping
Modified: 2023-02-21 14:52 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wangpingping alibaba_cloud_group 2023-01-10 17:06:13 UTC
[缺陷描述]:

已知结论:目前的虚拟化不支持5级页表,在此做记录

kernelself-test:vm.run_vmtests: va_128TBswitch子测试用例mmap flags包含MAP_FIXED时,返回-1 ENOMEM (Cannot allocate memory)


测试日志如下:
-----------------------------
running virtual address 128TB switch test
-----------------------------
mmap(ADDR_SWITCH_HINT - PAGE_SIZE, PAGE_SIZE): 0x7fb8d0703000 - OK
mmap(ADDR_SWITCH_HINT - PAGE_SIZE, (2 * PAGE_SIZE)): 0x7fb8d0700000 - OK
mmap(ADDR_SWITCH_HINT, PAGE_SIZE): 0x7fb8d0703000 - OK
mmap(ADDR_SWITCH_HINT, 2 * PAGE_SIZE, MAP_FIXED): 0xffffffffffffffff - FAILED
mmap(NULL): 0x7fb8d0700000 - OK
mmap(LOW_ADDR): 0x40000000 - OK
mmap(HIGH_ADDR): 0x7fb8d0700000 - OK
mmap(HIGH_ADDR) again: 0x7fb8d06fe000 - OK
mmap(HIGH_ADDR, MAP_FIXED): 0xffffffffffffffff - FAILED
mmap(-1): 0x7fb8d06fc000 - OK
mmap(-1) again: 0x7fb8d06f5000 - OK
mmap(ADDR_SWITCH_HINT - PAGE_SIZE, PAGE_SIZE): 0x7fb8d06fb000 - OK
mmap(ADDR_SWITCH_HINT - PAGE_SIZE, 2 * PAGE_SIZE): 0x7fb8d06f5000 - OK
mmap(ADDR_SWITCH_HINT - PAGE_SIZE/2 , 2 * PAGE_SIZE): 0x7fb8d06f3000 - OK
mmap(ADDR_SWITCH_HINT, PAGE_SIZE): 0x7fb8d06fb000 - OK
mmap(ADDR_SWITCH_HINT, 2 * PAGE_SIZE, MAP_FIXED): 0xffffffffffffffff - FAILED
[FAIL]
not ok 1..1 selftests: vm: run_vmtests [FAIL]

[重现概率]:
必现

[重现环境]:
内核:
# uname -r
4.19.91-255.git.98e6929.an7.x86_64

# cat /etc/os-release
NAME="Anolis OS"
VERSION="7.9"
ID="anolis"
ID_LIKE="rhel fedora centos"
VERSION_ID="7.9"
PRETTY_NAME="Anolis OS 7.9"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugs.openanolis.cn/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

cpu信息:
# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 106
Model name:            Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
Stepping:              6
CPU MHz:               2699.998
BogoMIPS:              5399.99
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             48K
L1i cache:             32K
L2 cache:              1280K
L3 cache:              49152K
NUMA node0 CPU(s):     0-3
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm arch_capabilities

内存信息:
# free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        719M         12G        668K        1.5G         14G
Swap:            0B          0B          0B

[重现步骤]:
1.git clone -q --depth 1 -b devel-4.19 https://gitee.com/anolis/cloud-kernel.git /tmp
2.打补丁
  patch -p1 < pmtu.sh.patch
  patch -p1 < mincore.patch
3.编译
  cd /tmp
  make -C tools/testing/selftests
4.执行用例
  cd tools/testing/selftests/ftrace
  ./ftracetest

[预期结果]:
用例执行成功

[实际结果]:
用例执行失败
Comment 1 zhixin01 alibaba_cloud_group 2023-01-12 13:46:39 UTC
anolis8 4.19 x86_64 nightly有同样的失败
# cat /etc/os-release
NAME="Anolis OS"
VERSION="8.6"
ID="anolis"
ID_LIKE="rhel fedora centos"
VERSION_ID="8.6"
PLATFORM_ID="platform:an8"
PRETTY_NAME="Anolis OS 8.6"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"

# uname -r
4.19.91-263.git.c452e2d70d27.an8.x86_64