cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

ae23c9
From 15a2a3aa1c4eb2c3abac569a120714425b64864d Mon Sep 17 00:00:00 2001
ae23c9
From: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Date: Thu, 26 Jul 2018 17:18:56 +0100
ae23c9
Subject: [PATCH 06/14] i386: Initialize cache information for EPYC family
ae23c9
 processors
ae23c9
ae23c9
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-id: <20180726171904.27418-4-ehabkost@redhat.com>
ae23c9
Patchwork-id: 81527
ae23c9
O-Subject: [qemu-kvm RHEL8/virt212 PATCH v2 03/11] i386: Initialize cache information for EPYC family processors
ae23c9
Bugzilla: 1597739
ae23c9
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
ae23c9
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ae23c9
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
ae23c9
ae23c9
From: Babu Moger <babu.moger@amd.com>
ae23c9
ae23c9
Initialize pre-determined cache information for EPYC processors.
ae23c9
ae23c9
Signed-off-by: Babu Moger <babu.moger@amd.com>
ae23c9
Tested-by: Geoffrey McRae <geoff@hostfission.com>
ae23c9
Message-Id: <20180510204148.11687-5-babu.moger@amd.com>
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
(cherry picked from commit fe52acd2a054b97765963a42037f2f886545e30c)
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 target/i386/cpu.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
ae23c9
 1 file changed, 52 insertions(+)
ae23c9
ae23c9
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ae23c9
index 50af741..bd0abc2 100644
ae23c9
--- a/target/i386/cpu.c
ae23c9
+++ b/target/i386/cpu.c
ae23c9
@@ -1108,6 +1108,56 @@ struct X86CPUDefinition {
ae23c9
     CPUCaches *cache_info;
ae23c9
 };
ae23c9
 
ae23c9
+static CPUCaches epyc_cache_info = {
ae23c9
+    .l1d_cache = {
ae23c9
+        .type = DCACHE,
ae23c9
+        .level = 1,
ae23c9
+        .size = 32 * KiB,
ae23c9
+        .line_size = 64,
ae23c9
+        .associativity = 8,
ae23c9
+        .partitions = 1,
ae23c9
+        .sets = 64,
ae23c9
+        .lines_per_tag = 1,
ae23c9
+        .self_init = 1,
ae23c9
+        .no_invd_sharing = true,
ae23c9
+    },
ae23c9
+    .l1i_cache = {
ae23c9
+        .type = ICACHE,
ae23c9
+        .level = 1,
ae23c9
+        .size = 64 * KiB,
ae23c9
+        .line_size = 64,
ae23c9
+        .associativity = 4,
ae23c9
+        .partitions = 1,
ae23c9
+        .sets = 256,
ae23c9
+        .lines_per_tag = 1,
ae23c9
+        .self_init = 1,
ae23c9
+        .no_invd_sharing = true,
ae23c9
+    },
ae23c9
+    .l2_cache = {
ae23c9
+        .type = UNIFIED_CACHE,
ae23c9
+        .level = 2,
ae23c9
+        .size = 512 * KiB,
ae23c9
+        .line_size = 64,
ae23c9
+        .associativity = 8,
ae23c9
+        .partitions = 1,
ae23c9
+        .sets = 1024,
ae23c9
+        .lines_per_tag = 1,
ae23c9
+    },
ae23c9
+    .l3_cache = {
ae23c9
+        .type = UNIFIED_CACHE,
ae23c9
+        .level = 3,
ae23c9
+        .size = 8 * MiB,
ae23c9
+        .line_size = 64,
ae23c9
+        .associativity = 16,
ae23c9
+        .partitions = 1,
ae23c9
+        .sets = 8192,
ae23c9
+        .lines_per_tag = 1,
ae23c9
+        .self_init = true,
ae23c9
+        .inclusive = true,
ae23c9
+        .complex_indexing = true,
ae23c9
+    },
ae23c9
+};
ae23c9
+
ae23c9
 static X86CPUDefinition builtin_x86_defs[] = {
ae23c9
     {
ae23c9
         /* qemu64 is the default CPU model for all *-rhel7.* machine-types.
ae23c9
@@ -2327,6 +2377,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
ae23c9
             CPUID_6_EAX_ARAT,
ae23c9
         .xlevel = 0x8000000A,
ae23c9
         .model_id = "AMD EPYC Processor",
ae23c9
+        .cache_info = &epyc_cache_info,
ae23c9
     },
ae23c9
     {
ae23c9
         .name = "EPYC-IBPB",
ae23c9
@@ -2373,6 +2424,7 @@ static X86CPUDefinition builtin_x86_defs[] = {
ae23c9
             CPUID_6_EAX_ARAT,
ae23c9
         .xlevel = 0x8000000A,
ae23c9
         .model_id = "AMD EPYC Processor (with IBPB)",
ae23c9
+        .cache_info = &epyc_cache_info,
ae23c9
     },
ae23c9
 };
ae23c9
 
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9