ARM64上开启MTE

简介: ARM64上开启MTE

参考

软件版本

Qemu:8.0.0

Linux:6.5

GCC: 13.2.1

内核配置

参考arch/arm64/Kconfig:

  • CONFIG_ARM64_AS_HAS_MTE: 当编译器支持memtag时,这个宏辉自动设置
  • CONFIG_ARM64_MTE: 需要手动配置,默认就是y

Qemu启动参数

示例:

sudo /home/pengdl/work/Qemu_env/qemu-8.0.0/build/bin/qemu-system-aarch64 \
        -M virt,gic-version=3,virtualization=on,type=virt,mte=on \
        -cpu max -nographic -m 16G \
        -smp 16 \
        -object memory-backend-ram,id=mem0,size=8G  \
        -object memory-backend-ram,id=mem1,size=8G  \
        -numa node,memdev=mem0,cpus=0-7,nodeid=0 \
        -numa node,memdev=mem1,cpus=8-15,nodeid=1 \
        -kernel ./linux-6.5/arch/arm64/boot/Image.gz \
        -append "noinitrd root=/dev/vda rootfstype=ext4 rw console=ttyAMA0 crashkernel=256M" \
        -nographic \
        -netdev user,id=eth0,hostfwd=tcp::8080-:22 -device virtio-net-device,netdev=eth0 \
        -fsdev local,security_model=passthrough,id=fsdev0,path=/home/pengdl/work/Qemu_env/aarch64/share \
        -device virtio-9p-pci,id=fs1,fsdev=fsdev0,mount_tag=hostshare \
        -drive if=none,format=qcow2,file=/home/pengdl/work/Qemu_env/aarch64/qcow2/slave1.qcow2,id=hd0 \
        -device virtio-blk-device,drive=hd0 \

在内核启动日志中可以看到:

[    0.000000][    T0] Detected PIPT I-cache on CPU0
[    0.000000][    T0] CPU features: detected: Address authentication (architected QARMA5 algorithm)
[    0.000000][    T0] CPU features: detected: GIC system register CPU interface
[    0.000000][    T0] CPU features: detected: HCRX_EL2 register
[    0.000000][    T0] CPU features: detected: Virtualization Host Extensions
[    0.000000][    T0] CPU features: detected: Hardware dirty bit management
[    0.000000][    T0] CPU features: detected: Memory Tagging Extension
[    0.000000][    T0] CPU features: detected: Asymmetric MTE Tag Check Fault
[    0.000000][    T0] CPU features: detected: Spectre-v4
[    0.000000][    T0] MTE: enabled in synchronous mode at EL1
[    0.000000][    T0] alternatives: applying boot alternatives
[    0.000000][    T0] kasan: KernelAddressSanitizer initialized (hw-tags, mode=sync, vmalloc=on, stacktrace=on)
# cat /proc/cpuinfo
...
processor       : 15
BogoMIPS        : 125.00
Features        : 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 ilrcpc flagm ssbs sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svef32mm svef64mm svebf16 i8mm bf16 dgh rng bti mte mte3 sme smei16i64 smef64f64 smei8i32 smef16f32 smeb16f32 smef32f32 smefa64
CPU implementer : 0x00
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0x051
CPU revision    : 0
相关文章
|
6月前
|
安全 Go 开发工具
PC的ARM的安全启动
PC的ARM的安全启动
163 0
|
缓存 监控 安全
ARM工作模式
ARM工作模式
283 0
|
缓存 安全 测试技术
ARM深入理解-AArch64启动过程
ARM深入理解-AArch64启动过程
|
IDE 编译器 开发工具
添加DSP库启用arm_math.h
添加DSP库启用arm_math.h
792 0
|
Linux
linux查看是否开启超线程
我们知道intel的cpu拥有超线程技术,可以为一个逻辑核心开启两个处理线程。通过查看物理CPU数,每个CPU的逻辑核数,CPU线程数可以得知是否开启了超线程。 物理CPU数 [root@localhost daxiang]# cat /proc/cpuinfo | grep "physica...
4255 0
|
芯片
LINUX-内核-中断分析-中断向量表(3)-arm【转】
转自:http://blog.csdn.net/haolianglh/article/details/51986987 arm中断概念 在《ARM体系结构与编程》第9章中说到,ARM 中有个概念叫做“异常中断”,也就是包括外部中断在内的各种异常。
1755 0