Revision ef4cbe14 target-i386/kvm.c
b/target-i386/kvm.c | ||
---|---|---|
456 | 456 |
uint32_t signature[3]; |
457 | 457 |
int r; |
458 | 458 |
|
459 |
memset(&cpuid_data, 0, sizeof(cpuid_data)); |
|
460 |
|
|
459 | 461 |
cpuid_i = 0; |
460 | 462 |
|
461 | 463 |
/* Paravirtualization CPUIDs */ |
462 | 464 |
c = &cpuid_data.entries[cpuid_i++]; |
463 |
memset(c, 0, sizeof(*c)); |
|
464 | 465 |
c->function = KVM_CPUID_SIGNATURE; |
465 | 466 |
if (!hyperv_enabled(cpu)) { |
466 | 467 |
memcpy(signature, "KVMKVMKVM\0\0\0", 12); |
... | ... | |
474 | 475 |
c->edx = signature[2]; |
475 | 476 |
|
476 | 477 |
c = &cpuid_data.entries[cpuid_i++]; |
477 |
memset(c, 0, sizeof(*c)); |
|
478 | 478 |
c->function = KVM_CPUID_FEATURES; |
479 | 479 |
c->eax = env->features[FEAT_KVM]; |
480 | 480 |
|
... | ... | |
483 | 483 |
c->eax = signature[0]; |
484 | 484 |
|
485 | 485 |
c = &cpuid_data.entries[cpuid_i++]; |
486 |
memset(c, 0, sizeof(*c)); |
|
487 | 486 |
c->function = HYPERV_CPUID_VERSION; |
488 | 487 |
c->eax = 0x00001bbc; |
489 | 488 |
c->ebx = 0x00060001; |
490 | 489 |
|
491 | 490 |
c = &cpuid_data.entries[cpuid_i++]; |
492 |
memset(c, 0, sizeof(*c)); |
|
493 | 491 |
c->function = HYPERV_CPUID_FEATURES; |
494 | 492 |
if (cpu->hyperv_relaxed_timing) { |
495 | 493 |
c->eax |= HV_X64_MSR_HYPERCALL_AVAILABLE; |
... | ... | |
500 | 498 |
} |
501 | 499 |
|
502 | 500 |
c = &cpuid_data.entries[cpuid_i++]; |
503 |
memset(c, 0, sizeof(*c)); |
|
504 | 501 |
c->function = HYPERV_CPUID_ENLIGHTMENT_INFO; |
505 | 502 |
if (cpu->hyperv_relaxed_timing) { |
506 | 503 |
c->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED; |
... | ... | |
511 | 508 |
c->ebx = cpu->hyperv_spinlock_attempts; |
512 | 509 |
|
513 | 510 |
c = &cpuid_data.entries[cpuid_i++]; |
514 |
memset(c, 0, sizeof(*c)); |
|
515 | 511 |
c->function = HYPERV_CPUID_IMPLEMENT_LIMITS; |
516 | 512 |
c->eax = 0x40; |
517 | 513 |
c->ebx = 0x40; |
518 | 514 |
|
519 | 515 |
c = &cpuid_data.entries[cpuid_i++]; |
520 |
memset(c, 0, sizeof(*c)); |
|
521 | 516 |
c->function = KVM_CPUID_SIGNATURE_NEXT; |
522 | 517 |
memcpy(signature, "KVMKVMKVM\0\0\0", 12); |
523 | 518 |
c->eax = 0; |
Also available in: Unified diff