WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix IOAPIC S3 with interrupt remapping en

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix IOAPIC S3 with interrupt remapping enabled
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Aug 2010 07:00:41 -0700
Delivery-date: Wed, 18 Aug 2010 07:03:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1281707855 -3600
# Node ID 01d185dab39e9be399b203bec91870e04f576c23
# Parent  f6e1a597a92fd6f84df69ab26622402c275fd960
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@xxxxxxxxx>
---
 xen/arch/x86/io_apic.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff -r f6e1a597a92f -r 01d185dab39e xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Fri Aug 13 14:56:15 2010 +0100
+++ b/xen/arch/x86/io_apic.c    Fri Aug 13 14:57:35 2010 +0100
@@ -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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix IOAPIC S3 with interrupt remapping enabled, Xen patchbot-unstable <=