From 6c09fb82edbf8c19be0a3ea3e1e823c8891ee5a1 Mon Sep 17 00:00:00 2001 From: Marios Pomonis Date: Thu, 27 Mar 2025 01:49:18 -0700 Subject: executor/kvm: bug fix and minor refactor in KVM * Fixes a bug when setting up a 64-bit guest by making the bit manipulation macros produce unsigned long long: To create a VCPU that has paging enabled, one needs to set the CR0.PE and CR0.PG bits in CR0. The latter is problematic when setting up a 64-bit guest since if the macro is not using 1ULL, it sign extends the output (in 64-bit mode the control registers are extended to 64-bits with some of the CR0[32:63] bits reserved). This results in either failing the KVM_SET_SREGS ioctl (in newer kernel versions) or just failing the KVM_RUN ioctl with EXIT_REASON_INVALID_STATE. * Moved the bit manipulation definitions from the amd64 specific to the generic kvm header to consolidate them with the already existing ones. Prefixed them with X86_ to avoid confusion. --- executor/common_kvm_arm64.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'executor/common_kvm_arm64.h') diff --git a/executor/common_kvm_arm64.h b/executor/common_kvm_arm64.h index 6feec78ab..97a6429fe 100644 --- a/executor/common_kvm_arm64.h +++ b/executor/common_kvm_arm64.h @@ -10,11 +10,6 @@ #if SYZ_EXECUTOR || __NR_syz_kvm_setup_cpu || __NR_syz_kvm_add_vcpu || __NR_syz_kvm_setup_syzos_vm #include "common_kvm_arm64_syzos.h" - -#define KVM_MAX_VCPU 4 -#define KVM_PAGE_SIZE (4 << 10) -#define KVM_GUEST_MEM_SIZE (1024 * KVM_PAGE_SIZE) - #endif #if SYZ_EXECUTOR || __NR_syz_kvm_setup_cpu || __NR_syz_kvm_add_vcpu -- cgit mrf-deployment