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

[Xen-devel] [PATCH][5/6] inject call back irq when there are event pendi

To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][5/6] inject call back irq when there are event pending
From: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Date: Mon, 05 Sep 2005 18:41:26 +0800
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 05 Sep 2005 10:43:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510
Inject call back irq when there are event pending.
If there are still event pending after dealing with the device
model evtchn, then these are for virtual device(ctrl_if, xenbus,
blfront,etc) so inject the call back irq.
The irq handler in event channel pci device will deliver the event
to frontend driver.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r 287d36b46fa3 xen/arch/x86/vmx_io.c
--- a/xen/arch/x86/vmx_io.c     Tue Aug 30 20:36:49 2005
+++ b/xen/arch/x86/vmx_io.c     Fri Sep  2 22:46:13 2005
@@ -631,6 +631,51 @@
     return ((eflags & X86_EFLAGS_IF) == 0);
 }

+int vmx_event_to_irq(struct vcpu *v)
+{
+
+    global_iodata_t *spg;
+    unsigned long callback_irq;
+
+    spg = &get_sp(v->domain)->sp_global;
+
+    callback_irq = v->domain->arch.vmx_platform.callback_irq;
+    if(unlikely( callback_irq == 0)) {
+        printk("try to inject callback =0!!!\n");
+        printk("pending: %x, sel: %x, pending[0]:%x\n",
+               v->vcpu_info->evtchn_upcall_pending,
+               v->vcpu_info->evtchn_pending_sel,
+               v->domain->shared_info->evtchn_pending[0]);
+        return 0;
+    }
+
+    /*
+     * the event is only for guest, just set callback interrupt
+     * bit  and return
+     */
+
+    return test_and_set_bit(callback_irq, &spg->pic_intr[0]);
+
+}
+
+void vmx_check_guest_event(struct vcpu *v)
+{
+
+    int port = iopacket_port(v->domain);
+
+    if (!v->domain->shared_info->evtchn_pending[port>>5])
+        clear_bit(port>>5, &v->vcpu_info->evtchn_pending_sel);
+
+    /* Note: VMX domains may need upcalls as well */
+    if (!v->vcpu_info->evtchn_pending_sel)
+        v->vcpu_info->evtchn_upcall_pending = 0;
+
+    if(event_pending(v) && !v->vcpu_info->callback_mask &&
+       !test_bit(port, &v->domain->shared_info->evtchn_pending[0]) )
+        vmx_event_to_irq(v);
+}
+
+
 asmlinkage void vmx_intr_assist(void)
 {
     int intr_type = 0;
@@ -640,6 +685,10 @@

     highest_vector = find_highest_pending_irq(v, &intr_type);
     __vmread(CPU_BASED_VM_EXEC_CONTROL, &cpu_exec_control);
+
+    vmx_check_guest_event(v); /*inject para-device call back irq*/
+
+    highest_vector = find_highest_pending_irq(v, &intr_type);

     if (highest_vector == -1) {
         disable_irq_window(cpu_exec_control);


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][5/6] inject call back irq when there are event pending, Xiaofeng Ling <=