From a0fbb62d9577118fda219fbd475f5ea3d08ea303 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Tue, 13 Jul 2021 16:13:04 +1000 Subject: executor/common_kvm_ppc64: run with enabled MMU This sets up a page table to map the text in order to exercise more code paths in the KVM. This defines flags to control the MMU state. When enabled, this creates a simple page table at the 64K offset and maps all the RAM. The fuzzer code is placed right after the table. The flags are: IR - enables MMU for instruction fetches DR - enables MMU for data loads/stores PR - "problem state", i.e. userspace (implies DR and IR) PID1 - initializes a process table for PID>0 (PID#0 is used by the VM OS normally) This adds a simple "syz_kvm_setup_cpu_ppc64" syz-test with MSR=IR|DR|LE which is a typical Linux kernel mode. Signed-off-by: Alexey Kardashevskiy --- sys/linux/test/syz_kvm_setup_cpu_ppc64le | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sys/linux/test/syz_kvm_setup_cpu_ppc64le (limited to 'sys/linux/test') diff --git a/sys/linux/test/syz_kvm_setup_cpu_ppc64le b/sys/linux/test/syz_kvm_setup_cpu_ppc64le new file mode 100644 index 000000000..4ced5673e --- /dev/null +++ b/sys/linux/test/syz_kvm_setup_cpu_ppc64le @@ -0,0 +1,8 @@ +# +# requires: arch=ppc64le +# +r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) +r1 = ioctl$KVM_CREATE_VM(r0, 0x2000ae01, 0x0) +r2 = ioctl$KVM_CREATE_VCPU(r1, 0x2000ae41, 0x0) +syz_kvm_setup_cpu$ppc64(r1, r2, &(0x7f0000fe8000/0x180000)=nil, &(0x7f0000000000)=[{0x0, &(0x7f0000001000)="0000a03c0000a560c607a578ad0ba564dec0a560782ba47c7823837c", 0x1c}], 0x1, 0x7, 0x0, 0x0) +ioctl$KVM_RUN(r2, 0x2000ae80, 0x0) -- cgit mrf-deployment