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

[XEN PATCH v2 1/5] x86/Kconfig: introduce CENTAUR, HYGON & SHANGHAI config options



These options aim to represent what's currently supported by Xen, and later
to allow tuning for specific platform(s) only.

HYGON and SHANGHAI options depend on AMD and INTEL as there're build
dependencies on support code for AMD and Intel CPUs respectively.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@xxxxxxxx>
CC: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/Kconfig.cpu  | 29 +++++++++++++++++++++++++++++
 xen/arch/x86/cpu/Makefile |  6 +++---
 xen/arch/x86/cpu/common.c |  6 ++++++
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/Kconfig.cpu b/xen/arch/x86/Kconfig.cpu
index 5fb18db1aa..ac8f41d464 100644
--- a/xen/arch/x86/Kconfig.cpu
+++ b/xen/arch/x86/Kconfig.cpu
@@ -10,6 +10,25 @@ config AMD
          May be turned off in builds targetting other vendors.  Otherwise,
          must be enabled for Xen to work suitably on AMD platforms.
 
+config CENTAUR
+       bool "Support Centaur CPUs"
+       default y
+       help
+         Detection, tunings and quirks for VIA platforms.
+
+         May be turned off in builds targeting other vendors. Otherwise, must
+          be enabled for Xen to work suitably on VIA platforms.
+
+config HYGON
+       bool "Support Hygon CPUs"
+       depends on AMD
+       default y
+       help
+         Detection, tunings and quirks for Hygon platforms.
+
+         May be turned off in builds targeting other vendors. Otherwise, must
+          be enabled for Xen to work suitably on Hygon platforms.
+
 config INTEL
        bool "Support Intel CPUs"
        default y
@@ -19,4 +38,14 @@ config INTEL
          May be turned off in builds targetting other vendors.  Otherwise,
          must be enabled for Xen to work suitably on Intel platforms.
 
+config SHANGHAI
+       bool "Support Shanghai CPUs"
+       depends on INTEL
+       default y
+       help
+         Detection, tunings and quirks for Zhaoxin platforms.
+
+         May be turned off in builds targeting other vendors. Otherwise, must
+          be enabled for Xen to work suitably on Zhaoxin platforms.
+
 endmenu
diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
index eafce5f204..80739d0256 100644
--- a/xen/arch/x86/cpu/Makefile
+++ b/xen/arch/x86/cpu/Makefile
@@ -3,13 +3,13 @@ obj-y += microcode/
 obj-y += mtrr/
 
 obj-y += amd.o
-obj-y += centaur.o
+obj-$(CONFIG_CENTAUR) += centaur.o
 obj-y += common.o
-obj-y += hygon.o
+obj-$(CONFIG_HYGON) += hygon.o
 obj-y += intel.o
 obj-y += intel_cacheinfo.o
 obj-y += mwait-idle.o
-obj-y += shanghai.o
+obj-$(CONFIG_SHANGHAI) += shanghai.o
 obj-y += vpmu.o
 obj-$(CONFIG_AMD) += vpmu_amd.o
 obj-$(CONFIG_INTEL) += vpmu_intel.o
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ff4cd22897..dcc2753212 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -339,9 +339,15 @@ void __init early_cpu_init(bool verbose)
        case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
                                  actual_cpu = intel_cpu_dev;    break;
        case X86_VENDOR_AMD:      actual_cpu = amd_cpu_dev;      break;
+#ifdef CONFIG_CENTAUR
        case X86_VENDOR_CENTAUR:  actual_cpu = centaur_cpu_dev;  break;
+#endif
+#ifdef CONFIG_SHANGHAI
        case X86_VENDOR_SHANGHAI: actual_cpu = shanghai_cpu_dev; break;
+#endif
+#ifdef CONFIG_HYGON
        case X86_VENDOR_HYGON:    actual_cpu = hygon_cpu_dev;    break;
+#endif
        default:
                actual_cpu = default_cpu;
                if (!verbose)
-- 
2.25.1




 


Rackspace

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