diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-08-13 15:06:24 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-08-13 15:06:24 +0100 |
commit | dfd003b8a321b65535fdeb32f9db01a707aa62e2 (patch) | |
tree | 06bd0036c11903af81650e576d2f042a88846fe4 | |
parent | 8e60dbfbfa0d89a85212b50d09cd14ec8deb5482 (diff) | |
download | xen-dfd003b8a321b65535fdeb32f9db01a707aa62e2.tar.gz xen-dfd003b8a321b65535fdeb32f9db01a707aa62e2.tar.bz2 xen-dfd003b8a321b65535fdeb32f9db01a707aa62e2.zip |
Fix IOAPIC S3 with interrupt remapping enabled
In ioapic_suspend, it reads and saves ioapic RTEs. But when interrupt
remapping is enabled, io_apic_read will call io_apic_read_remap_rte to
convert remapped format interrupt to compatible format, this results
in 'dest' field may be changed in remap_entry_to_ioapic_rte. When in
ioapic_resume, it will write the saved RTEs with incorrect 'dest' to
interrupt remapping table.
Actually it needn't to convert RTEs regardless interrupt remapping is
enabled or not. It just needs to save and restore RTE values
directly. This patch just uses __io_apic_read and __io_apic_write,
which won't call Interrupt remapping functions to convert, to save and
restore RTEs in ioapic_suspend and ioapic_resume. Thus fix this issue.
Signed-off-by: Weidong Han <weidong.han@intel.com>
xen-unstable changeset: 01d185dab39e
xen-unstable date: Fri Aug 13 14:57:35 2010 +0100
-rw-r--r-- | xen/arch/x86/io_apic.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 4fc461a954..74f3749906 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2093,8 +2093,8 @@ void ioapic_suspend(void) spin_lock_irqsave(&ioapic_lock, flags); for (apic = 0; apic < nr_ioapics; apic++) { for (i = 0; i < nr_ioapic_registers[apic]; i ++, entry ++ ) { - *(((int *)entry) + 1) = io_apic_read(apic, 0x11 + 2 * i); - *(((int *)entry) + 0) = io_apic_read(apic, 0x10 + 2 * i); + *(((int *)entry) + 1) = __io_apic_read(apic, 0x11 + 2 * i); + *(((int *)entry) + 0) = __io_apic_read(apic, 0x10 + 2 * i); } } spin_unlock_irqrestore(&ioapic_lock, flags); @@ -2109,14 +2109,14 @@ void ioapic_resume(void) spin_lock_irqsave(&ioapic_lock, flags); for (apic = 0; apic < nr_ioapics; apic++){ - reg_00.raw = io_apic_read(apic, 0); + reg_00.raw = __io_apic_read(apic, 0); if (reg_00.bits.ID != mp_ioapics[apic].mpc_apicid) { reg_00.bits.ID = mp_ioapics[apic].mpc_apicid; - io_apic_write(apic, 0, reg_00.raw); + __io_apic_write(apic, 0, reg_00.raw); } for (i = 0; i < nr_ioapic_registers[apic]; i++, entry++) { - io_apic_write(apic, 0x11+2*i, *(((int *)entry)+1)); - io_apic_write(apic, 0x10+2*i, *(((int *)entry)+0)); + __io_apic_write(apic, 0x11+2*i, *(((int *)entry)+1)); + __io_apic_write(apic, 0x10+2*i, *(((int *)entry)+0)); } } spin_unlock_irqrestore(&ioapic_lock, flags); |