@@ -1001,16 +1001,33 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w,
#define CPUID_VENDOR_AMD_3 0x444d4163 /* "cAMD" */
#define CPUID_VENDOR_AMD "AuthenticAMD"
+#define CPUID_VENDOR_VIA_1 0x746E6543 /* "Cent" */
+#define CPUID_VENDOR_VIA_2 0x48727561 /* "aurH" */
+#define CPUID_VENDOR_VIA_3 0x736C7561 /* "auls" */
+
+#define CPUID_VENDOR_ZHAOXIN_1 0x68532020 /* " Sh" */
+#define CPUID_VENDOR_ZHAOXIN_2 0x68676E61 /* "angh" */
+#define CPUID_VENDOR_ZHAOXIN_3 0x20206961 /* "ai " */
+
#define CPUID_VENDOR_VIA "CentaurHauls"
#define CPUID_VENDOR_HYGON "HygonGenuine"
+#define CPUID_VENDOR_ZHAOXIN " Shanghai "
+
#define IS_INTEL_CPU(env) ((env)->cpuid_vendor1 == CPUID_VENDOR_INTEL_1 && \
(env)->cpuid_vendor2 == CPUID_VENDOR_INTEL_2 && \
(env)->cpuid_vendor3 == CPUID_VENDOR_INTEL_3)
#define IS_AMD_CPU(env) ((env)->cpuid_vendor1 == CPUID_VENDOR_AMD_1 && \
(env)->cpuid_vendor2 == CPUID_VENDOR_AMD_2 && \
(env)->cpuid_vendor3 == CPUID_VENDOR_AMD_3)
+#define IS_VIA_CPU(env) ((env)->cpuid_vendor1 == CPUID_VENDOR_VIA_1 && \
+ (env)->cpuid_vendor2 == CPUID_VENDOR_VIA_2 && \
+ (env)->cpuid_vendor3 == CPUID_VENDOR_VIA_3)
+#define IS_ZHAOXIN_CPU(env) ((env)->cpuid_vendor1 == CPUID_VENDOR_ZHAOXIN_1 && \
+ (env)->cpuid_vendor2 == CPUID_VENDOR_ZHAOXIN_2 && \
+ (env)->cpuid_vendor3 == CPUID_VENDOR_ZHAOXIN_3)
+
#define CPUID_MWAIT_IBE (1U << 1) /* Interrupts can exit capability */
#define CPUID_MWAIT_EMX (1U << 0) /* enumeration supported */
This patch adds CPUID vendor strings and macros to identify Zhaoxin/VIA CPUs. Changes: - Added Zhaoxin/VIA CPUID vendor strings. - Defined CPUID_VENDOR_ZHAOXIN. - Added IS_ZHAOXIN_CPU/IS_VIA_CPU macro. Signed-off-by: EwanHai <ewanhai-oc@zhaoxin.com> --- target/i386/cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)