thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-i386-Add-cache-information-in-X86CPUDefinition.patch

ae23c9
From a05bef7298f7d30da342ef1a3f6d12bb33377fc5 Mon Sep 17 00:00:00 2001
ae23c9
From: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Date: Thu, 26 Jul 2018 17:18:55 +0100
ae23c9
Subject: [PATCH 05/14] i386: Add cache information in X86CPUDefinition
ae23c9
ae23c9
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-id: <20180726171904.27418-3-ehabkost@redhat.com>
ae23c9
Patchwork-id: 81523
ae23c9
O-Subject: [qemu-kvm RHEL8/virt212 PATCH v2 02/11] i386: Add cache information in X86CPUDefinition
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
Add cache information in X86CPUDefinition and CPUX86State.
ae23c9
ae23c9
Signed-off-by: Babu Moger <babu.moger@amd.com>
ae23c9
Tested-by: Geoffrey McRae <geoff@hostfission.com>
ae23c9
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-Id: <20180510204148.11687-3-babu.moger@amd.com>
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
(cherry picked from commit 6aaeb05492ef668f415324f43e7d875c0f1e90b3)
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 | 1 +
ae23c9
 target/i386/cpu.h | 7 +++++++
ae23c9
 2 files changed, 8 insertions(+)
ae23c9
ae23c9
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ae23c9
index 6c57b2f..50af741 100644
ae23c9
--- a/target/i386/cpu.c
ae23c9
+++ b/target/i386/cpu.c
ae23c9
@@ -1105,6 +1105,7 @@ struct X86CPUDefinition {
ae23c9
     int stepping;
ae23c9
     FeatureWordArray features;
ae23c9
     const char *model_id;
ae23c9
+    CPUCaches *cache_info;
ae23c9
 };
ae23c9
 
ae23c9
 static X86CPUDefinition builtin_x86_defs[] = {
ae23c9
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
ae23c9
index fa03e2c..372f8b7 100644
ae23c9
--- a/target/i386/cpu.h
ae23c9
+++ b/target/i386/cpu.h
ae23c9
@@ -1096,6 +1096,12 @@ typedef struct CPUCacheInfo {
ae23c9
 } CPUCacheInfo;
ae23c9
 
ae23c9
 
ae23c9
+typedef struct CPUCaches {
ae23c9
+        CPUCacheInfo l1d_cache;
ae23c9
+        CPUCacheInfo l1i_cache;
ae23c9
+        CPUCacheInfo l2_cache;
ae23c9
+        CPUCacheInfo l3_cache;
ae23c9
+} CPUCaches;
ae23c9
 
ae23c9
 typedef struct CPUX86State {
ae23c9
     /* standard registers */
ae23c9
@@ -1282,6 +1288,7 @@ typedef struct CPUX86State {
ae23c9
     /* Features that were explicitly enabled/disabled */
ae23c9
     FeatureWordArray user_features;
ae23c9
     uint32_t cpuid_model[12];
ae23c9
+    CPUCaches *cache_info;
ae23c9
 
ae23c9
     /* MTRRs */
ae23c9
     uint64_t mtrr_fixed[11];
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9