[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] vt-d: some small fixes to apic_pin_2_ir_idx



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.