xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH] xen: Fix BUFIOREQ evtchn init for a stubdom.
Date: Tue, 26 Jun 2012 11:45:24 +0100	[thread overview]
Message-ID: <1340707524-27665-1-git-send-email-anthony.perard@citrix.com> (raw)

This is a missing part from the previous patch that add the BUFIOREQ_EVTCHN
parameter. This patch changes the ownership of the buifioreq event channel to
the stubdom (when HVM_PARAM_DM_DOMAIN is set within the stubdom).

This fix the initialization of QEMU inside the stubdomain.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

---
 xen/arch/x86/hvm/hvm.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e0d495d..9ff1ded 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3788,6 +3788,22 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
                     /* xchg() ensures that only we free_xen_event_channel() */
                     old_port = xchg(&v->arch.hvm_vcpu.xen_port, new_port);
                     free_xen_event_channel(v, old_port);
+
+                    if ( v->vcpu_id == 0 )
+                    {
+                        new_port = alloc_unbound_xen_event_channel(
+                            v, a.value, NULL);
+                        if ( new_port < 0 )
+                        {
+                            rc = new_port;
+                            break;
+                        }
+                        old_port = xchg(
+                            &v->domain->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN],
+                            new_port);
+                        free_xen_event_channel(v, old_port);
+                    }
+
                     spin_lock(&iorp->lock);
                     if ( iorp->va != NULL )
                         get_ioreq(v)->vp_eport = v->arch.hvm_vcpu.xen_port;
-- 
Anthony PERARD

             reply	other threads:[~2012-06-26 10:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 10:45 Anthony PERARD [this message]
2012-06-26 10:54 ` [PATCH] xen: Fix BUFIOREQ evtchn init for a stubdom Ian Campbell
2012-06-26 14:13   ` Anthony PERARD
2012-06-26 14:21     ` Ian Campbell
2012-06-26 15:06       ` Anthony PERARD

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=1340707524-27665-1-git-send-email-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.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).