All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 6/6] x86/ucode: Make struct microcode_patch opaque
Date: Thu, 19 Mar 2020 15:26:22 +0000	[thread overview]
Message-ID: <20200319152622.31758-7-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20200319152622.31758-1-andrew.cooper3@citrix.com>

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(-)

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,
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      parent reply	other threads:[~2020-03-19 15:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 15:26 [Xen-devel] [PATCH 0/6] x86/ucode: Cleanup - Part 1/n Andrew Cooper
2020-03-19 15:26 ` [Xen-devel] [PATCH 1/6] x86/ucode: Remove declarations for non-external functions Andrew Cooper
2020-03-19 15:26 ` [Xen-devel] [PATCH 2/6] x86/ucode: Move microcode into its own directory Andrew Cooper
2020-03-19 15:26 ` [Xen-devel] [PATCH 3/6] x86/ucode: Move interface from processor.h to microcode.h Andrew Cooper
2020-03-19 15:26 ` [Xen-devel] [PATCH 4/6] x86/ucode: Rationalise startup and family/model checks Andrew Cooper
2020-03-20 13:37   ` Jan Beulich
2020-03-20 13:40     ` Andrew Cooper
2020-03-20 13:56       ` Jan Beulich
2020-03-20 14:27         ` Andrew Cooper
2020-03-20 14:48           ` Jan Beulich
2020-03-19 15:26 ` [Xen-devel] [PATCH 5/6] x86/ucode: Alter ops->free_patch() to free the entire patch Andrew Cooper
2020-03-20 13:51   ` Jan Beulich
2020-03-20 14:50     ` Andrew Cooper
2020-03-20 15:15       ` Jan Beulich
2020-03-20 16:10         ` Andrew Cooper
2020-03-20 16:16           ` Jan Beulich
2020-03-20 16:48             ` Andrew Cooper
2020-03-23  7:52               ` Jan Beulich
2020-03-19 15:26 ` Andrew Cooper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200319152622.31758-7-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.