All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Brian Woods <brian.woods@amd.com>, Wei Liu <wei.liu2@citrix.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 3/7] x86/ACPI: also parse AMD IOMMU tables early
Date: Thu, 28 Mar 2019 08:49:56 -0600	[thread overview]
Message-ID: <5C9CDF140200007800222844@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <5C9CDDAF020000780022282A@prv1-mh.provo.novell.com>

In order to be able to initialize x2APIC mode we need to parse
respective ACPI tables early. Split amd_iov_detect() into two parts for
this purpose, and call the initial part earlier on.

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

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -733,7 +733,7 @@ int __init acpi_boot_init(void)
 
 	acpi_mmcfg_init();
 
-	acpi_dmar_init();
+	acpi_iommu_init();
 
 	erst_init();
 
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -23,6 +23,7 @@
 #include <xen/pci_regs.h>
 #include <xen/paging.h>
 #include <xen/softirq.h>
+#include <asm/acpi.h>
 #include <asm/amd-iommu.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
 #include "../ats.h"
@@ -170,7 +171,7 @@ static void amd_iommu_setup_domain_devic
     }
 }
 
-int __init amd_iov_detect(void)
+int __init acpi_ivrs_init(void)
 {
     INIT_LIST_HEAD(&amd_iommu_head);
 
@@ -184,6 +185,14 @@ int __init amd_iov_detect(void)
         return -ENODEV;
     }
 
+    return 0;
+}
+
+int __init amd_iov_detect(void)
+{
+    if ( !iommu_enable && !iommu_intremap )
+        return 0;
+
     iommu_ops = amd_iommu_ops;
 
     if ( amd_iommu_init() != 0 )
--- a/xen/include/asm-x86/acpi.h
+++ b/xen/include/asm-x86/acpi.h
@@ -26,6 +26,7 @@
 #include <acpi/pdc_intel.h>
 #include <acpi/acconfig.h>
 #include <acpi/actbl.h>
+#include <xen/errno.h>
 
 #define COMPILER_DEPENDENT_INT64   long long
 #define COMPILER_DEPENDENT_UINT64  unsigned long long
@@ -145,6 +146,15 @@ extern u32 pmtmr_ioport;
 extern unsigned int pmtmr_width;
 
 int acpi_dmar_init(void);
+int acpi_ivrs_init(void);
+
+static inline int acpi_iommu_init(void)
+{
+    int ret = acpi_dmar_init();
+
+    return ret == -ENODEV ? acpi_ivrs_init() : ret;
+}
+
 void acpi_mmcfg_init(void);
 
 /* Incremented whenever we transition through S3. Value is 1 during boot. */





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-03-28 14:50 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 14:43 [PATCH 0/7] x86: eliminate Intel-isms from x2APIC setup Jan Beulich
2019-03-28 14:48 ` [PATCH 1/7] x86/entry: drop unused header inclusions Jan Beulich
2019-03-28 16:11   ` Andrew Cooper
2019-04-02  2:57   ` Tian, Kevin
2019-04-05 14:24   ` Boris Ostrovsky
2019-04-05 14:24     ` [Xen-devel] " Boris Ostrovsky
2019-03-28 14:49 ` [PATCH 2/7] x86/APIC: suppress redundant "Switched to ..." messages Jan Beulich
2019-03-28 16:33   ` Andrew Cooper
2019-03-28 14:49 ` Jan Beulich [this message]
2019-03-28 16:43   ` [PATCH 3/7] x86/ACPI: also parse AMD IOMMU tables early Andrew Cooper
2019-03-29  9:00     ` Jan Beulich
2019-04-05 14:28   ` Woods, Brian
2019-04-05 14:28     ` [Xen-devel] " Woods, Brian
2019-03-28 14:51 ` [PATCH 4/7] x86/IOMMU: introduce init-ops structure Jan Beulich
2019-03-28 17:01   ` Andrew Cooper
2019-04-02  3:00   ` Tian, Kevin
2019-04-05 14:29   ` Woods, Brian
2019-04-05 14:29     ` [Xen-devel] " Woods, Brian
2019-03-28 14:52 ` [PATCH 5/7] x86/IOMMU: abstract Intel-specific iommu_supports_eim() Jan Beulich
2019-03-28 17:03   ` Andrew Cooper
2019-04-02  3:02   ` Tian, Kevin
2019-03-28 14:53 ` [PATCH 6/7] x86/IOMMU: abstract Intel-specific iommu_{en, dis}able_x2apic_IR() Jan Beulich
2019-03-28 17:37   ` Andrew Cooper
2019-03-29  9:13     ` Jan Beulich
2019-04-02  3:24       ` Tian, Kevin
2019-04-02 10:18         ` Andrew Cooper
2019-04-02 13:17         ` Jan Beulich
2019-04-03  0:58           ` Tian, Kevin
2019-03-28 14:54 ` [PATCH 7/7] x86/IOMMU: initialize iommu_ops in vendor-independent code Jan Beulich
2019-03-28 17:50   ` Andrew Cooper
2019-03-29  9:15     ` Jan Beulich
2019-04-02 10:16       ` Andrew Cooper
2019-04-02  3:26   ` Tian, Kevin
2019-04-05 14:30   ` Woods, Brian
2019-04-05 14:30     ` [Xen-devel] " Woods, Brian
2019-04-05  8:05 ` Ping: [PATCH 0/7] x86: eliminate Intel-isms from x2APIC setup Jan Beulich
2019-04-05  8:05   ` [Xen-devel] " Jan Beulich

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=5C9CDF140200007800222844@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=brian.woods@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.