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] vmx: Sync with SVM TPR/CR8 changes.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vmx: Sync with SVM TPR/CR8 changes.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Sep 2007 15:30:15 -0700
Delivery-date: Tue, 11 Sep 2007 15:31:08 -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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1189437215 -3600
# Node ID e3984b0b81f521eee680162483abba11c5f8ddcd
# Parent  924c153e0cf90e7c6f9033842d702d0fbc122d29
vmx: Sync with SVM TPR/CR8 changes.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/intr.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff -r 924c153e0cf9 -r e3984b0b81f5 xen/arch/x86/hvm/vmx/intr.c
--- a/xen/arch/x86/hvm/vmx/intr.c       Mon Sep 10 16:13:13 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/intr.c       Mon Sep 10 16:13:35 2007 +0100
@@ -107,22 +107,35 @@ static void enable_intr_window(struct vc
     }
 }
 
-static void update_tpr_threshold(struct vlapic *vlapic)
+static void update_tpr_threshold(
+    struct vcpu *v, enum hvm_intack masked_intr_source)
 {
-    int max_irr, tpr;
+    struct vlapic *vlapic = vcpu_vlapic(v);
+    int max_irr, tpr, threshold = 0;
 
     if ( !cpu_has_vmx_tpr_shadow )
         return;
 
+    /*
+     * If ExtInts are masked then that dominates the TPR --- the 'interrupt
+     * window' has already been enabled in this case.
+     */
+    if ( (masked_intr_source == hvm_intack_lapic) ||
+         (masked_intr_source == hvm_intack_pic) )
+        goto out;
+
+    /* Is there an interrupt pending at the LAPIC? Nothing to do if not. */
     if ( !vlapic_enabled(vlapic) || 
          ((max_irr = vlapic_find_highest_irr(vlapic)) == -1) )
-    {
-        __vmwrite(TPR_THRESHOLD, 0);
-        return;
-    }
+        goto out;
 
+    /* Highest-priority pending interrupt is masked by the TPR? */
     tpr = vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xF0;
-    __vmwrite(TPR_THRESHOLD, (max_irr > tpr) ? (tpr >> 4) : (max_irr >> 4));
+    if ( (tpr >> 4) >= (max_irr >> 4) )
+        threshold = max_irr >> 4;
+
+ out:
+    __vmwrite(TPR_THRESHOLD, threshold);
 }
 
 asmlinkage void vmx_intr_assist(void)
@@ -171,7 +184,7 @@ asmlinkage void vmx_intr_assist(void)
         enable_intr_window(v, intr_source);
 
  out:
-    update_tpr_threshold(vcpu_vlapic(v));
+    update_tpr_threshold(v, intr_source);
 }
 
 /*

_______________________________________________
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] vmx: Sync with SVM TPR/CR8 changes., Xen patchbot-unstable <=