diff options
| author | Alexander Potapenko <glider@google.com> | 2024-08-06 14:59:07 +0200 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2024-08-07 16:00:37 +0000 |
| commit | f89fe08c7227fc4fa4bc40ab8d0e1eacca6c20f0 (patch) | |
| tree | 34d74e658913731252b27f9eb1dc25063bd26d35 /sys/linux/test | |
| parent | 0020fc2034b4113f0e6c59ba408795e2b63d5e43 (diff) | |
executor: arm64: add SYZOS_API_SMC
Provide an API call to invoke the ARM64 Secure Monitor Call instruction
with user-supplied function id and 5 parameters passed in registers x1-x5.
For now only `smc #0` is invoked, although in the future we may want to
pass other (reserved) immediate values to SMC.
Diffstat (limited to 'sys/linux/test')
| -rw-r--r-- | sys/linux/test/syz_kvm_setup_cpu_arm64-smc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/linux/test/syz_kvm_setup_cpu_arm64-smc b/sys/linux/test/syz_kvm_setup_cpu_arm64-smc new file mode 100644 index 000000000..77588b1cb --- /dev/null +++ b/sys/linux/test/syz_kvm_setup_cpu_arm64-smc @@ -0,0 +1,15 @@ +# +# requires: arch=arm64 +# +r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) +r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0) +# +# KVM_SET_DEVICE_ATTR: group=KVM_ARM_VM_SMCCC_CTRL, attr=KVM_ARM_VM_SMCCC_FILTER +# Filter: base=0xef000000, nr_functions=0x1000, action=KVM_SMCCC_FILTER_FWD_TO_USER +# (Per SMC Calling Convention, 0xef000000-0xef001000 is an SMC64 fast call reserved range) +# +ioctl$KVM_SET_DEVICE_ATTR_vm(r1, AUTO, &AUTO=@attr_arm64={0x0, 0x0, 0x0, &AUTO={0xef000000, 0x1000, 0x2, ""}}) + +r2 = ioctl$KVM_CREATE_VCPU(r1, AUTO, 0x0) +syz_kvm_setup_cpu$arm64(r1, r2, &(0x7f0000e8a000/0x18000)=nil, &AUTO=[{0x0, &AUTO=[@smc={AUTO, AUTO, 0xef000000, [0x0, 0x1, 0x2, 0x3, 0x4]}], AUTO}], 0x1, 0x0, 0x0, 0x0) +ioctl$KVM_RUN(r2, AUTO, 0x0) |
