xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 2/2] common/vcpu: Switch v->vcpu_info_mfn to mfn_t
Date: Wed, 15 Feb 2017 17:39:23 +0000	[thread overview]
Message-ID: <1487180363-15825-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1487180363-15825-1-git-send-email-andrew.cooper3@citrix.com>

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>
---
 xen/common/domain.c     | 15 ++++++---------
 xen/include/xen/sched.h |  2 +-
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 05130e2..5b069b9 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -117,7 +117,7 @@ static void vcpu_info_reset(struct vcpu *v)
     v->vcpu_info = ((v->vcpu_id < XEN_LEGACY_MAX_VCPUS)
                     ? (vcpu_info_t *)&shared_info(d, vcpu_info[v->vcpu_id])
                     : &dummy_vcpu_info);
-    v->vcpu_info_mfn = mfn_x(INVALID_MFN);
+    v->vcpu_info_mfn = INVALID_MFN;
 }
 
 struct vcpu *alloc_vcpu(
@@ -1150,7 +1150,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->vcpu_info_mfn != mfn_x(INVALID_MFN) )
+    if ( !mfn_eq(v->vcpu_info_mfn, INVALID_MFN) )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1189,7 +1189,7 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     }
 
     v->vcpu_info = new_info;
-    v->vcpu_info_mfn = page_to_mfn(page);
+    v->vcpu_info_mfn = _mfn(page_to_mfn(page));
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     smp_wmb();
@@ -1208,22 +1208,19 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
 
 /*
  * Unmap the vcpu info page if the guest decided to place it somewhere
- * else. This is used from arch_domain_destroy and domain_soft_reset.
+ * else. This is used from domain_kill() and domain_soft_reset().
  */
 void unmap_vcpu_info(struct vcpu *v)
 {
-    unsigned long mfn;
-
-    if ( v->vcpu_info_mfn == mfn_x(INVALID_MFN) )
+    if ( mfn_eq(v->vcpu_info_mfn, INVALID_MFN) )
         return;
 
-    mfn = v->vcpu_info_mfn;
     unmap_domain_page_global((void *)
                              ((unsigned long)v->vcpu_info & PAGE_MASK));
 
     vcpu_info_reset(v);
 
-    put_page_and_type(mfn_to_page(mfn));
+    put_page_and_type(mfn_to_page(mfn_x(v->vcpu_info_mfn)));
 }
 
 int default_initialise_vcpu(struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index def097e..32893de 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -252,7 +252,7 @@ struct vcpu
     struct waitqueue_vcpu *waitqueue_vcpu;
 
     /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
+    mfn_t            vcpu_info_mfn;
 
     struct evtchn_fifo_vcpu *evtchn_fifo;
 
-- 
2.1.4


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

  reply	other threads:[~2017-02-15 17:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 17:39 [PATCH 1/2] xen/sched.h Whitespace and bool cleanup Andrew Cooper
2017-02-15 17:39 ` Andrew Cooper [this message]
2017-02-16 10:24   ` [PATCH 2/2] common/vcpu: Switch v->vcpu_info_mfn to mfn_t Jan Beulich
2017-02-17  8:47   ` Jan Beulich
2017-02-16 10:23 ` [PATCH 1/2] xen/sched.h Whitespace and bool cleanup 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=1487180363-15825-2-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).