All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Paul Durrant" <paul.durrant@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v5 04/11] viridian: make 'fields' struct anonymous...
Date: Mon, 11 Mar 2019 13:41:25 +0000	[thread overview]
Message-ID: <20190311134132.20536-5-paul.durrant@citrix.com> (raw)
In-Reply-To: <20190311134132.20536-1-paul.durrant@citrix.com>

...inside viridian_page_msr and viridian_guest_os_id_msr unions.

There's no need to name it and the code is shortened by not doing so.
No functional change.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>

v4:
 - New in v4
---
 xen/arch/x86/hvm/viridian/synic.c    |  4 ++--
 xen/arch/x86/hvm/viridian/time.c     | 10 +++++-----
 xen/arch/x86/hvm/viridian/viridian.c | 20 +++++++++-----------
 xen/include/asm-x86/hvm/viridian.h   |  4 ++--
 4 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
index f3d9f7ae74..05d971b365 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -102,7 +102,7 @@ int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val)
         viridian_unmap_guest_page(&vv->vp_assist);
         vv->vp_assist.msr.raw = val;
         viridian_dump_guest_page(v, "VP_ASSIST", &vv->vp_assist);
-        if ( vv->vp_assist.msr.fields.enabled )
+        if ( vv->vp_assist.msr.enabled )
             viridian_map_guest_page(v, &vv->vp_assist);
         break;
 
@@ -161,7 +161,7 @@ void viridian_synic_load_vcpu_ctxt(
     struct viridian_vcpu *vv = v->arch.hvm.viridian;
 
     vv->vp_assist.msr.raw = ctxt->vp_assist_msr;
-    if ( vv->vp_assist.msr.fields.enabled )
+    if ( vv->vp_assist.msr.enabled )
         viridian_map_guest_page(v, &vv->vp_assist);
 
     vv->apic_assist_pending = ctxt->apic_assist_pending;
diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c
index 76f9612001..909a3fb9e3 100644
--- a/xen/arch/x86/hvm/viridian/time.c
+++ b/xen/arch/x86/hvm/viridian/time.c
@@ -29,16 +29,16 @@ static void dump_reference_tsc(const struct domain *d)
 {
     const union viridian_page_msr *rt = &d->arch.hvm.viridian->reference_tsc;
 
-    if ( !rt->fields.enabled )
+    if ( !rt->enabled )
         return;
 
     printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC: pfn: %lx\n",
-           d->domain_id, (unsigned long)rt->fields.pfn);
+           d->domain_id, (unsigned long)rt->pfn);
 }
 
 static void update_reference_tsc(struct domain *d, bool initialize)
 {
-    unsigned long gmfn = d->arch.hvm.viridian->reference_tsc.fields.pfn;
+    unsigned long gmfn = d->arch.hvm.viridian->reference_tsc.pfn;
     struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
     HV_REFERENCE_TSC_PAGE *p;
 
@@ -151,7 +151,7 @@ int viridian_time_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val)
 
         vd->reference_tsc.raw = val;
         dump_reference_tsc(d);
-        if ( vd->reference_tsc.fields.enabled )
+        if ( vd->reference_tsc.enabled )
             update_reference_tsc(d, true);
         break;
 
@@ -232,7 +232,7 @@ void viridian_time_load_domain_ctxt(
     vd->time_ref_count.val = ctxt->time_ref_count;
     vd->reference_tsc.raw = ctxt->reference_tsc;
 
-    if ( vd->reference_tsc.fields.enabled )
+    if ( vd->reference_tsc.enabled )
         update_reference_tsc(d, false);
 }
 
diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 710470fed7..1a20d68aaf 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -192,7 +192,7 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf,
 
     case 4:
         /* Recommended hypercall usage. */
-        if ( vd->guest_os_id.raw == 0 || vd->guest_os_id.fields.os < 4 )
+        if ( vd->guest_os_id.raw == 0 || vd->guest_os_id.os < 4 )
             break;
         res->a = CPUID4A_RELAX_TIMER_INT;
         if ( viridian_feature_mask(d) & HVMPV_hcall_remote_tlb_flush )
@@ -228,10 +228,8 @@ static void dump_guest_os_id(const struct domain *d)
 
     printk(XENLOG_G_INFO
            "d%d: VIRIDIAN GUEST_OS_ID: vendor: %x os: %x major: %x minor: %x sp: %x build: %x\n",
-           d->domain_id,
-           goi->fields.vendor, goi->fields.os,
-           goi->fields.major, goi->fields.minor,
-           goi->fields.service_pack, goi->fields.build_number);
+           d->domain_id, goi->vendor, goi->os, goi->major, goi->minor,
+           goi->service_pack, goi->build_number);
 }
 
 static void dump_hypercall(const struct domain *d)
