All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][5/6] inject call back irq when there are event pending
@ 2005-09-05 10:41 Xiaofeng Ling
  0 siblings, 0 replies; only message in thread
From: Xiaofeng Ling @ 2005-09-05 10:41 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

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@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-09-05 10:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-05 10:41 [PATCH][5/6] inject call back irq when there are event pending Xiaofeng Ling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.