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-changelog

[Xen-changelog] [xen-unstable] hvm: local_events_need_delivery() should

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm: local_events_need_delivery() should take notice of EFLAGS.IF.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 04 Apr 2007 17:40:06 -0700
Delivery-date: Wed, 04 Apr 2007 17:39:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1175710659 -3600
# Node ID b3c75956303b90a5feb293b05272dc399c68a8da
# Parent  10f06a7a05e90d0d0aad11112945815580520897
hvm: local_events_need_delivery() should take notice of EFLAGS.IF.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/irq.c      |   19 +++++++++++++++++++
 xen/include/asm-x86/event.h |    7 ++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff -r 10f06a7a05e9 -r b3c75956303b xen/arch/x86/hvm/irq.c
--- a/xen/arch/x86/hvm/irq.c    Wed Apr 04 18:41:42 2007 +0100
+++ b/xen/arch/x86/hvm/irq.c    Wed Apr 04 19:17:39 2007 +0100
@@ -335,6 +335,25 @@ int is_isa_irq_masked(struct vcpu *v, in
     return ((v->domain->arch.hvm_domain.vpic[isa_irq >> 3].imr &
              (1 << (isa_irq & 7))) &&
             domain_vioapic(v->domain)->redirtbl[gsi].fields.mask);
+}
+
+/*
+ * TODO: 1. Should not need special treatment of event-channel events.
+ *       2. Should take notice of interrupt shadows (or clear them).
+ */
+int hvm_local_events_need_delivery(struct vcpu *v)
+{
+    int pending;
+
+    pending = (vcpu_info(v, evtchn_upcall_pending) || cpu_has_pending_irq(v));
+    if ( unlikely(pending) )
+    {
+        struct cpu_user_regs regs;
+        hvm_store_cpu_guest_regs(v, &regs, NULL);
+        pending = !irq_masked(regs.eflags);
+    }
+
+    return pending;
 }
 
 #if 0 /* Keep for debugging */
diff -r 10f06a7a05e9 -r b3c75956303b xen/include/asm-x86/event.h
--- a/xen/include/asm-x86/event.h       Wed Apr 04 18:41:42 2007 +0100
+++ b/xen/include/asm-x86/event.h       Wed Apr 04 19:17:39 2007 +0100
@@ -35,12 +35,13 @@ static inline void vcpu_mark_events_pend
         vcpu_kick(v);
 }
 
+int hvm_local_events_need_delivery(struct vcpu *v);
 static inline int local_events_need_delivery(void)
 {
     struct vcpu *v = current;
-    return ((vcpu_info(v, evtchn_upcall_pending) &&
-             !vcpu_info(v, evtchn_upcall_mask)) ||
-            (is_hvm_vcpu(v) && cpu_has_pending_irq(v)));
+    return (is_hvm_vcpu(v) ? hvm_local_events_need_delivery(v) :
+            (vcpu_info(v, evtchn_upcall_pending) &&
+             !vcpu_info(v, evtchn_upcall_mask)));
 }
 
 static inline int local_event_delivery_is_enabled(void)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvm: local_events_need_delivery() should take notice of EFLAGS.IF., Xen patchbot-unstable <=