@@ -242,12 +240,12 @@ static void dump_hypercall(const struct domain *d)
 
     printk(XENLOG_G_INFO "d%d: VIRIDIAN HYPERCALL: enabled: %x pfn: %lx\n",
            d->domain_id,
-           hg->fields.enabled, (unsigned long)hg->fields.pfn);
+           hg->enabled, (unsigned long)hg->pfn);
 }
 
 static void enable_hypercall_page(struct domain *d)
 {
-    unsigned long gmfn = d->arch.hvm.viridian->hypercall_gpa.fields.pfn;
+    unsigned long gmfn = d->arch.hvm.viridian->hypercall_gpa.pfn;
     struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
     uint8_t *p;
 
@@ -297,7 +295,7 @@ int guest_wrmsr_viridian(struct vcpu *v, uint32_t idx, uint64_t val)
     case HV_X64_MSR_HYPERCALL:
         vd->hypercall_gpa.raw = val;
         dump_hypercall(d);
-        if ( vd->hypercall_gpa.fields.enabled )
+        if ( vd->hypercall_gpa.enabled )
             enable_hypercall_page(d);
         break;
 
@@ -606,17 +604,17 @@ out:
 void viridian_dump_guest_page(const struct vcpu *v, const char *name,
                               const struct viridian_page *vp)
 {
-    if ( !vp->msr.fields.enabled )
+    if ( !vp->msr.enabled )
         return;
 
     printk(XENLOG_G_INFO "%pv: VIRIDIAN %s: pfn: %lx\n",
-           v, name, (unsigned long)vp->msr.fields.pfn);
+           v, name, (unsigned long)vp->msr.pfn);
 }
 
 void viridian_map_guest_page(const struct vcpu *v, struct viridian_page *vp)
 {
     struct domain *d = v->domain;
-    unsigned long gmfn = vp->msr.fields.pfn;
+    unsigned long gmfn = vp->msr.pfn;
     struct page_info *page;
 
     if ( vp->ptr )
diff --git a/xen/include/asm-x86/hvm/viridian.h b/xen/include/asm-x86/hvm/viridian.h
index c562424332..abbbb36092 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -17,7 +17,7 @@ union viridian_page_msr
         uint64_t enabled:1;
         uint64_t reserved_preserved:11;
         uint64_t pfn:48;
-    } fields;
+    };
 };
 
 struct viridian_page
@@ -44,7 +44,7 @@ union viridian_guest_os_id_msr
         uint64_t major:8;
         uint64_t os:8;
         uint64_t vendor:16;
-    } fields;
+    };
 };
 
 struct viridian_time_ref_count
-- 
2.20.1


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

  parent reply	other threads:[~2019-03-11 13:41 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 13:41 [PATCH v5 00/11] viridian: implement more enlightenments Paul Durrant
2019-03-11 13:41 ` [PATCH v5 01/11] viridian: add init hooks Paul Durrant
2019-03-13 12:23   ` Jan Beulich
2019-03-11 13:41 ` [PATCH v5 02/11] viridian: separately allocate domain and vcpu structures Paul Durrant
2019-03-13 12:25   ` Jan Beulich
2019-03-11 13:41 ` [PATCH v5 03/11] viridian: use stack variables for viridian_vcpu and viridian_domain Paul Durrant
2019-03-13 12:33   ` Jan Beulich
2019-03-11 13:41 ` Paul Durrant [this message]
2019-03-13 12:34   ` [PATCH v5 04/11] viridian: make 'fields' struct anonymous Jan Beulich
2019-03-11 13:41 ` [PATCH v5 05/11] viridian: extend init/deinit hooks into synic and time modules Paul Durrant
2019-03-11 13:41 ` [PATCH v5 06/11] viridian: add missing context save helpers " Paul Durrant
2019-03-11 13:41 ` [PATCH v5 07/11] viridian: use viridian_map/unmap_guest_page() for reference tsc page Paul Durrant
2019-03-11 13:41 ` [PATCH v5 08/11] viridian: stop directly calling viridian_time_ref_count_freeze/thaw() Paul Durrant
2019-03-13 12:36   ` Jan Beulich
2019-03-11 13:41 ` [PATCH v5 09/11] viridian: add implementation of synthetic interrupt MSRs Paul Durrant
2019-03-13 13:14   ` Jan Beulich
2019-03-13 13:25     ` Paul Durrant
2019-03-13 14:23       ` Jan Beulich
2019-03-13 14:51         ` Paul Durrant
2019-03-13 16:13     ` Paul Durrant
2019-03-14  7:47       ` Jan Beulich
2019-03-14  8:46         ` Paul Durrant
2019-03-11 13:41 ` [PATCH v5 10/11] viridian: add implementation of synthetic timers Paul Durrant
2019-03-13 13:06   ` Paul Durrant
2019-03-13 14:10     ` Jan Beulich
2019-03-13 14:05   ` Jan Beulich
2019-03-13 14:37     ` Paul Durrant
2019-03-13 15:36       ` Jan Beulich
2019-03-13 15:43         ` Paul Durrant
2019-03-14  9:58       ` Paul Durrant
2019-03-11 13:41 ` [PATCH v5 11/11] viridian: add implementation of the HvSendSyntheticClusterIpi hypercall Paul Durrant
2019-03-13 14:08   ` Jan Beulich

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=20190311134132.20536-5-paul.durrant@citrix.com \
    --to=paul.durrant@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --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.