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] More hvm common-code cleanups.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] More hvm common-code cleanups.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 01 Sep 2006 14:40:12 +0000
Delivery-date: Fri, 01 Sep 2006 07:40:33 -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 Steven Hand <steven@xxxxxxxxxxxxx>
# Node ID 329ad7bbc7ec43959e2669ff153f8073325d17be
# Parent  c682ae7a17224dc5576ba3c5db47766b2a7dc159
More hvm common-code cleanups.

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/intr.c |   43 ++++++++++++++++++++-----------------------
 xen/arch/x86/hvm/vlapic.c   |   14 ++++++++++++++
 xen/arch/x86/hvm/vmx/io.c   |   13 -------------
 3 files changed, 34 insertions(+), 36 deletions(-)

diff -r c682ae7a1722 -r 329ad7bbc7ec xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c       Fri Sep 01 12:16:21 2006 +0100
+++ b/xen/arch/x86/hvm/svm/intr.c       Fri Sep 01 13:52:04 2006 +0100
@@ -79,22 +79,22 @@ asmlinkage void svm_intr_assist(void)
     ASSERT(vmcb);
 
     /* Check if an Injection is active */
-       /* Previous Interrupt delivery caused this Intercept? */
-       if (vmcb->exitintinfo.fields.v && (vmcb->exitintinfo.fields.type == 0)) 
{
-           v->arch.hvm_svm.saved_irq_vector = vmcb->exitintinfo.fields.vector;
+    /* Previous Interrupt delivery caused this Intercept? */
+    if (vmcb->exitintinfo.fields.v && (vmcb->exitintinfo.fields.type == 0)) {
+        v->arch.hvm_svm.saved_irq_vector = vmcb->exitintinfo.fields.vector;
 //           printk("Injecting PF#: saving IRQ from ExitInfo\n");
-           vmcb->exitintinfo.bytes = 0;
-           re_injecting = 1;
-       }
+        vmcb->exitintinfo.bytes = 0;
+        re_injecting = 1;
+    }
 
     /* Guest's interrputs masked? */
     rflags = vmcb->rflags;
     if (irq_masked(rflags)) {
         HVM_DBG_LOG(DBG_LEVEL_1, "Guest IRQs masked: rflags: %lx", rflags);
-       /* bail out, we won't be injecting an interrupt this time */
-       return;
+        /* bail out, we won't be injecting an interrupt this time */
+        return;
     }
-  
+    
     /* Previous interrupt still pending? */
     if (vmcb->vintr.fields.irq) {
 //        printk("Re-injecting IRQ from Vintr\n");
@@ -115,27 +115,24 @@ asmlinkage void svm_intr_assist(void)
       if ( v->vcpu_id == 0 )
          hvm_pic_assist(v);
 
+
+      if ( (v->vcpu_id == 0) && pt->enabled && pt->pending_intr_nr ) {
+          pic_set_irq(pic, pt->irq, 0);
+          pic_set_irq(pic, pt->irq, 1);
+      }
+
       callback_irq = v->domain->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ];
-
-      /* Before we deal with PIT interrupts, let's check for
-         interrupts set by the device model or paravirtualised event
-         channel interrupts.
-      */
-      if ( cpu_has_pending_irq(v) ) {
-           intr_vector = cpu_get_interrupt(v, &intr_type);
-      }
-      else  if ( callback_irq != 0 && local_events_need_delivery() ) {
+      if ( callback_irq != 0 &&
+           local_events_need_delivery() ) {
           /*inject para-device call back irq*/
           v->vcpu_info->evtchn_upcall_mask = 1;
           pic_set_irq(pic, callback_irq, 0);
           pic_set_irq(pic, callback_irq, 1);
-          intr_vector = callback_irq;
       }
-      else  if ( (v->vcpu_id == 0) && pt->enabled && pt->pending_intr_nr ) {
-          pic_set_irq(pic, pt->irq, 0);
-          pic_set_irq(pic, pt->irq, 1);
+
+      if ( cpu_has_pending_irq(v) )
           intr_vector = cpu_get_interrupt(v, &intr_type);
-      }
+
     }
 
     /* have we got an interrupt to inject? */
diff -r c682ae7a1722 -r 329ad7bbc7ec xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Fri Sep 01 12:16:21 2006 +0100
+++ b/xen/arch/x86/hvm/vlapic.c Fri Sep 01 13:52:04 2006 +0100
@@ -919,6 +919,20 @@ int cpu_has_apic_interrupt(struct vcpu* 
     return 0;
 }
 
+/* check to see if there is pending interrupt  */
+int cpu_has_pending_irq(struct vcpu *v)
+{
+    struct hvm_domain *plat = &v->domain->arch.hvm_domain;
+
+    /* APIC */
+    if ( cpu_has_apic_interrupt(v) ) return 1;
+    
+    /* PIC */
+    if ( !vlapic_accept_pic_intr(v) ) return 0;
+
+    return plat->interrupt_request;
+}
+
 void vlapic_post_injection(struct vcpu *v, int vector, int deliver_mode)
 {
     struct vlapic *vlapic = VLAPIC(v);
diff -r c682ae7a1722 -r 329ad7bbc7ec xen/arch/x86/hvm/vmx/io.c
--- a/xen/arch/x86/hvm/vmx/io.c Fri Sep 01 12:16:21 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/io.c Fri Sep 01 13:52:04 2006 +0100
@@ -68,19 +68,6 @@ static inline int is_interruptibility_st
     return interruptibility;
 }
 
-/* check to see if there is pending interrupt  */
-int cpu_has_pending_irq(struct vcpu *v)
-{
-    struct hvm_domain *plat = &v->domain->arch.hvm_domain;
-
-    /* APIC */
-    if ( cpu_has_apic_interrupt(v) ) return 1;
-    
-    /* PIC */
-    if ( !vlapic_accept_pic_intr(v) ) return 0;
-
-    return plat->interrupt_request;
-}
 
 asmlinkage void vmx_intr_assist(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] More hvm common-code cleanups., Xen patchbot-unstable <=