qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC qom-cpu v2 2/2] target-i386: Turn Haswell into subclas


From: Andreas Färber
Subject: [Qemu-devel] [RFC qom-cpu v2 2/2] target-i386: Turn Haswell into subclass of SandyBridge
Date: Mon, 10 Dec 2012 23:59:32 +0100

  ehabkost: "When adding the Haswell CPU model, I intended to make it
  a superset of the features present on the SandyBridge model"

Inherit from SandyBridge to keep only the delta for Haswell.

Signed-off-by: Andreas Färber <address@hidden>
Cc: Eduardo Habkost <address@hidden>
---
 target-i386/cpu.c |   24 ++----------------------
 1 Datei geändert, 2 Zeilen hinzugefügt(+), 22 Zeilen entfernt(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index c59c6a5..ffd160a 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -814,39 +814,19 @@ static void haswell_cpu_class_init(ObjectClass *oc, void 
*data)
 {
     X86CPUClass *xcc = X86_CPU_CLASS(oc);
 
-    xcc->level = 0xd;
-    xcc->vendor1 = CPUID_VENDOR_INTEL_1;
-    xcc->vendor2 = CPUID_VENDOR_INTEL_2;
-    xcc->vendor3 = CPUID_VENDOR_INTEL_3;
-    xcc->family = 6;
     xcc->model = 60;
-    xcc->stepping = 1;
-    xcc->features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
-             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
-             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
-             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
-             CPUID_DE | CPUID_FP87;
-    xcc->ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
-             CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 |
-             CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
-             CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 |
-             CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_FMA | CPUID_EXT_MOVBE |
-             CPUID_EXT_PCID;
-    xcc->ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX |
-             CPUID_EXT2_SYSCALL;
-    xcc->ext3_features = CPUID_EXT3_LAHF_LM;
+    xcc->ext_features |= CPUID_EXT_FMA | CPUID_EXT_MOVBE | CPUID_EXT_PCID;
     xcc->cpuid_7_0_ebx_features = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 |
             CPUID_7_0_EBX_HLE | CPUID_7_0_EBX_AVX2 | CPUID_7_0_EBX_SMEP |
             CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID |
             CPUID_7_0_EBX_RTM;
-    xcc->xlevel = 0x8000000A;
     pstrcpy(xcc->model_id, sizeof(xcc->model_id),
             "Intel Core Processor (Haswell)");
 }
 
 static const TypeInfo haswell_cpu_type_info = {
     .name = TYPE("Haswell"),
-    .parent = TYPE_X86_CPU,
+    .parent = TYPE("SandyBridge"),
     .class_init = haswell_cpu_class_init,
 };
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]