[6/6] x86/ucode: Make struct microcode_patch opaque
diff mbox series

Message ID 20200319152622.31758-7-andrew.cooper3@citrix.com
State New
Headers show
Series
  • x86/ucode: Cleanup - Part 1/n
Related show

Commit Message

Andrew Cooper March 19, 2020, 3:26 p.m. UTC
This will enforce proper interface discipline in core.c, and allow each driver
to choose its own (better) data layout.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/microcode/amd.c     | 4 ++++
 xen/arch/x86/cpu/microcode/intel.c   | 4 ++++
 xen/arch/x86/cpu/microcode/private.h | 8 +-------
 3 files changed, 9 insertions(+), 7 deletions(-)

Patch
diff mbox series

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 77e582c8e1..99e2449eee 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -73,6 +73,10 @@  struct mpbhdr {
     uint8_t data[];
 };
 
+struct microcode_patch {
+    struct microcode_amd *mc_amd;
+};
+
 /* See comment in start_update() for cases when this routine fails */
 static int collect_cpu_info(struct cpu_signature *csig)
 {
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index 0e6ba50048..5e9c2a9c7f 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -71,6 +71,10 @@  struct extended_sigtable {
     struct extended_signature sigs[0];
 };
 
+struct microcode_patch {
+    struct microcode_intel *mc_intel;
+};
+
 #define DEFAULT_UCODE_DATASIZE  (2000)
 #define MC_HEADER_SIZE          (sizeof(struct microcode_header_intel))
 #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE)
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index 897d32a8e9..e64168a502 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -11,13 +11,7 @@  enum microcode_match_result {
     MIS_UCODE, /* signature mismatched */
 };
 
-struct microcode_patch {
-    union {
-        struct microcode_intel *mc_intel;
-        struct microcode_amd *mc_amd;
-        void *mc;
-    };
-};
+struct microcode_patch; /* Opaque */
 
 struct microcode_ops {
     struct microcode_patch *(*cpu_request_microcode)(const void *buf,