Skip to content

Commit cf1581b

Browse files
authored
Merge pull request #311 from rn/up
vmm: Hide host cpuid 0x15 TSC/Crystal ratio/freq info from guest
2 parents 2f061e4 + 45c0ba1 commit cf1581b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/include/xhyve/vmm/x86.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#define CPUID_0000_000A (0xA)
4141
#define CPUID_0000_000B (0xB)
4242
#define CPUID_0000_000D (0xD)
43+
#define CPUID_0000_0015 (0x15)
4344
#define CPUID_8000_0000 (0x80000000)
4445
#define CPUID_8000_0001 (0x80000001)
4546
#define CPUID_8000_0002 (0x80000002)

src/lib/vmm/x86.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
439439
}
440440
break;
441441

442+
case CPUID_0000_0015:
443+
/*
444+
* Don't report CPU TSC/Crystal ratio and clock
445+
* values since guests may use these to derive the
446+
* local APIC frequency..
447+
*/
448+
regs[0] = 0;
449+
regs[1] = 0;
450+
regs[2] = 0;
451+
regs[3] = 0;
452+
break;
453+
442454
case 0x40000000:
443455
regs[0] = CPUID_VM_HIGH;
444456
bcopy(bhyve_id, &regs[1], 4);

0 commit comments

Comments
 (0)