From: "Jan Beulich" Subject: [PATCH 4/4] AMD IOMMU: use __ioapic_read_entry() instead of open coding it Date: Fri, 15 Feb 2013 16:22:50 +0000 Message-ID: <511E6EEA02000078000BED56@nat28.tlf.novell.com> References: <511E6CAD02000078000BED19@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8DBDCFCA.1__=" Return-path: In-Reply-To: <511E6CAD02000078000BED19@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Boris Ostrovsky , Sherry Hurwitz List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part8DBDCFCA.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/amd/iommu_intr.c +++ b/xen/drivers/passthrough/amd/iommu_intr.c @@ -144,7 +144,7 @@ static void update_intremap_entry_from_i =20 int __init amd_iommu_setup_ioapic_remapping(void) { - struct IO_APIC_route_entry rte =3D {0}; + struct IO_APIC_route_entry rte; unsigned long flags; u32* entry; int apic, pin; @@ -159,9 +159,7 @@ int __init amd_iommu_setup_ioapic_remapp { for ( pin =3D 0; pin < nr_ioapic_entries[apic]; pin++ ) { - *(((int *)&rte) + 1) =3D io_apic_read(apic, 0x11 + 2 * pin); - *(((int *)&rte) + 0) =3D io_apic_read(apic, 0x10 + 2 * pin); - + rte =3D __ioapic_read_entry(apic, pin, 1); if ( rte.mask =3D=3D 1 ) continue; =20 --=__Part8DBDCFCA.1__= Content-Type: text/plain; name="AMD-IOMMU-use-ioapic_read_entry.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="AMD-IOMMU-use-ioapic_read_entry.patch" AMD IOMMU: use __ioapic_read_entry() instead of open coding it=0A=0ASigned-= off-by: Jan Beulich =0A=0A--- a/xen/drivers/passthrough/= amd/iommu_intr.c=0A+++ b/xen/drivers/passthrough/amd/iommu_intr.c=0A@@ = -144,7 +144,7 @@ static void update_intremap_entry_from_i=0A =0A int = __init amd_iommu_setup_ioapic_remapping(void)=0A {=0A- struct IO_APIC_ro= ute_entry rte =3D {0};=0A+ struct IO_APIC_route_entry rte;=0A = unsigned long flags;=0A u32* entry;=0A int apic, pin;=0A@@ -159,9 = +159,7 @@ int __init amd_iommu_setup_ioapic_remapp=0A {=0A for = ( pin =3D 0; pin < nr_ioapic_entries[apic]; pin++ )=0A {=0A- = *(((int *)&rte) + 1) =3D io_apic_read(apic, 0x11 + 2 * pin);=0A- = *(((int *)&rte) + 0) =3D io_apic_read(apic, 0x10 + 2 * pin);=0A-=0A+ = rte =3D __ioapic_read_entry(apic, pin, 1);=0A if ( = rte.mask =3D=3D 1 )=0A continue;=0A =0A --=__Part8DBDCFCA.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part8DBDCFCA.1__=--