WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [ppc] implement vcpu_mark_events_pending()

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [ppc] implement vcpu_mark_events_pending()
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Jun 2006 21:12:58 +0000
Delivery-date: Fri, 16 Jun 2006 14:19:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 19bd6e089f673ab2aa6b51171dbbf03312367ffd
# Parent  dd6634464024412d692df7518e8038a175c73b5d
[ppc] implement vcpu_mark_events_pending()
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/include/asm-ppc/event.h |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+)

diff -r dd6634464024 -r 19bd6e089f67 xen/include/asm-ppc/event.h
--- a/xen/include/asm-ppc/event.h       Fri Jun 16 15:54:42 2006 -0500
+++ b/xen/include/asm-ppc/event.h       Fri Jun 16 15:55:30 2006 -0500
@@ -53,4 +53,35 @@ static inline int arch_virq_is_global(in
     return 1;
 }
 
+static inline void vcpu_kick(struct vcpu *v)
+{
+    /*
+     * NB1. 'vcpu_flags' and 'processor' must be checked /after/ update of
+     * pending flag. These values may fluctuate (after all, we hold no
+     * locks) but the key insight is that each change will cause
+     * evtchn_upcall_pending to be polled.
+     *
+     * NB2. We save VCPUF_running across the unblock to avoid a needless
+     * IPI for domains that we IPI'd to unblock.
+     */
+    int running = test_bit(_VCPUF_running, &v->vcpu_flags);
+    vcpu_unblock(v);
+    if (running)
+        smp_send_event_check_cpu(v->processor);
+}
+
+/* HACK: evtchn_upcall_pending is only a byte, but our atomic instructions
+ * only store in 4/8 byte quantities. However, because evtchn_upcall_pending
+ * is part of the guest ABI, we can't change its size without breaking
+ * backwards compatibility. In this particular case, struct vcpu_info is big
+ * enough that we can safely store a full long into it. However, note that bit
+ * 0 of evtchn_upcall_pending is bit 56 when cast to a long.
+ */
+static inline void vcpu_mark_events_pending(struct vcpu *v)
+{
+    unsigned long *l = (unsigned long *)&v->vcpu_info->evtchn_upcall_pending;
+    if (!test_and_set_bit(BITS_PER_LONG - 8, l))
+        vcpu_kick(v);
+}
+
 #endif

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [ppc] implement vcpu_mark_events_pending(), Xen patchbot-xenppc-unstable <=