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

[PATCH v2 2/2] x86/Kconfig: Introduce CONFIG_{AMD,INTEL} and conditionalise ucode


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 26 Oct 2023 21:55:39 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>
  • Delivery-date: Thu, 26 Oct 2023 20:56:02 +0000
  • Ironport-data: A9a23:nwJj5q0+a5YDdLiYIfbD5e1xkn2cJEfYwER7XKvMYLTBsI5bpzQHm mFKWmvTa/jfZWXxKdgja4iw8RlUuJfcmoJnTAFlpC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliOfQAOK6UbaYUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb83uDgNyo4GlD5wRkO6gR1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfPSJJ+ OAaEhUxaDPEpbO6h4K5ZeN8r5F2RCXrFNt3VnBIyDjYCbAtQIzZQrWM7thdtNsyrpkQR7CEP ZNfMGc+KkuYC/FMEg5/5JYWteGknHTgNRZfr0qYv/Ef6GnP1g1hlrPqNbI5f/TTH5QIwBjE+ T2uE2LRJhEeNoKu2T2/ylX2xfefjAjEYd1CLejtnhJtqALKnTFCYPEMbnOrrP/8hkOgVtZ3L 00P5jFovaU07FasTNT2Q1u/unHsljw2VsdUEuY6wBqQ0aeS6AGcbkAbShZRZdpgs9U5LRQxy lKHltXuQydzubeYTXac8La8pDa+fyMSKAcqdSICTAJD+dDsoYg/hxHIU/5qFaLzhdrwcQwc2 BjT8nJ43e9Ky5dWhuPkpTgrng5AuLD1DQk4+gfte16jzURbNYLiV46H40jyuKMowJmicrWRg JQVs5HAvbBUXMjRznzlrPYlRu/zu6jfWNHIqRs/R8N/qm7FF2uLJ9g43d1oGKt+3i/okxfCZ 1XavUtq/IVSOnSxBUOcS9nqU5tzpUQM+M6Maxw1UjatSsIoHON/1HsyDXN8Jki0+KTWrYkxO I2AbeGnBmsABKJswVKeHrlMgeR3m3pumDiLHfgXKihLNpLHOxaopUotagPSPojVEovYyOkqz zqvH5TTkEgOOAEPSiLW7ZQSPTg3wYsTXPjLRzhsXrfbeGJOQTh5Y9eImO9JRmCQt/kM/gs+1 irmAREwJZuWrSCvFDhmnVg6M+61Bcsm/SpiVcHuVH7xs0UejU+UxP93X/MKkXMPrYSPEdYco yE5Rvi9
  • Ironport-hdrordr: A9a23:Xwc3Sq9EJonF2v+kAIZuk+AcI+orL9Y04lQ7vn2ZKSY5TiX4rb HKoB1/73XJYVkqN03I9ervBEDiewK/yXcW2+ks1N6ZNWGLhILBFupfBODZsl7d8kPFl9K01c 1bAtJD4N+bNykGsS4tijPIb+rJw7O8gd+Vbf+19QYIcenzAZsQlzuQDGygYypLbTgDP7UVPr yG6PFKojKxEE5nFfhSVhE+Lo7+T8SgruOeXSI7
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

We eventually want to be able to build a stripped down Xen for a single
platform.  Make a start with CONFIG_{AMD,INTEL} (hidden behind EXPERT, but
available to randconfig), and adjust the microcode logic.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
CC: Stefano Stabellini <stefano.stabellini@xxxxxxx>
CC: Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>

I've intentionally ignored the other vendors for now.  They can be put into
Kconfig by whomever figures out the actual dependencies between their init
routines.

v2:
 * Tweak text
---
 xen/arch/x86/Kconfig                 |  2 ++
 xen/arch/x86/Kconfig.cpu             | 22 ++++++++++++++++++++++
 xen/arch/x86/cpu/microcode/Makefile  |  4 ++--
 xen/arch/x86/cpu/microcode/private.h |  9 +++++++++
 4 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 xen/arch/x86/Kconfig.cpu

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index eac77573bd75..d9eacdd7e0fa 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -49,6 +49,8 @@ config HAS_CC_CET_IBT
 
 menu "Architecture Features"
 
+source "arch/x86/Kconfig.cpu"
+
 source "arch/Kconfig"
 
 config PV
diff --git a/xen/arch/x86/Kconfig.cpu b/xen/arch/x86/Kconfig.cpu
new file mode 100644
index 000000000000..3c5d88fdfd16
--- /dev/null
+++ b/xen/arch/x86/Kconfig.cpu
@@ -0,0 +1,22 @@
+menu "Supported CPU vendors"
+       visible if EXPERT
+
+config AMD
+       bool "AMD"
+        default y
+        help
+          Detection, tunings and quirks for AMD platforms.
+
+         May be turned off in builds targetting other vendors.  Otherwise,
+         must be enabled for Xen to work suitably on AMD platforms.
+
+config INTEL
+       bool "Intel"
+        default y
+        help
+          Detection, tunings and quirks for Intel platforms.
+
+         May be turned off in builds targetting other vendors.  Otherwise,
+         must be enabled for Xen to work suitably on Intel platforms.
+
+endmenu
diff --git a/xen/arch/x86/cpu/microcode/Makefile 
b/xen/arch/x86/cpu/microcode/Makefile
index aae235245b06..30d600544f45 100644
--- a/xen/arch/x86/cpu/microcode/Makefile
+++ b/xen/arch/x86/cpu/microcode/Makefile
@@ -1,3 +1,3 @@
-obj-y += amd.o
+obj-$(CONFIG_AMD) += amd.o
 obj-y += core.o
-obj-y += intel.o
+obj-$(CONFIG_INTEL) += intel.o
diff --git a/xen/arch/x86/cpu/microcode/private.h 
b/xen/arch/x86/cpu/microcode/private.h
index b58611e908aa..da556fe5060a 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -70,7 +70,16 @@ struct microcode_ops {
  * support available) and (not) ops->apply_microcode (i.e. read only).
  * Otherwise, all hooks must be filled in.
  */
+#ifdef CONFIG_AMD
 void ucode_probe_amd(struct microcode_ops *ops);
+#else
+static inline void ucode_probe_amd(struct microcode_ops *ops) {}
+#endif
+
+#ifdef CONFIG_INTEL
 void ucode_probe_intel(struct microcode_ops *ops);
+#else
+static inline void ucode_probe_intel(struct microcode_ops *ops) {}
+#endif
 
 #endif /* ASM_X86_MICROCODE_PRIVATE_H */
-- 
2.30.2




 


Rackspace

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