Patchwork [3/3] target-i386: add Haswell CPU model

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 14, 2012, 6:28 p.m.
Message ID <1352917734-13213-4-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/198970/
State New
Headers show

Comments

Eduardo Habkost - Nov. 14, 2012, 6:28 p.m.
Features added to the model, in relation to SandyBridge:

fma       CPUID[1].ECX[12]
pcid      CPUID[1].ECX[17]
movbe     CPUID[1].ECX[22]
fsgsbase  CPUID[EAX=7,ECX=0].EBX[0]
bmi1      CPUID[EAX=7,ECX=0].EBX[3]
hle       CPUID[EAX=7,ECX=0].EBX[4]
avx2      CPUID[EAX=7,ECX=0].EBX[5]
smep      CPUID[EAX=7,ECX=0].EBX[7]
bmi2      CPUID[EAX=7,ECX=0].EBX[8]
erms      CPUID[EAX=7,ECX=0].EBX[9]
invpcid   CPUID[EAX=7,ECX=0].EBX[10]
rtm       CPUID[EAX=7,ECX=0].EBX[11]

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: donald.d.dugger@intel.com

 target-i386/cpu.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
Igor Mammedov - Nov. 15, 2012, 2:14 a.m.
On Wed, 14 Nov 2012 16:28:54 -0200
Eduardo Habkost <ehabkost@redhat.com> wrote:

> Features added to the model, in relation to SandyBridge:
> 
> fma       CPUID[1].ECX[12]
> pcid      CPUID[1].ECX[17]
> movbe     CPUID[1].ECX[22]
> fsgsbase  CPUID[EAX=7,ECX=0].EBX[0]
> bmi1      CPUID[EAX=7,ECX=0].EBX[3]
> hle       CPUID[EAX=7,ECX=0].EBX[4]
> avx2      CPUID[EAX=7,ECX=0].EBX[5]
> smep      CPUID[EAX=7,ECX=0].EBX[7]
> bmi2      CPUID[EAX=7,ECX=0].EBX[8]
> erms      CPUID[EAX=7,ECX=0].EBX[9]
> invpcid   CPUID[EAX=7,ECX=0].EBX[10]
> rtm       CPUID[EAX=7,ECX=0].EBX[11]
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: donald.d.dugger@intel.com
> 
>  target-i386/cpu.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index c3aff4f..64c3491 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -647,6 +647,35 @@ static x86_def_t builtin_x86_defs[] = {
>          .model_id = "Intel Xeon E312xx (Sandy Bridge)",
>      },
>      {
> +        .name = "Haswell",
> +        .level = 0xd,
> +        .vendor1 = CPUID_VENDOR_INTEL_1,
> +        .vendor2 = CPUID_VENDOR_INTEL_2,
> +        .vendor3 = CPUID_VENDOR_INTEL_3,
> +        .family = 6,
> +        .model = 60,
> +        .stepping = 1,
> +        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
> +             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
> +             CPUID_PGE | CPUID_MTRR | CPUID_APIC | CPUID_CX8 |
> +             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
> +             CPUID_DE | CPUID_FP87,
> +        .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,
> +        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
> +        .ext3_features = CPUID_EXT3_LAHF_LM,
> +        .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,
> +        .xlevel = 0x8000000A,
> +        .model_id = "Intel Core Processor (Haswell)",
> +    },
> +    {
>          .name = "Opteron_G1",
>          .level = 5,
>          .vendor1 = CPUID_VENDOR_AMD_1,
> -- 
> 1.7.11.7
> 
> 
Reviewed-By: Igor Mammedov <imammedo@redhat.com>

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index c3aff4f..64c3491 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -647,6 +647,35 @@  static x86_def_t builtin_x86_defs[] = {
         .model_id = "Intel Xeon E312xx (Sandy Bridge)",
     },
     {
+        .name = "Haswell",
+        .level = 0xd,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 60,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA |
+             CPUID_PGE | CPUID_MTRR | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .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,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL,
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .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,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Core Processor (Haswell)",
+    },
+    {
         .name = "Opteron_G1",
         .level = 5,
         .vendor1 = CPUID_VENDOR_AMD_1,