From 1a5f1879be09d3de900b2510692dd12003784d84 Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Thu, 10 Dec 2020 22:40:37 +0000 Subject: [PATCH] 13361 bhyve should mask RDT cpuid info Reviewed by: Andy Fiddaman Reviewed by: Toomas Soome Approved by: Robert Mustacchi --- usr/src/uts/i86pc/io/vmm/x86.c | 18 ++++++++++++++++++ usr/src/uts/i86pc/io/vmm/x86.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/usr/src/uts/i86pc/io/vmm/x86.c b/usr/src/uts/i86pc/io/vmm/x86.c index 7b155af3c3ea..8a52e1898ea6 100644 --- a/usr/src/uts/i86pc/io/vmm/x86.c +++ b/usr/src/uts/i86pc/io/vmm/x86.c @@ -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 diff --git a/usr/src/uts/i86pc/io/vmm/x86.h b/usr/src/uts/i86pc/io/vmm/x86.h index 29d51cfe0290..f3459e4f8a22 100644 --- a/usr/src/uts/i86pc/io/vmm/x86.h +++ b/usr/src/uts/i86pc/io/vmm/x86.h @@ -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)