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/dev_kvm.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/linux/dev_kvm.txt') diff --git a/sys/linux/dev_kvm.txt b/sys/linux/dev_kvm.txt index 59b4b787a..713c6cb40 100644 --- a/sys/linux/dev_kvm.txt +++ b/sys/linux/dev_kvm.txt @@ -299,9 +299,13 @@ define KVM_SETUP_VIRT86 (1<<4) define KVM_SETUP_SMM (1<<5) define KVM_SETUP_VM (1<<6) -kvm_setup_flags_ppc64 = KVM_SETUP_PPC64_LE +kvm_setup_flags_ppc64 = KVM_SETUP_PPC64_LE, KVM_SETUP_PPC64_IR, KVM_SETUP_PPC64_DR, KVM_SETUP_PPC64_PR, KVM_SETUP_PPC64_PID1 define KVM_SETUP_PPC64_LE (1<<0) # Little endian +define KVM_SETUP_PPC64_IR (1<<1) # Paging for instructions +define KVM_SETUP_PPC64_DR (1<<2) # Paging for data +define KVM_SETUP_PPC64_PR (1<<3) # Run with MSR_PR (==usermode) +define KVM_SETUP_PPC64_PID1 (1<<4) # Set PID=1 i.e. not kernel's PID kvm_guest_debug { ctrl flags[kvm_guest_debug_flags, int32] -- cgit mrf-deployment