本机环境 ARM A53 CPU

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
[root@rk3528-openeuler22 ~]# lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Cortex-A53
Model: 4
Thread(s) per core: 1
Core(s) per cluster: 4
Socket(s): -
Cluster(s): 1
Stepping: r0p4
CPU max MHz: 2016.0000
CPU min MHz: 408.0000
BogoMIPS: 48.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
Vulnerabilities:
Gather data sampling: Not affected
Indirect target selection: 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: Not affected
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Not affected
Srbds: Not affected
Tsx async abort: Not affected
[root@rk3528-openeuler22 ~]#


[root@rk3528-openeuler22 ~]# cat /proc/cpuinfo
processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Serial : 0000000000000000
[root@rk3528-openeuler22 ~]#


[root@rk3528-openeuler22 ~]# cat /sys/devices/system/cpu/cpu0/regs/identification/midr_el1
0x00000000410fd034
[root@rk3528-openeuler22 ~]#

沙盒的进入与退出 演示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@rk3528-openeuler22 ~]# ./enable_kunpeng920
[kp920] enter: 0x00000000481fd010
[kp920] CONAN_HOME: /root/.conan2_kunpeng920
conan remote disable


Welcome to 6.1.141-rk35xx-ophub

System information as of time: Mon May 25 08:21:19 CST 2026

System load: 0.02
Memory used: 41.4%
Swap used: 5.6%
Usage On: 25%
IP address: 192.168.1.1
IP address: 192.168.10.34
Users online: 10


[root@rk3528-openeuler22 ~]# cat /sys/devices/system/cpu/cpu0/regs/identification/midr_el1
0x00000000481fd010
[root@rk3528-openeuler22 ~]# exit
[kp920] exit
[root@rk3528-openeuler22 ~]# cat /sys/devices/system/cpu/cpu0/regs/identification/midr_el1
0x00000000410fd034
[root@rk3528-openeuler22 ~]#

开始搭建 沙盒

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56


[root@rk3528-openeuler22 ~]# cat /tmp/fake_midr_el1
0x00000000481fd010
[root@rk3528-openeuler22 ~]# cat /tmp/fake_cpuinfo
processor : 0
BogoMIPS : 200.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint
CPU implementer : 0x48
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd01
CPU revision : 0
[root@rk3528-openeuler22 ~]# cat enable_kunpeng920
#!/bin/bash
unshare --mount --uts --propagation private bash -c '
hostname kunpeng920-dev
MIDR=/sys/devices/system/cpu/cpu0/regs/identification/midr_el1
set -e
mount --bind /home/kunpeng920/fake_midr_el1 "$MIDR"
mount --bind /home/kunpeng920/fake_cpuinfo /proc/cpuinfo
set +e
export CONAN_HOME=~/.conan2_kunpeng920
echo "[kp920] enter: $(cat $MIDR)"
echo "[kp920] hostname: $(hostname)"
echo "[kp920] CONAN_HOME: $CONAN_HOME"
mkdir -p /root/source_kp920
cd /root/source_kp920
bash
umount "$MIDR"
umount /proc/cpuinfo
echo "[kp920] exit"
'
[root@rk3528-openeuler22 ~]#

源码编译 DPDK
[root@rk3528-openeuler22 ~]# wget https://fast.dpdk.org/rel/dpdk-22.11.11.tar.xz
[root@rk3528-openeuler22 ~]# tar xf dpdk-22.11.11.tar.xz && cd dpdk-stable-22.11.11
[root@rk3528-openeuler22 dpdk]# meson setup build --buildtype=release -Dplatform=native
[root@rk3528-openeuler22 dpdk]# grep -i "tsv110\|machine\|cpu" build/build.ninja | head -5
[root@rk3528-openeuler22 dpdk]# #可以看到 -march=armv8.2-a+crypto -mtune=tsv110
[root@rk3528-openeuler22 dpdk]# ninja -C build

在 ARM A53 上跑会直接 SIGILL。
[root@rk3528-openeuler22 dpdk]# ./build/app/dpdk-testpmd
Illegal instruction (core dumped)
[root@rk3528-openeuler22 dpdk]#

LSE 指令确认存在,鲲鹏920 版本编译成功。
ldadd 和 swpal 都是 ARMv8.1 LSE 专属指令
[root@rk3528-openeuler22 dpdk]# objdump -d build/app/dpdk-testpmd | grep -E "\bldadd\b|\bcasal\b|\bswpal\b|\bstadd\b"
5b375c: f8210086 ldadd x1, x6, [x4]
5b48b8: f8210064 ldadd x1, x4, [x3]
5b57c8: b8230021 ldadd w3, w1, [x1]
5bd14c: f8ff8001 swpal xzr, x1, [x0]
5cbd38: f8e08020 swpal x0, x0, [x1]

其他SHELL 不受影响,CPU标志 维持原样

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Welcome to 6.1.141-rk35xx-ophub

System information as of time: Mon May 25 08:08:44 AM CST 2026

System load: 0.58
Memory used: 41.5%
Swap used: 5.6%
Usage On: 25%
IP address: 192.168.1.1
IP address: 192.168.10.34
Users online: 10


conan remote disable
[root@rk3528-openeuler22 ~]# lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Cortex-A53
Model: 4
Thread(s) per core: 1
Core(s) per cluster: 4
Socket(s): -
Cluster(s): 1
Stepping: r0p4
CPU max MHz: 2016.0000
CPU min MHz: 408.0000
BogoMIPS: 48.00
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
Vulnerabilities:
Gather data sampling: Not affected
Indirect target selection: 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: Not affected
Spectre v1: Mitigation; __user pointer sanitization
Spectre v2: Not affected
Srbds: Not affected
Tsx async abort: Not affected
[root@rk3528-openeuler22 ~]# cat /sys/devices/system/cpu/cpu0/regs/identification/midr_el1
0x00000000410fd034
[root@rk3528-openeuler22 ~]# cat /proc/cpuinfo
processor : 0
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
BogoMIPS : 48.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Serial : 0000000000000000
[root@rk3528-openeuler22 ~]#