]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
vt-d: Fix ioapic_rte_to_remap_entry error path.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 9 Aug 2010 15:51:30 +0000 (16:51 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 9 Aug 2010 15:51:30 +0000 (16:51 +0100)
When ioapic_rte_to_remap_entry fails, currently it just writes value
to ioapic. But the 'mask' bit may be changed if it writes to the upper
half of RTE. This patch ensures to recover the original value of
'mask' bit in this case.

Signed-off-by: Weidong Han <weidong.han@intel.com>
xen-unstable changeset:   21934:befd1814c0a2
xen-unstable date:        Mon Aug 09 16:33:45 2010 +0100

xen/drivers/passthrough/vtd/intremap.c

index 21b8e82d216e9c33f15247af0b6f59ab77e52aeb..0eecfd5ad484cfeaea8716c8d12d086d4a2f8118 100644 (file)
@@ -438,6 +438,13 @@ void io_apic_write_remap_rte(
     {
         *IO_APIC_BASE(apic) = rte_upper ? (reg + 1) : reg;
         *(IO_APIC_BASE(apic)+4) = value;
+
+        /* Recover the original value of 'mask' bit */
+        if ( rte_upper )
+        {
+            *IO_APIC_BASE(apic) = reg;
+            *(IO_APIC_BASE(apic)+4) = *(((u32 *)&old_rte)+0);
+        }
         return;
     }