Skip to content

Commit

Permalink
13361 bhyve should mask RDT cpuid info
Browse files Browse the repository at this point in the history
Reviewed by: Andy Fiddaman <andy@omnios.org>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Robert Mustacchi <rm@fingolfin.org>
  • Loading branch information
pfmooney committed Dec 16, 2020
1 parent 3714f7b commit 1a5f187
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions usr/src/uts/i86pc/io/vmm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,24 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx,
}
break;

case CPUID_0000_000F:
case CPUID_0000_0010:
/*
* Do not report any Resource Director Technology
* capabilities. Exposing control of cache or memory
* controller resource partitioning to the guest is not
* at all sensible.
*
* This is already hidden at a high level by masking of
* leaf 0x7. Even still, a guest may look here for
* detailed capability information.
*/
regs[0] = 0;
regs[1] = 0;
regs[2] = 0;
regs[3] = 0;
break;

case CPUID_0000_0015:
/*
* Don't report CPU TSC/Crystal ratio and clock
Expand Down
2 changes: 2 additions & 0 deletions usr/src/uts/i86pc/io/vmm/x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#define CPUID_0000_000A (0xA)
#define CPUID_0000_000B (0xB)
#define CPUID_0000_000D (0xD)
#define CPUID_0000_000F (0xF)
#define CPUID_0000_0010 (0x10)
#define CPUID_0000_0015 (0x15)
#define CPUID_8000_0000 (0x80000000)
#define CPUID_8000_0001 (0x80000001)
Expand Down

0 comments on commit 1a5f187

Please sign in to comment.