Blame SOURCES/kvm-i386-Initialize-cache-information-for-EPYC-family-pr.patch

357786
From 28b619943c16c8015899b0808d844fbcea586487 Mon Sep 17 00:00:00 2001
357786
From: Eduardo Habkost <ehabkost@redhat.com>
357786
Date: Tue, 3 Jul 2018 17:23:49 +0200
357786
Subject: [PATCH 04/89] i386: Initialize cache information for EPYC family
357786
 processors
357786
357786
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
357786
Message-id: <20180703172356.21038-4-ehabkost@redhat.com>
357786
Patchwork-id: 81214
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH v3 03/10] i386: Initialize cache information for EPYC family processors
357786
Bugzilla: 1481253
357786
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
357786
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
357786
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
357786
From: Babu Moger <babu.moger@amd.com>
357786
357786
Initialize pre-determined cache information for EPYC processors.
357786
357786
Signed-off-by: Babu Moger <babu.moger@amd.com>
357786
Tested-by: Geoffrey McRae <geoff@hostfission.com>
357786
Message-Id: <20180510204148.11687-5-babu.moger@amd.com>
357786
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
357786
(cherry picked from commit fe52acd2a054b97765963a42037f2f886545e30c)
357786
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 target/i386/cpu.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
357786
 1 file changed, 52 insertions(+)
357786
357786
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
357786
index 7e81e08..23eb47d 100644
357786
--- a/target/i386/cpu.c
357786
+++ b/target/i386/cpu.c
357786
@@ -1108,6 +1108,56 @@ struct X86CPUDefinition {
357786
     CPUCaches *cache_info;
357786
 };
357786
 
357786
+static CPUCaches epyc_cache_info = {
357786
+    .l1d_cache = {
357786
+        .type = DCACHE,
357786
+        .level = 1,
357786
+        .size = 32 * KiB,
357786
+        .line_size = 64,
357786
+        .associativity = 8,
357786
+        .partitions = 1,
357786
+        .sets = 64,
357786
+        .lines_per_tag = 1,
357786
+        .self_init = 1,
357786
+        .no_invd_sharing = true,
357786
+    },
357786
+    .l1i_cache = {
357786
+        .type = ICACHE,
357786
+        .level = 1,
357786
+        .size = 64 * KiB,
357786
+        .line_size = 64,
357786
+        .associativity = 4,
357786
+        .partitions = 1,
357786
+        .sets = 256,
357786
+        .lines_per_tag = 1,
357786
+        .self_init = 1,
357786
+        .no_invd_sharing = true,
357786
+    },
357786
+    .l2_cache = {
357786
+        .type = UNIFIED_CACHE,
357786
+        .level = 2,
357786
+        .size = 512 * KiB,
357786
+        .line_size = 64,
357786
+        .associativity = 8,
357786
+        .partitions = 1,
357786
+        .sets = 1024,
357786
+        .lines_per_tag = 1,
357786
+    },
357786
+    .l3_cache = {
357786
+        .type = UNIFIED_CACHE,
357786
+        .level = 3,
357786
+        .size = 8 * MiB,
357786
+        .line_size = 64,
357786
+        .associativity = 16,
357786
+        .partitions = 1,
357786
+        .sets = 8192,
357786
+        .lines_per_tag = 1,
357786
+        .self_init = true,
357786
+        .inclusive = true,
357786
+        .complex_indexing = true,
357786
+    },
357786
+};
357786
+
357786
 static X86CPUDefinition builtin_x86_defs[] = {
357786
     {
357786
         /* qemu64 is the default CPU model for all *-rhel7.* machine-types.
357786
@@ -2327,6 +2377,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
357786
             CPUID_6_EAX_ARAT,
357786
         .xlevel = 0x8000000A,
357786
         .model_id = "AMD EPYC Processor",
357786
+        .cache_info = &epyc_cache_info,
357786
     },
357786
     {
357786
         .name = "EPYC-IBPB",
357786
@@ -2373,6 +2424,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
357786
             CPUID_6_EAX_ARAT,
357786
         .xlevel = 0x8000000A,
357786
         .model_id = "AMD EPYC Processor (with IBPB)",
357786
+        .cache_info = &epyc_cache_info,
357786
     },
357786
 };
357786
 
357786
-- 
357786
1.8.3.1
357786