Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307883
b: refs/heads/master
c: 9b72d3b
h: refs/heads/master
i:
  307881: 9486594
  307879: 68e0847
v: v3
  • Loading branch information
Gleb Natapov authored and Avi Kivity committed May 6, 2012
1 parent 8ae6104 commit 83d906b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57c22e5f35aa4b9b2fe11f73f3e62bbf9ef36190
refs/heads/master: 9b72d3b07dd99ac8ab2b84de5004a295af460536
18 changes: 10 additions & 8 deletions trunk/arch/x86/include/asm/kvm_para.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,16 @@ static inline int kvm_para_available(void)
unsigned int eax, ebx, ecx, edx;
char signature[13];

cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx);
memcpy(signature + 0, &ebx, 4);
memcpy(signature + 4, &ecx, 4);
memcpy(signature + 8, &edx, 4);
signature[12] = 0;

if (strcmp(signature, "KVMKVMKVM") == 0)
return 1;
if (cpu_has_hypervisor) {
cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx);
memcpy(signature + 0, &ebx, 4);
memcpy(signature + 4, &ecx, 4);
memcpy(signature + 8, &edx, 4);
signature[12] = 0;

if (strcmp(signature, "KVMKVMKVM") == 0)
return 1;
}

return 0;
}
Expand Down

0 comments on commit 83d906b

Please sign in to comment.