mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-06 13:41:44 +00:00
kvm: Set up MAXPHYADDR guest CPUID
As explained by Avi Kivity, we need to set up MAXPHYADDR for the guest to avoid a triple fault when the guest tries to enter long mode. This fixes the KVM_EXIT_SHUTDOWN problem I was seeing on my machine. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This commit is contained in:
committed by
Will Deacon
parent
f01944c845
commit
342d95c20a
@@ -195,6 +195,17 @@ void kvm__setup_cpuid(struct kvm *self)
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to set up MAXPHYADDR; otherwise switching to long mode in the
|
||||
* guest will triple fault.
|
||||
*/
|
||||
if (highest_ext <= 0x80000008) {
|
||||
kvm_cpuid->entries[ndx++] = (struct kvm_cpuid_entry2) {
|
||||
.function = 0x80000008,
|
||||
.eax = 0x00003028, /* 64-bit CPU */
|
||||
};
|
||||
}
|
||||
|
||||
assert(ndx < MAX_KVM_CPUID_ENTRIES);
|
||||
|
||||
kvm_cpuid->nent = ndx;
|
||||
|
||||
Reference in New Issue
Block a user