diff mbox series

[v2,3/7] x86/mce: bring hypercall subop compat checking in sync again

Message ID 5d53a2e3-716c-2213-96e5-9d37371c482c@suse.com (mailing list archive)
State Superseded
Headers show
Series x86: compat header generation and checking adjustments | expand

Commit Message

Jan Beulich July 1, 2020, 10:26 a.m. UTC
Use a typedef in struct xen_mc also for the two subops "manually"
translated in the handler, just for consistency. No functional
change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Roger Pau Monné July 14, 2020, 11:19 a.m. UTC | #1
On Wed, Jul 01, 2020 at 12:26:54PM +0200, Jan Beulich wrote:
> Use a typedef in struct xen_mc also for the two subops "manually"
> translated in the handler, just for consistency. No functional
> change.

I'm slightly puzzled by the fact that mc_fetch is marked as needs
checking while mc_physcpuinfo is marked as needs translation,
shouldn't both be marked as needing translation? (since both need to
handle a guest pointer using XEN_GUEST_HANDLE)

Thanks, Roger.
Jan Beulich July 14, 2020, 11:47 a.m. UTC | #2
On 14.07.2020 13:19, Roger Pau Monné wrote:
> On Wed, Jul 01, 2020 at 12:26:54PM +0200, Jan Beulich wrote:
>> Use a typedef in struct xen_mc also for the two subops "manually"
>> translated in the handler, just for consistency. No functional
>> change.
> 
> I'm slightly puzzled by the fact that mc_fetch is marked as needs
> checking while mc_physcpuinfo is marked as needs translation,
> shouldn't both be marked as needing translation? (since both need to
> handle a guest pointer using XEN_GUEST_HANDLE)

I guess I'm confused - I see an exclamation mark on both respective
lines in xlat.lst.

Jan
Roger Pau Monné July 14, 2020, 2:31 p.m. UTC | #3
On Tue, Jul 14, 2020 at 01:47:11PM +0200, Jan Beulich wrote:
> On 14.07.2020 13:19, Roger Pau Monné wrote:
> > On Wed, Jul 01, 2020 at 12:26:54PM +0200, Jan Beulich wrote:
> >> Use a typedef in struct xen_mc also for the two subops "manually"
> >> translated in the handler, just for consistency. No functional
> >> change.
> > 
> > I'm slightly puzzled by the fact that mc_fetch is marked as needs
> > checking while mc_physcpuinfo is marked as needs translation,
> > shouldn't both be marked as needing translation? (since both need to
> > handle a guest pointer using XEN_GUEST_HANDLE)
> 
> I guess I'm confused - I see an exclamation mark on both respective

No, I was the one confused, you are right that both are marked as need
translation.

Roger.
Roger Pau Monné July 14, 2020, 2:32 p.m. UTC | #4
On Wed, Jul 01, 2020 at 12:26:54PM +0200, Jan Beulich wrote:
> Use a typedef in struct xen_mc also for the two subops "manually"
> translated in the handler, just for consistency. No functional
> change.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.
Jan Beulich July 15, 2020, 6:27 a.m. UTC | #5
On 14.07.2020 16:31, Roger Pau Monné wrote:
> On Tue, Jul 14, 2020 at 01:47:11PM +0200, Jan Beulich wrote:
>> On 14.07.2020 13:19, Roger Pau Monné wrote:
>>> On Wed, Jul 01, 2020 at 12:26:54PM +0200, Jan Beulich wrote:
>>>> Use a typedef in struct xen_mc also for the two subops "manually"
>>>> translated in the handler, just for consistency. No functional
>>>> change.
>>>
>>> I'm slightly puzzled by the fact that mc_fetch is marked as needs
>>> checking while mc_physcpuinfo is marked as needs translation,
>>> shouldn't both be marked as needing translation? (since both need to
>>> handle a guest pointer using XEN_GUEST_HANDLE)
>>
>> I guess I'm confused - I see an exclamation mark on both respective
> 
> No, I was the one confused, you are right that both are marked as need
> translation.

And just to mention it explicitly - I think the lines could be
dropped, as they look to be there just for documentation (if at
all). The resulting XLAT_* macros don't get used anywhere.

Jan
diff mbox series

Patch

--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1307,16 +1307,16 @@  CHECK_mcinfo_common;
 
 CHECK_FIELD_(struct, mc_fetch, flags);
 CHECK_FIELD_(struct, mc_fetch, fetch_id);
-# define CHECK_compat_mc_fetch       struct mc_fetch
+# define CHECK_mc_fetch              struct mc_fetch
 
 CHECK_FIELD_(struct, mc_physcpuinfo, ncpus);
-# define CHECK_compat_mc_physcpuinfo struct mc_physcpuinfo
+# define CHECK_mc_physcpuinfo        struct mc_physcpuinfo
 
 # define xen_ctl_bitmap              xenctl_bitmap
 
 CHECK_mc;
-# undef CHECK_compat_mc_fetch
-# undef CHECK_compat_mc_physcpuinfo
+# undef CHECK_mc_fetch
+# undef CHECK_mc_physcpuinfo
 # undef xen_ctl_bitmap
 
 # define xen_mc_info                 mc_info
--- a/xen/include/public/arch-x86/xen-mca.h
+++ b/xen/include/public/arch-x86/xen-mca.h
@@ -391,6 +391,7 @@  struct xen_mc_physcpuinfo {
     /* OUT */
     XEN_GUEST_HANDLE(xen_mc_logical_cpu_t) info;
 };
+typedef struct xen_mc_physcpuinfo xen_mc_physcpuinfo_t;
 
 #define XEN_MC_msrinject    4
 #define MC_MSRINJ_MAXMSRS       8
@@ -436,9 +437,9 @@  struct xen_mc {
     uint32_t cmd;
     uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */
     union {
-        struct xen_mc_fetch        mc_fetch;
+        xen_mc_fetch_t             mc_fetch;
         xen_mc_notifydomain_t      mc_notifydomain;
-        struct xen_mc_physcpuinfo  mc_physcpuinfo;
+        xen_mc_physcpuinfo_t       mc_physcpuinfo;
         xen_mc_msrinject_t         mc_msrinject;
         xen_mc_mceinject_t         mc_mceinject;
 #if defined(__XEN__) || defined(__XEN_TOOLS__)