aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-08-09 16:51:30 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-08-09 16:51:30 +0100
commit11ad1ab5e05777fc17ec608b4e16467f44349f52 (patch)
treef3fc6637d9479d592a0026342449a3d862df842d
parentd1ffda5cf50c6fcd7a69d0b76325783197048de6 (diff)
downloadxen-11ad1ab5e05777fc17ec608b4e16467f44349f52.tar.gz
xen-11ad1ab5e05777fc17ec608b4e16467f44349f52.tar.bz2
xen-11ad1ab5e05777fc17ec608b4e16467f44349f52.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> xen-unstable changeset: 21934:befd1814c0a2 xen-unstable date: Mon Aug 09 16:33:45 2010 +0100
-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 21b8e82d21..0eecfd5ad4 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -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;
}