aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-08-09 16:33:45 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-08-09 16:33:45 +0100
commit22bcc5f006e8d68a9ea30b6cf871097b5536b00f (patch)
treeb33cdda3d6af9b96eb287e69f0cd73de2eda21d5
parent1cb3c0f2288ef1043eb7d1a318a226a1ebc3be1b (diff)
downloadxen-22bcc5f006e8d68a9ea30b6cf871097b5536b00f.tar.gz
xen-22bcc5f006e8d68a9ea30b6cf871097b5536b00f.tar.bz2
xen-22bcc5f006e8d68a9ea30b6cf871097b5536b00f.zip
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@intel.com>
-rw-r--r--xen/drivers/passthrough/vtd/intremap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 1f9ca0e54c..78587b2c6e 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -440,6 +440,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;
}