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:
Keir Fraser committed 2010-08-09 16:33:45 +01:00
1 parent 1cb3c0f228
commit 22bcc5f006
1 file changed
+7
+7
View File
@@ -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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.