]> xenbits.xensource.com Git - xen.git/commitdiff
x86/msr: Definitions for MSR_INTEL_CORE_THREAD_COUNT
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Apr 2019 12:26:30 +0000 (12:26 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 May 2019 14:48:54 +0000 (15:48 +0100)
This is a model specific register which details the current configuration
cores and threads in the package.  Because of how Hyperthread and Core
configuration works works in firmware, the MSR it is de-facto constant and
will remain unchanged until the next system reset.

It is a read only MSR (so unilaterally reject writes), but for now retain its
leaky-on-read properties.  Further CPUID/MSR work is required before we can
start virtualising a consistent topology to the guest, and retaining the old
behaviour is the safest course of action.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit d4120936bcd1695faf5b575f1259c58e31d2b18b)

xen/arch/x86/hvm/hvm.c
xen/arch/x86/traps.c
xen/include/asm-x86/msr-index.h

index 9582950043edfd0e95061625799210d64228c6c0..23d6f09d8a25aef532bcf130386b9c9ad0ffef10 100644 (file)
@@ -4179,6 +4179,7 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
         wrmsrl(MSR_FLUSH_CMD, msr_content);
         break;
 
+    case MSR_INTEL_CORE_THREAD_COUNT:
     case MSR_ARCH_CAPABILITIES:
         /* Read-only */
     case MSR_TSX_FORCE_ABORT:
index 404bdce717f7a7f94856b74b0abbd38c43a5cce1..232d1b05d4a168428fddcee0fdc0a0d522e3234a 100644 (file)
@@ -2744,6 +2744,7 @@ static int priv_op_write_msr(unsigned int reg, uint64_t val,
             wrmsrl(reg, val);
         return X86EMUL_OKAY;
 
+    case MSR_INTEL_CORE_THREAD_COUNT:
     case MSR_INTEL_PLATFORM_INFO:
     case MSR_ARCH_CAPABILITIES:
         /* The MSR is read-only. */
index 29ece6a47e329a6df06ca2fbad5be947f93040b9..54f3a660476ae8ccedb4e7be69e2ef134e7f2073 100644 (file)
 #define EFER_KNOWN_MASK                (EFER_SCE | EFER_LME | EFER_LMA | EFER_NX | \
                                 EFER_SVME | EFER_LMSLE | EFER_FFXSE)
 
+#define MSR_INTEL_CORE_THREAD_COUNT     0x00000035
+#define MSR_CTC_THREAD_MASK             0x0000ffff
+#define MSR_CTC_CORE_MASK               0xffff0000
+
 /* Speculation Controls. */
 #define MSR_SPEC_CTRL                  0x00000048
 #define SPEC_CTRL_IBRS                 (_AC(1, ULL) << 0)