debuggers.hg

changeset 21980:befd1814c0a2

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>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Aug 09 16:33:45 2010 +0100 (2010-08-09)
parents add40eb47868
children 93074767205e
files xen/drivers/passthrough/vtd/intremap.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/intremap.c	Mon Aug 09 16:32:45 2010 +0100
     1.2 +++ b/xen/drivers/passthrough/vtd/intremap.c	Mon Aug 09 16:33:45 2010 +0100
     1.3 @@ -440,6 +440,13 @@ void io_apic_write_remap_rte(
     1.4      {
     1.5          *IO_APIC_BASE(apic) = rte_upper ? (reg + 1) : reg;
     1.6          *(IO_APIC_BASE(apic)+4) = value;
     1.7 +
     1.8 +        /* Recover the original value of 'mask' bit */
     1.9 +        if ( rte_upper )
    1.10 +        {
    1.11 +            *IO_APIC_BASE(apic) = reg;
    1.12 +            *(IO_APIC_BASE(apic)+4) = *(((u32 *)&old_rte)+0);
    1.13 +        }
    1.14          return;
    1.15      }
    1.16