Revision bb44e0d1 target-i386/kvm.c
b/target-i386/kvm.c | ||
---|---|---|
1525 | 1525 |
return 1; |
1526 | 1526 |
} |
1527 | 1527 |
|
1528 |
static bool host_supports_vmx(void) |
|
1529 |
{ |
|
1530 |
uint32_t ecx, unused; |
|
1531 |
|
|
1532 |
host_cpuid(1, 0, &unused, &unused, &ecx, &unused); |
|
1533 |
return ecx & CPUID_EXT_VMX; |
|
1534 |
} |
|
1535 |
|
|
1536 |
#define VMX_INVALID_GUEST_STATE 0x80000021 |
|
1537 |
|
|
1528 | 1538 |
int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run) |
1529 | 1539 |
{ |
1540 |
uint64_t code; |
|
1530 | 1541 |
int ret = 0; |
1531 | 1542 |
|
1532 | 1543 |
switch (run->exit_reason) { |
... | ... | |
1537 | 1548 |
case KVM_EXIT_SET_TPR: |
1538 | 1549 |
ret = 1; |
1539 | 1550 |
break; |
1551 |
case KVM_EXIT_FAIL_ENTRY: |
|
1552 |
code = run->fail_entry.hardware_entry_failure_reason; |
|
1553 |
fprintf(stderr, "KVM: entry failed, hardware error 0x%" PRIx64 "\n", |
|
1554 |
code); |
|
1555 |
if (host_supports_vmx() && code == VMX_INVALID_GUEST_STATE) { |
|
1556 |
fprintf(stderr, |
|
1557 |
"\nIf you're runnning a guest on an Intel machine without " |
|
1558 |
"unrestricted mode\n" |
|
1559 |
"support, the failure can be most likely due to the guest " |
|
1560 |
"entering an invalid\n" |
|
1561 |
"state for Intel VT. For example, the guest maybe running " |
|
1562 |
"in big real mode\n" |
|
1563 |
"which is not supported on less recent Intel processors." |
|
1564 |
"\n\n"); |
|
1565 |
} |
|
1566 |
ret = -1; |
|
1567 |
break; |
|
1568 |
case KVM_EXIT_EXCEPTION: |
|
1569 |
fprintf(stderr, "KVM: exception %d exit (error code 0x%x)\n", |
|
1570 |
run->ex.exception, run->ex.error_code); |
|
1571 |
ret = -1; |
|
1572 |
break; |
|
1540 | 1573 |
default: |
1541 | 1574 |
fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason); |
1542 | 1575 |
ret = -1; |
Also available in: Unified diff