All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaofeng Ling <xiaofeng.ling@intel.com>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>,
	Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH][5/6] inject call back irq when there are event pending
Date: Mon, 05 Sep 2005 18:41:26 +0800	[thread overview]
Message-ID: <431C20D6.4060106@intel.com> (raw)

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

                 reply	other threads:[~2005-09-05 10:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=431C20D6.4060106@intel.com \
    --to=xiaofeng.ling@intel.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /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 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.