diff options
| author | Marios Pomonis <pomonis@google.com> | 2025-03-27 01:49:18 -0700 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-03-27 12:43:42 +0000 |
| commit | 6c09fb82edbf8c19be0a3ea3e1e823c8891ee5a1 (patch) | |
| tree | 5a4bd48cb9d43112dc8d91d76be0f2a972beeae6 /executor/common_kvm_arm64.h | |
| parent | 928390c4a3945c24c89a1eb0b5e1fe780dc92617 (diff) | |
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.
Diffstat (limited to 'executor/common_kvm_arm64.h')
| -rw-r--r-- | executor/common_kvm_arm64.h | 5 |
1 files changed, 0 insertions, 5 deletions
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 |
