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>
};
}
+ /*
+ * 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;