Skip to contentSkip to conversation

hw/core/cpu: Move CacheType to general cpu.h

PATCH In review Zhao Liu 2 participants 2 messages Jun 5, 2025 – Jun 10, 2025

lore
Share & tools
lore

Zhao Liu

author
#0 lore raw

PATCH 1/1 hw/core/cpu: Move CacheType to general cpu.h

I386 has already defined cache types in target/i386/cpu.h.

Move CacheType to hw/core/cpu.h, so that ARM and other architectures could use it.

Cc Alireza Sanaee <[email protected]>

---
This is for Ali's ARM cache topology support:
https://lore.kernel.org/qemu-devel/[email protected]/

(Ali, if maintainer doesn't pick this, you can include this into your
series freely.)

---
 include/hw/core/cpu.h | 6 ++++++
 target/i386/cpu.h     | 6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/core/cpu.h +6 -0
index 1e87f7d393ec..33296a1c080e 100644
@@ -1126,4 +1126,10 @@ extern const VMStateDescription vmstate_cpu_common;
 #define UNASSIGNED_CPU_INDEX -1
 #define UNASSIGNED_CLUSTER_INDEX -1
 
+enum CacheType {
+    DATA_CACHE,
+    INSTRUCTION_CACHE,
+    UNIFIED_CACHE
+};
+
 #endif
target/i386/cpu.h +0 -6
index 1146465c8c62..8efea2ef2686 100644
@@ -1768,12 +1768,6 @@ typedef enum TPRAccess {
 
 /* Cache information data structures: */
 
-enum CacheType {
-    DATA_CACHE,
-    INSTRUCTION_CACHE,
-    UNIFIED_CACHE
-};
-
 typedef struct CPUCacheInfo {
     enum CacheType type;
     uint8_t level;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Zhao Liu

I386 has already defined cache types in target/i386/cpu.h.

Move CacheType to hw/core/cpu.h, so that ARM and other architectures could use it.

Cc Alireza Sanaee <[email protected]>

---
This is for Ali's ARM cache topology support:
https://lore.kernel.org/qemu-devel/[email protected]/

Quoted 6 lines

(Ali, if maintainer doesn't pick this, you can include this into your
series freely.)

---
  include/hw/core/cpu.h | 6 ++++++
  target/i386/cpu.h     | 6 ------
  2 files changed, 6 insertions(+), 6 deletions(-)

and queued, thanks!