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

[Xen-changelog] [xen-4.0-testing] vt-d: Fix ioapic_rte_to_remap_entry error path.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1281369090 -3600
# Node ID 6b05eb35f1a9da79cc36fe0cf780b72678ef0a11
# Parent  101d44e16b72c7cabb70f3ab534391c0681f40b3
vt-d: Fix ioapic_rte_to_remap_entry error path.

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@xxxxxxxxx>
xen-unstable changeset:   21934:befd1814c0a2
xen-unstable date:        Mon Aug 09 16:33:45 2010 +0100
---
 xen/drivers/passthrough/vtd/intremap.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -r 101d44e16b72 -r 6b05eb35f1a9 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c    Mon Aug 09 16:51:03 2010 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c    Mon Aug 09 16:51:30 2010 +0100
@@ -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;
     }
 

_______________________________________________
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®.