All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: xen-devel <xen-devel@lists.xen.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Sherry Hurwitz <sherry.hurwitz@amd.com>
Subject: [PATCH 4/4] AMD IOMMU: use __ioapic_read_entry() instead of open coding it
Date: Fri, 15 Feb 2013 16:22:50 +0000	[thread overview]
Message-ID: <511E6EEA02000078000BED56@nat28.tlf.novell.com> (raw)
In-Reply-To: <511E6CAD02000078000BED19@nat28.tlf.novell.com>

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- 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
 
 int __init amd_iommu_setup_ioapic_remapping(void)
 {
-    struct IO_APIC_route_entry rte = {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 = 0; pin < nr_ioapic_entries[apic]; pin++ )
         {
-            *(((int *)&rte) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
-            *(((int *)&rte) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
-
+            rte = __ioapic_read_entry(apic, pin, 1);
             if ( rte.mask == 1 )
                 continue;
 




[-- Attachment #2: AMD-IOMMU-use-ioapic_read_entry.patch --]
[-- Type: text/plain, Size: 897 bytes --]

AMD IOMMU: use __ioapic_read_entry() instead of open coding it

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- 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
 
 int __init amd_iommu_setup_ioapic_remapping(void)
 {
-    struct IO_APIC_route_entry rte = {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 = 0; pin < nr_ioapic_entries[apic]; pin++ )
         {
-            *(((int *)&rte) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
-            *(((int *)&rte) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
-
+            rte = __ioapic_read_entry(apic, pin, 1);
             if ( rte.mask == 1 )
                 continue;
 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-02-15 16:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 16:13 [PATCH 0/4] AMD IOMMU: misc adjustments Jan Beulich
2013-02-15 16:19 ` [PATCH 1/4] AMD IOMMU: don't BUG() when we don't have to Jan Beulich
2013-02-15 17:34   ` Boris Ostrovsky
2013-02-18  7:58     ` Jan Beulich
2013-02-15 16:20 ` [PATCH 2/4] AMD IOMMU: cover all functions of a device even if ACPI only tells us of func 0 Jan Beulich
2013-02-15 17:21   ` Boris Ostrovsky
2013-02-18  8:00     ` Jan Beulich
2013-02-15 16:21 ` [PATCH 3/4] IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround Jan Beulich
2013-02-25 21:33   ` Suravee Suthikulanit
2013-02-26  7:42     ` Jan Beulich
2013-02-15 16:22 ` Jan Beulich [this message]
2013-02-15 17:28   ` [PATCH 4/4] AMD IOMMU: use __ioapic_read_entry() instead of open coding it Boris Ostrovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=511E6EEA02000078000BED56@nat28.tlf.novell.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=sherry.hurwitz@amd.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.