@@ -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)
{
@@ -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)
@@ -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,
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(-)