All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun Sharma <arun.sharma@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
	Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] Enable VMX domains on a SMP dom0.
Date: Wed, 13 Jul 2005 14:50:41 -0700	[thread overview]
Message-ID: <20050713215041.GA3305@intel.com> (raw)

Enable VMX domains on a SMP dom0.

Not all vectors go through do_IRQ(). It's possible to look up the handler
in the IDT and call that one, but it'll result in two trap frames.

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

--- a/xen/arch/x86/vmx.c	Tue Jul 12 23:37:57 2005
+++ b/xen/arch/x86/vmx.c	Tue Jul 12 17:02:15 2005
@@ -1366,6 +1366,53 @@
     raise_softirq(SCHEDULE_SOFTIRQ);
 }
 
+static inline void vmx_vmexit_do_extint(struct cpu_user_regs *regs)
+{
+    unsigned int vector;
+    int error;
+
+    asmlinkage void do_IRQ(struct cpu_user_regs *);
+    void smp_apic_timer_interrupt(struct cpu_user_regs *);
+    void timer_interrupt(int, void *, struct cpu_user_regs *);
+    void smp_event_check_interrupt(void);
+    void smp_invalidate_interrupt(void);
+    void smp_call_function_interrupt(void);
+    void smp_spurious_interrupt(struct cpu_user_regs *regs);
+    void smp_error_interrupt(struct cpu_user_regs *regs);
+
+    if ((error = __vmread(VM_EXIT_INTR_INFO, &vector))
+        && !(vector & INTR_INFO_VALID_MASK))
+        __vmx_bug(regs);
+
+    vector &= 0xff;
+    local_irq_disable();
+
+    switch(vector) {
+        case LOCAL_TIMER_VECTOR:
+            smp_apic_timer_interrupt(regs);
+            break;
+        case EVENT_CHECK_VECTOR:
+            smp_event_check_interrupt();
+            break;
+        case INVALIDATE_TLB_VECTOR:
+            smp_invalidate_interrupt();
+            break;
+        case CALL_FUNCTION_VECTOR:
+            smp_call_function_interrupt();
+            break;
+        case SPURIOUS_APIC_VECTOR:
+            smp_spurious_interrupt(regs);
+            break;
+        case ERROR_APIC_VECTOR:
+            smp_error_interrupt(regs);
+            break;
+        default:
+            regs->entry_vector = vector;
+            do_IRQ(regs);
+            break;
+    }
+}
+
 static inline void vmx_vmexit_do_mwait(void)
 {
 #if VMX_DEBUG
@@ -1569,27 +1616,8 @@
         break;
     }
     case EXIT_REASON_EXTERNAL_INTERRUPT: 
-    {
-        extern asmlinkage void do_IRQ(struct cpu_user_regs *);
-        extern void smp_apic_timer_interrupt(struct cpu_user_regs *);
-        extern void timer_interrupt(int, void *, struct cpu_user_regs *);
-        unsigned int    vector;
-
-        if ((error = __vmread(VM_EXIT_INTR_INFO, &vector))
-            && !(vector & INTR_INFO_VALID_MASK))
-            __vmx_bug(&regs);
-
-        vector &= 0xff;
-        local_irq_disable();
-
-        if (vector == LOCAL_TIMER_VECTOR) {
-            smp_apic_timer_interrupt(&regs);
-        } else {
-            regs.entry_vector = vector;
-            do_IRQ(&regs);
-        }
-        break;
-    }
+        vmx_vmexit_do_extint(&regs);
+        break;
     case EXIT_REASON_PENDING_INTERRUPT:
         __vmwrite(CPU_BASED_VM_EXEC_CONTROL, 
               MONITOR_CPU_BASED_EXEC_CONTROLS);

                 reply	other threads:[~2005-07-13 21:50 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=20050713215041.GA3305@intel.com \
    --to=arun.sharma@intel.com \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=Keir.Fraser@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.