Lines 1385-1390
identify_hypervisor_cpuid_base(void)
Link Here
|
1385 |
regs[0] = leaf + 1; |
1385 |
regs[0] = leaf + 1; |
1386 |
|
1386 |
|
1387 |
if (regs[0] >= leaf) { |
1387 |
if (regs[0] >= leaf) { |
|
|
1388 |
enum VM_GUEST prev_vm_guest = vm_guest; |
1389 |
|
1388 |
for (i = 0; i < nitems(vm_cpuids); i++) |
1390 |
for (i = 0; i < nitems(vm_cpuids); i++) |
1389 |
if (strncmp((const char *)®s[1], |
1391 |
if (strncmp((const char *)®s[1], |
1390 |
vm_cpuids[i].vm_cpuid, 12) == 0) { |
1392 |
vm_cpuids[i].vm_cpuid, 12) == 0) { |
Lines 1397-1403
identify_hypervisor_cpuid_base(void)
Link Here
|
1397 |
* specific hypervisor, record the base, high value, |
1399 |
* specific hypervisor, record the base, high value, |
1398 |
* and vendor identifier. |
1400 |
* and vendor identifier. |
1399 |
*/ |
1401 |
*/ |
1400 |
if (vm_guest != VM_GUEST_VM || leaf == 0x40000000) { |
1402 |
if (vm_guest != prev_vm_guest || leaf == 0x40000000) { |
1401 |
hv_base = leaf; |
1403 |
hv_base = leaf; |
1402 |
hv_high = regs[0]; |
1404 |
hv_high = regs[0]; |
1403 |
((u_int *)&hv_vendor)[0] = regs[1]; |
1405 |
((u_int *)&hv_vendor)[0] = regs[1]; |
Lines 1409-1415
identify_hypervisor_cpuid_base(void)
Link Here
|
1409 |
* If we found a specific hypervisor, then |
1411 |
* If we found a specific hypervisor, then |
1410 |
* we are finished. |
1412 |
* we are finished. |
1411 |
*/ |
1413 |
*/ |
1412 |
if (vm_guest != VM_GUEST_VM) |
1414 |
if (vm_guest != VM_GUEST_VM && |
|
|
1415 |
/* |
1416 |
* Xen and other hypervisors can expose the |
1417 |
* HyperV signature in addition to the |
1418 |
* native one in order to support Viridian |
1419 |
* extensions for Windows guests. |
1420 |
* |
1421 |
* Do the full cpuid scan if HyperV is |
1422 |
* detected, as the native hypervisor is |
1423 |
* preferred. |
1424 |
*/ |
1425 |
vm_guest != VM_GUEST_HV) |
1413 |
return; |
1426 |
return; |
1414 |
} |
1427 |
} |
1415 |
} |
1428 |
} |
1416 |
- |
|
|