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

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