aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sys/linux')
-rw-r--r--sys/linux/socket_vnet.txt2
-rw-r--r--sys/linux/test/arm64-syz_kvm_setup_syzos_vm-vgicv3-its30
2 files changed, 31 insertions, 1 deletions
diff --git a/sys/linux/socket_vnet.txt b/sys/linux/socket_vnet.txt
index f2629fc9e..ed9b5e513 100644
--- a/sys/linux/socket_vnet.txt
+++ b/sys/linux/socket_vnet.txt
@@ -171,7 +171,7 @@ vhost_features = VHOST_LOG_ALL, VIRTIO_NOTIFY_ON_EMPTY, VIRTIO_RING_F_INDIRECT_D
vhost_vring_index = VSOCK_VQ_RX, VSOCK_VQ_TX, VSOCK_VQ_EVENT, VSOCK_VQ_MAX
vhost_iotlb_type = VHOST_IOTLB_MISS, VHOST_IOTLB_UPDATE, VHOST_IOTLB_INVALIDATE, VHOST_IOTLB_ACCESS_FAIL
vhost_iotlb_perm = VHOST_ACCESS_RO, VHOST_ACCESS_WO, VHOST_ACCESS_RW
-kvm_guest_addrs = 0, 1, 2, 4, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0xd000, 0xf000, 0x10000, 0x100000, 0x8000000, 0x80a0000, 0xdddd0000, 0xdddd1000, 0xeeee0000, 0xeeee8000, 0xeeef0000, 0xffff1000
+kvm_guest_addrs = 0, 1, 2, 4, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0xd000, 0xf000, 0x10000, 0x100000, 0x8000000, 0x8080000, 0x80a0000, 0xdddd0000, 0xdddd1000, 0xeeee0000, 0xeeee8000, 0xeeef0000, 0xffff1000
define VHOST_LOG_ALL 1 << VHOST_F_LOG_ALL
define VIRTIO_NOTIFY_ON_EMPTY 1 << VIRTIO_F_NOTIFY_ON_EMPTY
diff --git a/sys/linux/test/arm64-syz_kvm_setup_syzos_vm-vgicv3-its b/sys/linux/test/arm64-syz_kvm_setup_syzos_vm-vgicv3-its
new file mode 100644
index 000000000..c1f151c8a
--- /dev/null
+++ b/sys/linux/test/arm64-syz_kvm_setup_syzos_vm-vgicv3-its
@@ -0,0 +1,30 @@
+#
+# requires: arch=arm64
+#
+r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0)
+r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0)
+r2 = syz_kvm_setup_syzos_vm(r1)
+r3 = syz_kvm_add_vcpu(r2, &AUTO={0x0, &AUTO=[@irq_setup={AUTO, AUTO, {0x1, 0x20}}], AUTO}, 0x0, 0x0)
+syz_kvm_vgic_v3_setup(r1, 0x1, 0x100)
+
+#
+# Set up ITS device with redistributor at address 0x08080000 (declared at executor/kvm.h)
+# Create KVM_DEV_TYPE_ARM_VGIC_ITS.
+#
+ioctl$KVM_CREATE_DEVICE(r1, AUTO, &AUTO={0x8, <r4=>0xffffffffffffffff, 0x0})
+#
+# Set device attribute {KVM_DEV_ARM_VGIC_GRP_CTRL, KVM_DEV_ARM_VGIC_CTRL_INIT, 0}.
+#
+ioctl$KVM_SET_DEVICE_ATTR(r4, AUTO, &AUTO=@attr_arm64={0x0, 0x4, 0x0, 0x0})
+#
+# Set device attribute {KVM_DEV_ARM_VGIC_GRP_ADDR, KVM_VGIC_ITS_ADDR_TYPE, &addr=0x08080000}.
+#
+ioctl$KVM_SET_DEVICE_ATTR(r4, AUTO, &AUTO=@attr_arm64={0x0, 0x0, 0x4, &AUTO=0x08080000})
+
+ioctl$KVM_RUN(r3, AUTO, 0x0)
+#
+# Calling KVM_RUN here again would result in infinite loop.
+# Instead, signal SPI 32 (0x1000020), so that the guest can execute another uexit in the IRQ handler.
+#
+ioctl$KVM_IRQ_LINE(r1, AUTO, &AUTO={0x1000020, 0x1})
+ioctl$KVM_RUN(r3, AUTO, 0x0)