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] vt-d: some small fixes to apic_pin_2_ir_i

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vt-d: some small fixes to apic_pin_2_ir_idx
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 07 Sep 2009 06:35:21 -0700
Delivery-date: Mon, 07 Sep 2009 06:35:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1252327915 -3600
# Node ID ac096fe31a63ff19514d92b6c4929d55f07e15b9
# Parent  26bdf05cb7ae23ab0bfa3f66f8406ec5d784c85f
vt-d: some small fixes to apic_pin_2_ir_idx

1) apic_pin_2_ir_idx should be int** rahter than unsigned int**,
because we use the int -1 to indicate that the related IRTE index is
not allocated.
2) shouldn't re-init apic_pin_2_ir_idx when resuming from S3.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/intremap.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 26bdf05cb7ae -r ac096fe31a63 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c    Mon Sep 07 13:51:37 2009 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c    Mon Sep 07 13:51:55 2009 +0100
@@ -61,19 +61,23 @@
                                   */
 
 /* apic_pin_2_ir_idx[apicid][pin] = interrupt remapping table index */
-static unsigned int **apic_pin_2_ir_idx;
+static int **apic_pin_2_ir_idx;
 
 static int init_apic_pin_2_ir_idx(void)
 {
-    unsigned int *_apic_pin_2_ir_idx;
+    int *_apic_pin_2_ir_idx;
     unsigned int nr_pins, i;
+
+    /* Here we shouldn't need to re-init when resuming from S3. */
+    if ( apic_pin_2_ir_idx != NULL )
+        return 0;
 
     nr_pins = 0;
     for ( i = 0; i < nr_ioapics; i++ )
         nr_pins += nr_ioapic_registers(i);
 
-    _apic_pin_2_ir_idx = xmalloc_array(unsigned int, nr_pins);
-    apic_pin_2_ir_idx = xmalloc_array(unsigned int *, nr_ioapics);
+    _apic_pin_2_ir_idx = xmalloc_array(int, nr_pins);
+    apic_pin_2_ir_idx = xmalloc_array(int *, nr_ioapics);
     if ( (_apic_pin_2_ir_idx == NULL) || (apic_pin_2_ir_idx == NULL) )
     {
         xfree(_apic_pin_2_ir_idx);
@@ -512,7 +516,7 @@ static int msi_msg_to_remap_entry(
     struct iremap_entry *iremap_entry = NULL, *iremap_entries;
     struct iremap_entry new_ire;
     struct msi_msg_remap_entry *remap_rte;
-    unsigned int index;
+    int index;
     unsigned long flags;
     struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu);
 

_______________________________________________
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] vt-d: some small fixes to apic_pin_2_ir_idx, Xen patchbot-unstable <=