Skip to content

Commit 6c09fb8

Browse files
marpomramosian-glider
authored andcommitted
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.
1 parent 928390c commit 6c09fb8

File tree

4 files changed

+326
-328
lines changed

4 files changed

+326
-328
lines changed

0 commit comments

Comments
 (0)