mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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>
This commit is contained in:
1 parent
1cb3c0f228
commit
22bcc5f006
1 file changed
+7
@@ -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;
|
||||
}
|
||||
|
||||
|
||||