[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86/msr: Shorten ARCH_CAPABILITIES_* constants


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 18 Mar 2019 11:45:48 +0000
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 18 Mar 2019 11:46:11 +0000
  • Ironport-data: A9a23:UvAew6/yGXcgDICAlvZcDrVtTnXEy5fSOkUsvf70Rtq/9PdXBk+Bh4 oc9ODGeayUATon79+XTzKq7CJ3hnFX/xW4wwD4AHA656oJKE50Hqp4wWZDZ3Wx3pC01iowP5 F+1fT5BtGZ/gPXiJy9TFYdTjkGn8GRe6NicSeUsMBmycaE42VB8qNbpNQveCi2qlnJXs52hp o9irGbRhUNBEuGBEBRH2nssSDA/MbWN2jxp5ZZuaSqAn7dmRi7d85+r40u7YCOZMMzlOqBdN mh10mX6uY/BZYh2HseVYvWR3IoBLI6JeykXlK/8+i756UPZUFhcJ6zrIRD1+ZxfdltZnjYjV pfCvwOYCpdcWsXXIo18jt3DuoywUOr1aUdVsDn9p0r9HHEylF6NXM9T5jWkgUmg4UD5KierU ELlhbgzy3djbR4p0fRdIAebVPiUEPrbuRhjQHS16CAuVGu8mH995ggQ9lBkxNfm0xEY7/+wE yYcnk8VYoFeYe4PmjI4owhXmdLKCxsNEe+/Ojf9JVyE91zxPIhYvRa5s9WZkcvXPoP008fCl PYY8jxxvUljq75KyMk0XNcOyeGVWGpcEdS1VBiX6J7ks4GV+NlZb6TFvHA76oekUSSJHrfA3 dk3zJ+BKhrXZfaqjrhkphrAuBqWSwfGefBqt9f2CImAxN1hAXqv4azYebiBJ7JVTECA4QgpP siTiOk22nHcB164XEupg6PPgvR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kDDiXcWjtBBK1a+GUdvZaoTgpgww==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

They are unnecesserily verbose, and ARCH_CAPS_* is already the more common
version.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/spec_ctrl.c        | 10 +++++-----
 xen/include/asm-x86/msr-index.h |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index ad72ecd..22bfc5a 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -230,8 +230,8 @@ static void __init print_details(enum ind_thunk thunk, 
uint64_t caps)
            (_7d0 & cpufeat_mask(X86_FEATURE_L1D_FLUSH)) ? " L1D_FLUSH" : "",
            (_7d0 & cpufeat_mask(X86_FEATURE_SSBD))  ? " SSBD"      : "",
            (e8b  & cpufeat_mask(X86_FEATURE_IBPB))  ? " IBPB"      : "",
-           (caps & ARCH_CAPABILITIES_IBRS_ALL)      ? " IBRS_ALL"  : "",
-           (caps & ARCH_CAPABILITIES_RDCL_NO)       ? " RDCL_NO"   : "",
+           (caps & ARCH_CAPS_IBRS_ALL)              ? " IBRS_ALL"  : "",
+           (caps & ARCH_CAPS_RDCL_NO)               ? " RDCL_NO"   : "",
            (caps & ARCH_CAPS_RSBA)                  ? " RSBA"      : "",
            (caps & ARCH_CAPS_SKIP_L1DFL)            ? " SKIP_L1DFL": "",
            (caps & ARCH_CAPS_SSB_NO)                ? " SSB_NO"    : "");
@@ -549,7 +549,7 @@ static __init void l1tf_calculations(uint64_t caps)
     }
 
     /* Any processor advertising RDCL_NO should be not vulnerable to L1TF. */
-    if ( caps & ARCH_CAPABILITIES_RDCL_NO )
+    if ( caps & ARCH_CAPS_RDCL_NO )
         cpu_has_bug_l1tf = false;
 
     if ( cpu_has_bug_l1tf && hit_default )
@@ -613,9 +613,9 @@ int8_t __read_mostly opt_xpti_domu = -1;
 static __init void xpti_init_default(uint64_t caps)
 {
     if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
-        caps = ARCH_CAPABILITIES_RDCL_NO;
+        caps = ARCH_CAPS_RDCL_NO;
 
-    if ( caps & ARCH_CAPABILITIES_RDCL_NO )
+    if ( caps & ARCH_CAPS_RDCL_NO )
     {
         if ( opt_xpti_hwdom < 0 )
             opt_xpti_hwdom = 0;
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index c6e1d87..11512d4 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -42,8 +42,8 @@
 #define PRED_CMD_IBPB                  (_AC(1, ULL) << 0)
 
 #define MSR_ARCH_CAPABILITIES          0x0000010a
-#define ARCH_CAPABILITIES_RDCL_NO      (_AC(1, ULL) << 0)
-#define ARCH_CAPABILITIES_IBRS_ALL     (_AC(1, ULL) << 1)
+#define ARCH_CAPS_RDCL_NO              (_AC(1, ULL) << 0)
+#define ARCH_CAPS_IBRS_ALL             (_AC(1, ULL) << 1)
 #define ARCH_CAPS_RSBA                 (_AC(1, ULL) << 2)
 #define ARCH_CAPS_SKIP_L1DFL           (_AC(1, ULL) << 3)
 #define ARCH_CAPS_SSB_NO               (_AC(1, ULL) << 4)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.