xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: <suravee.suthikulpanit@amd.com>
To: JBeulich@suse.com
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	xen-devel@lists.xen.org
Subject: [PATCH 1/3] x86/AMD-Vi: Overrides special->handle in IVRS IOAPIC
Date: Fri, 13 Sep 2013 18:30:29 -0500	[thread overview]
Message-ID: <1379115031-1992-2-git-send-email-suravee.suthikulpanit@amd.com> (raw)
In-Reply-To: <1379115031-1992-1-git-send-email-suravee.suthikulpanit@amd.com>

From: Jan Beulich <JBeulich@suse.com>

This patch handles the case when IVRS IOAPIC contains invalid
special->handle, which mainly caused by firmware bugs.
This allows users to override the invalid handle with command option
ivrs_ioapic[<handle>]=<sbdf>.

Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_acpi.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index 89b359c..50b4a44 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -708,6 +708,26 @@ static u16 __init parse_ivhd_device_special(
     case ACPI_IVHD_IOAPIC:
         if ( !iommu_intremap )
             break;
+
+        /* Handling the ivrs_ioapic overriding */
+        apic = find_first_bit(ioapic_cmdline, ARRAY_SIZE(ioapic_sbdf));
+        while ( apic < ARRAY_SIZE(ioapic_sbdf) )
+        {
+            if ( ioapic_sbdf[apic].bdf == bdf &&
+                 ioapic_sbdf[apic].seg == seg )
+                break;
+            apic = find_next_bit(ioapic_cmdline, ARRAY_SIZE(ioapic_sbdf),
+                                 apic + 1);
+        }
+        if ( apic < ARRAY_SIZE(ioapic_sbdf) )
+        {
+            AMD_IOMMU_DEBUG("IVHD: Command line override present for IO-APIC %#x "
+                            "(IVRS: %#x devID %04x:%02x:%02x.%u)\n",
+                            apic, special->handle, seg, PCI_BUS(bdf),
+                            PCI_SLOT(bdf), PCI_FUNC(bdf));
+            break;
+        }
+
         /*
          * Some BIOSes have IOAPIC broken entries so we check for IVRS
          * consistency here --- whether entry's IOAPIC ID is valid and
-- 
1.8.1.2

  reply	other threads:[~2013-09-13 23:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 23:30 [PATCH 0/3 V4] x86/AMD-Vi: Miscs patch to fix and clean up ivrs override suravee.suthikulpanit
2013-09-13 23:30 ` suravee.suthikulpanit [this message]
2013-09-13 23:30 ` [PATCH 2/3] x86/AMD-Vi: Clean up code for handling IVRS IOAPIC override suravee.suthikulpanit
2013-09-16  7:29   ` Jan Beulich
2013-09-17 15:06     ` Suravee Suthikulpanit
2013-09-13 23:30 ` [PATCH 3/3] x86/AMD-Vi: Fix IVRS HPET special->handle override suravee.suthikulpanit
2013-09-16  8:03   ` Jan Beulich
2013-09-17 15:07     ` Suravee Suthikulpanit
     [not found]     ` <523862B8.8000207@amd.com>
2013-09-17 15:30       ` Jan Beulich
2013-09-20 21:38         ` Suravee Suthikulanit
2013-09-23  6:52           ` Jan Beulich
2013-09-23 16:48             ` Suravee Suthikulpanit
2013-09-23 17:03               ` Andrew Cooper
2013-09-23 23:55                 ` Suravee Suthikulanit
2013-09-24  9:35                 ` Jan Beulich
2013-09-24  6:47               ` Jan Beulich
2013-09-24 23:26                 ` Suravee Suthikulanit
2013-09-25  6:12                   ` Jan Beulich
2013-09-25 15:01                     ` Suravee Suthikulpanit

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=1379115031-1992-2-git-send-email-suravee.suthikulpanit@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=JBeulich@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).