xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xen.org
Cc: Wei Liu <wei.liu2@citrix.com>, Keir Fraser <keir@xen.org>,
	David Vrabel <david.vrabel@citrix.com>
Subject: [PATCH 3/8] evtchn: add a hook to bind an event port to a VCPU
Date: Fri, 9 Aug 2013 19:08:35 +0100	[thread overview]
Message-ID: <1376071720-17644-4-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1376071720-17644-1-git-send-email-david.vrabel@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>

The upcoming FIFO-based event channel ABI will require binding ports
to a specific per-VCPU queue, so add a port op (bind_to_vcpu) for
this.  Call this new op when events are bound and when they are moved
to a different VCPU.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/common/event_channel.c |    7 +++++++
 xen/include/xen/event.h    |    9 +++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 01d0b77..d0fbe82 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -237,10 +237,12 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind)
     if ( rc )
         goto out;
 
+    evtchn_port_bind_to_vcpu(ld, lchn, ld->vcpu[lchn->notify_vcpu_id]);
     lchn->u.interdomain.remote_dom  = rd;
     lchn->u.interdomain.remote_port = (u16)rport;
     lchn->state                     = ECS_INTERDOMAIN;
     
+    evtchn_port_bind_to_vcpu(rd, rchn, rd->vcpu[rchn->notify_vcpu_id]);
     rchn->u.interdomain.remote_dom  = ld;
     rchn->u.interdomain.remote_port = (u16)lport;
     rchn->state                     = ECS_INTERDOMAIN;
@@ -291,6 +293,7 @@ static long evtchn_bind_virq(evtchn_bind_virq_t *bind)
         ERROR_EXIT(port);
 
     chn = evtchn_from_port(d, port);
+    evtchn_port_bind_to_vcpu(d, chn, v);
     chn->state          = ECS_VIRQ;
     chn->notify_vcpu_id = vcpu;
     chn->u.virq         = virq;
@@ -321,6 +324,7 @@ static long evtchn_bind_ipi(evtchn_bind_ipi_t *bind)
         ERROR_EXIT(port);
 
     chn = evtchn_from_port(d, port);
+    evtchn_port_bind_to_vcpu(d, chn, d->vcpu[vcpu]);
     chn->state          = ECS_IPI;
     chn->notify_vcpu_id = vcpu;
 
@@ -398,6 +402,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
         goto out;
     }
 
+    evtchn_port_bind_to_vcpu(d, chn, v);
     chn->state  = ECS_PIRQ;
     chn->u.pirq.irq = pirq;
     link_pirq_port(port, chn, v);
@@ -877,6 +882,8 @@ long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id)
         rc = -EINVAL;
         break;
     }
+    if ( rc == 0 )
+        evtchn_port_bind_to_vcpu(d, chn, d->vcpu[vcpu_id]);
 
  out:
     spin_unlock(&d->event_lock);
diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h
index 208f7bd..05d8091 100644
--- a/xen/include/xen/event.h
+++ b/xen/include/xen/event.h
@@ -115,6 +115,8 @@ struct evtchn_port_ops {
     void (*unmask)(struct domain *d, struct evtchn *evtchn);
     bool_t (*is_pending)(struct domain *d, const struct evtchn *evtchn);
     bool_t (*is_masked)(struct domain *d, const struct evtchn *evtchn);
+    void (*bind_to_vcpu)(struct domain *d, struct evtchn *evtchn,
+                         struct vcpu *vcpu);
 };
 
 static inline void evtchn_port_set_pending(struct vcpu *v, struct evtchn *evtchn)
@@ -145,4 +147,11 @@ static inline bool_t evtchn_port_is_masked(struct domain *d,
     return d->evtchn_port_ops->is_masked(d, evtchn);
 }
 
+static inline void evtchn_port_bind_to_vcpu(struct domain *d, struct evtchn *evtchn,
+                                            struct vcpu *vcpu)
+{
+    if ( d->evtchn_port_ops->bind_to_vcpu )
+        d->evtchn_port_ops->bind_to_vcpu(d, evtchn, vcpu);
+}
+
 #endif /* __XEN_EVENT_H__ */
-- 
1.7.2.5

  parent reply	other threads:[~2013-08-09 18:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 18:08 [RFC PATCH 0/8] Xen: FIFO-based event channel ABI David Vrabel
2013-08-09 18:08 ` [PATCH 1/8] debug: remove some event channel info from the 'i' and 'q' debug keys David Vrabel
2013-08-15 13:55   ` Jan Beulich
2013-08-09 18:08 ` [PATCH 2/8] evtchn: refactor low-level event channel port ops David Vrabel
2013-08-15 14:05   ` Jan Beulich
2013-09-06 14:25     ` David Vrabel
2013-09-06 14:55       ` Jan Beulich
2013-08-09 18:08 ` David Vrabel [this message]
2013-08-09 18:08 ` [PATCH 4/8] evtchn: use a per-domain variable for the max number of event channels David Vrabel
2013-08-15 14:09   ` Jan Beulich
2013-08-09 18:08 ` [PATCH 5/8] evtchn: dynamically allocate d->evtchn David Vrabel
2013-08-15 14:10   ` Jan Beulich
2013-08-09 18:08 ` [PATCH 6/8] evtchn: alter internal object handling scheme David Vrabel
2013-08-15 14:21   ` Jan Beulich
2013-08-15 15:46     ` David Vrabel
2013-08-16  7:14       ` Jan Beulich
2013-08-16 16:55   ` Wei Liu
2013-08-09 18:08 ` [PATCH 7/8] evtchn: add FIFO-based event channel ABI David Vrabel
2013-08-15 14:25   ` Jan Beulich
2013-08-09 18:08 ` [PATCH 8/8] evtchn: add FIFO-based event channel hypercalls and port ops David Vrabel
2013-08-16 16:33   ` Wei Liu
2013-08-19 10:32     ` David Vrabel
2013-08-19 10:46       ` Wei Liu
2013-08-23 10:33   ` Jan Beulich
2013-08-23 11:00     ` David Vrabel
2013-08-12 13:06 ` [RFC PATCH 0/8] Xen: FIFO-based event channel ABI George Dunlap
2013-08-12 13:49   ` David Vrabel
2013-08-16 16:55 ` Wei Liu
  -- strict thread matches above, loose matches on Subject: below --
2013-03-19 21:00 [PATCH RFC " David Vrabel
2013-03-19 21:00 ` [PATCH 3/8] evtchn: add a hook to bind an event port to a VCPU David Vrabel

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=1376071720-17644-4-git-send-email-david.vrabel@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=keir@xen.org \
    --cc=wei.liu2@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).