diff mbox series

[1/2] x86/cpuid: expose MCDT_NO to guests

Message ID 20220513103500.3671-2-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/cpuid: expose MCDT_NO | expand

Commit Message

Roger Pau Monné May 13, 2022, 10:34 a.m. UTC
Expose the MCDT_NO CPUID flag to guests if available.  The bit signals
that the CPU does not exhibit MCDT behavior, and as such can be
exposed without requiring any additional work.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/libs/light/libxl_cpuid.c              | 1 +
 tools/misc/xen-cpuid.c                      | 1 +
 xen/include/public/arch-x86/cpufeatureset.h | 1 +
 3 files changed, 3 insertions(+)

Comments

Andrew Cooper May 13, 2022, 11:06 a.m. UTC | #1
On 13/05/2022 11:34, Roger Pau Monne wrote:
> diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> index d462f9e421..697ee38270 100644
> --- a/tools/libs/light/libxl_cpuid.c
> +++ b/tools/libs/light/libxl_cpuid.c
> @@ -235,6 +235,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
>          {"fsrcs",        0x00000007,  1, CPUID_REG_EAX, 12,  1},
>  
>          {"intel-psfd",   0x00000007,  2, CPUID_REG_EDX,  0,  1},
> +        {"mcdt_no",      0x00000007,  2, CPUID_REG_EDX,  5,  1},

I think we're wanting to prefer "mcdt-no".  Can be fixed on commit.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Roger Pau Monné May 13, 2022, 12:32 p.m. UTC | #2
On Fri, May 13, 2022 at 11:06:01AM +0000, Andrew Cooper wrote:
> On 13/05/2022 11:34, Roger Pau Monne wrote:
> > diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
> > index d462f9e421..697ee38270 100644
> > --- a/tools/libs/light/libxl_cpuid.c
> > +++ b/tools/libs/light/libxl_cpuid.c
> > @@ -235,6 +235,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
> >          {"fsrcs",        0x00000007,  1, CPUID_REG_EAX, 12,  1},
> >  
> >          {"intel-psfd",   0x00000007,  2, CPUID_REG_EDX,  0,  1},
> > +        {"mcdt_no",      0x00000007,  2, CPUID_REG_EDX,  5,  1},
> 
> I think we're wanting to prefer "mcdt-no".  Can be fixed on commit.

I've asked myself whether to use - or _, went with _ because that's
the exact name on the manuals (minus the lowercase).

> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

I'm fine if you want to adjust to - on commit.

Thanks, Roger.
diff mbox series

Patch

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index d462f9e421..697ee38270 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -235,6 +235,7 @@  int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
         {"fsrcs",        0x00000007,  1, CPUID_REG_EAX, 12,  1},
 
         {"intel-psfd",   0x00000007,  2, CPUID_REG_EDX,  0,  1},
+        {"mcdt_no",      0x00000007,  2, CPUID_REG_EDX,  5,  1},
 
         {"lahfsahf",     0x80000001, NA, CPUID_REG_ECX,  0,  1},
         {"cmplegacy",    0x80000001, NA, CPUID_REG_ECX,  1,  1},
diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c
index 0b1b3333fe..bc40aa06ca 100644
--- a/tools/misc/xen-cpuid.c
+++ b/tools/misc/xen-cpuid.c
@@ -203,6 +203,7 @@  static const char *const str_7b1[32] =
 static const char *const str_7d2[32] =
 {
     [ 0] = "intel-psfd",
+    [ 5] = "mcdt_no",
 };
 
 static const struct {
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index 5aa3c82fc6..aa12280f25 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -304,6 +304,7 @@  XEN_CPUFEATURE(INTEL_PPIN,         12*32+ 0) /*   Protected Processor Inventory
 
 /* Intel-defined CPU features, CPUID level 0x00000007:2.edx, word 13 */
 XEN_CPUFEATURE(INTEL_PSFD,         13*32+ 0) /*A  MSR_SPEC_CTRL.PSFD */
+XEN_CPUFEATURE(MCDT_NO,            13*32+ 5) /*A  MCDT_NO */
 
 #endif /* XEN_CPUFEATURE */