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>,
	Jan Beulich <JBeulich@suse.com>
Subject: [PATCH] hvm/hpet: Alter hpet_init() to take a domain rather than vcpu
Date: Fri, 25 Jul 2014 14:19:13 +0100	[thread overview]
Message-ID: <1406294353-3692-1-git-send-email-andrew.cooper3@citrix.com> (raw)

There is nothing vcpu-specific about hpet_init(); all it does is follow the
vcpu's domain pointer to get at the domain vhpet state.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>

---

Despite the comment in scope in hvm_vcpu_initialise(), the call can't
currently be moved to hvm_domain_initialise() as the extra hpet_deinit() (in
an error path) needs an allocated vcpu which wouldn't be present at that
point.  I need more tuits to disentangle that mess.
---
 xen/arch/x86/hvm/hpet.c       |    6 +++---
 xen/arch/x86/hvm/hvm.c        |    2 +-
 xen/include/asm-x86/hvm/vpt.h |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 167994e..81ad0d6 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -611,9 +611,9 @@ static int hpet_load(struct domain *d, hvm_domain_context_t *h)
 
 HVM_REGISTER_SAVE_RESTORE(HPET, hpet_save, hpet_load, 1, HVMSR_PER_DOM);
 
-void hpet_init(struct vcpu *v)
+void hpet_init(struct domain *d)
 {
-    HPETState *h = vcpu_vhpet(v);
+    HPETState *h = domain_vhpet(d);
     int i;
 
     memset(h, 0, sizeof(HPETState));
@@ -665,7 +665,7 @@ void hpet_deinit(struct domain *d)
 void hpet_reset(struct domain *d)
 {
     hpet_deinit(d);
-    hpet_init(d->vcpu[0]);
+    hpet_init(d);
 }
 
 /*
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 51011ea..14db6dc 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2282,7 +2282,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
     {
         /* NB. All these really belong in hvm_domain_initialise(). */
         pmtimer_init(v);
-        hpet_init(v);
+        hpet_init(d);
  
         /* Init guest TSC to start from zero. */
         hvm_set_guest_tsc(v, 0);
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 41159d8..105fbdb 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -190,7 +190,7 @@ void pmtimer_deinit(struct domain *d);
 void pmtimer_reset(struct domain *d);
 int pmtimer_change_ioport(struct domain *d, unsigned int version);
 
-void hpet_init(struct vcpu *v);
+void hpet_init(struct domain *d);
 void hpet_deinit(struct domain *d);
 void hpet_reset(struct domain *d);
 
-- 
1.7.10.4

             reply	other threads:[~2014-07-25 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 13:19 Andrew Cooper [this message]
2014-07-25 15:19 ` [PATCH] hvm/hpet: Alter hpet_init() to take a domain rather than vcpu Jan Beulich
2014-07-25 15:38   ` Andrew Cooper

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=1406294353-3692-1-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --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).