From: "Jan Beulich" <JBeulich@suse.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH] x86: drop hvm/iommu.h
Date: Wed, 08 Jun 2016 07:12:18 -0600 [thread overview]
Message-ID: <575835D202000078000F310A@prv-mh.provo.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3946 bytes --]
As a follow-up to commit af07377007 ("IOMMU/x86: per-domain control
structure is not HVM-specific"), fold hvm/iommu.h into iommu.h.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/include/asm-x86/hvm/iommu.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef __ASM_X86_HVM_IOMMU_H__
-#define __ASM_X86_HVM_IOMMU_H__
-
-#include <xen/errno.h>
-
-struct iommu_ops;
-extern const struct iommu_ops intel_iommu_ops;
-extern const struct iommu_ops amd_iommu_ops;
-extern int intel_vtd_setup(void);
-extern int amd_iov_detect(void);
-
-static inline const struct iommu_ops *iommu_get_ops(void)
-{
- switch ( boot_cpu_data.x86_vendor )
- {
- case X86_VENDOR_INTEL:
- return &intel_iommu_ops;
- case X86_VENDOR_AMD:
- return &amd_iommu_ops;
- default:
- BUG();
- }
-
- return NULL;
-}
-
-static inline int iommu_hardware_setup(void)
-{
- switch ( boot_cpu_data.x86_vendor )
- {
- case X86_VENDOR_INTEL:
- return intel_vtd_setup();
- case X86_VENDOR_AMD:
- return amd_iov_detect();
- default:
- return -ENODEV;
- }
-
- return 0;
-}
-
-struct g2m_ioport {
- struct list_head list;
- unsigned int gport;
- unsigned int mport;
- unsigned int np;
-};
-
-#define DEFAULT_DOMAIN_ADDRESS_WIDTH 48
-
-struct arch_iommu
-{
- u64 pgd_maddr; /* io page directory machine address */
- spinlock_t mapping_lock; /* io page table lock */
- int agaw; /* adjusted guest address width, 0 is level 2 30-bit */
- struct list_head g2m_ioport_list; /* guest to machine ioport mapping */
- u64 iommu_bitmap; /* bitmap of iommu(s) that the domain uses */
- struct list_head mapped_rmrrs;
-
- /* amd iommu support */
- int paging_mode;
- struct page_info *root_table;
- struct guest_iommu *g_iommu;
-};
-
-#endif /* __ASM_X86_HVM_IOMMU_H__ */
--- a/xen/include/asm-x86/iommu.h
+++ b/xen/include/asm-x86/iommu.h
@@ -14,10 +14,69 @@
#ifndef __ARCH_X86_IOMMU_H__
#define __ARCH_X86_IOMMU_H__
-#include <asm/hvm/iommu.h> /* For now - should really be merged here. */
+#include <xen/errno.h>
+#include <xen/list.h>
+#include <xen/spinlock.h>
+#include <asm/processor.h>
+#define DEFAULT_DOMAIN_ADDRESS_WIDTH 48
#define MAX_IOMMUS 32
+struct g2m_ioport {
+ struct list_head list;
+ unsigned int gport;
+ unsigned int mport;
+ unsigned int np;
+};
+
+struct arch_iommu
+{
+ u64 pgd_maddr; /* io page directory machine address */
+ spinlock_t mapping_lock; /* io page table lock */
+ int agaw; /* adjusted guest address width, 0 is level 2 30-bit */
+ struct list_head g2m_ioport_list; /* guest to machine ioport mapping */
+ u64 iommu_bitmap; /* bitmap of iommu(s) that the domain uses */
+ struct list_head mapped_rmrrs;
+
+ /* amd iommu support */
+ int paging_mode;
+ struct page_info *root_table;
+ struct guest_iommu *g_iommu;
+};
+
+extern const struct iommu_ops intel_iommu_ops;
+extern const struct iommu_ops amd_iommu_ops;
+int intel_vtd_setup(void);
+int amd_iov_detect(void);
+
+static inline const struct iommu_ops *iommu_get_ops(void)
+{
+ switch ( boot_cpu_data.x86_vendor )
+ {
+ case X86_VENDOR_INTEL:
+ return &intel_iommu_ops;
+ case X86_VENDOR_AMD:
+ return &amd_iommu_ops;
+ }
+
+ BUG();
+
+ return NULL;
+}
+
+static inline int iommu_hardware_setup(void)
+{
+ switch ( boot_cpu_data.x86_vendor )
+ {
+ case X86_VENDOR_INTEL:
+ return intel_vtd_setup();
+ case X86_VENDOR_AMD:
+ return amd_iov_detect();
+ }
+
+ return -ENODEV;
+}
+
/* Does this domain have a P2M table we can use as its IOMMU pagetable? */
#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share)
[-- Attachment #2: x86-fold-hvm-iommu-h.patch --]
[-- Type: text/plain, Size: 3965 bytes --]
x86: drop hvm/iommu.h
As a follow-up to commit af07377007 ("IOMMU/x86: per-domain control
structure is not HVM-specific"), fold hvm/iommu.h into iommu.h.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/include/asm-x86/hvm/iommu.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef __ASM_X86_HVM_IOMMU_H__
-#define __ASM_X86_HVM_IOMMU_H__
-
-#include <xen/errno.h>
-
-struct iommu_ops;
-extern const struct iommu_ops intel_iommu_ops;
-extern const struct iommu_ops amd_iommu_ops;
-extern int intel_vtd_setup(void);
-extern int amd_iov_detect(void);
-
-static inline const struct iommu_ops *iommu_get_ops(void)
-{
- switch ( boot_cpu_data.x86_vendor )
- {
- case X86_VENDOR_INTEL:
- return &intel_iommu_ops;
- case X86_VENDOR_AMD:
- return &amd_iommu_ops;
- default:
- BUG();
- }
-
- return NULL;
-}
-
-static inline int iommu_hardware_setup(void)
-{
- switch ( boot_cpu_data.x86_vendor )
- {
- case X86_VENDOR_INTEL:
- return intel_vtd_setup();
- case X86_VENDOR_AMD:
- return amd_iov_detect();
- default:
- return -ENODEV;
- }
-
- return 0;
-}
-
-struct g2m_ioport {
- struct list_head list;
- unsigned int gport;
- unsigned int mport;
- unsigned int np;
-};
-
-#define DEFAULT_DOMAIN_ADDRESS_WIDTH 48
-
-struct arch_iommu
-{
- u64 pgd_maddr; /* io page directory machine address */
- spinlock_t mapping_lock; /* io page table lock */
- int agaw; /* adjusted guest address width, 0 is level 2 30-bit */
- struct list_head g2m_ioport_list; /* guest to machine ioport mapping */
- u64 iommu_bitmap; /* bitmap of iommu(s) that the domain uses */
- struct list_head mapped_rmrrs;
-
- /* amd iommu support */
- int paging_mode;
- struct page_info *root_table;
- struct guest_iommu *g_iommu;
-};
-
-#endif /* __ASM_X86_HVM_IOMMU_H__ */
--- a/xen/include/asm-x86/iommu.h
+++ b/xen/include/asm-x86/iommu.h
@@ -14,10 +14,69 @@
#ifndef __ARCH_X86_IOMMU_H__
#define __ARCH_X86_IOMMU_H__
-#include <asm/hvm/iommu.h> /* For now - should really be merged here. */
+#include <xen/errno.h>
+#include <xen/list.h>
+#include <xen/spinlock.h>
+#include <asm/processor.h>
+#define DEFAULT_DOMAIN_ADDRESS_WIDTH 48
#define MAX_IOMMUS 32
+struct g2m_ioport {
+ struct list_head list;
+ unsigned int gport;
+ unsigned int mport;
+ unsigned int np;
+};
+
+struct arch_iommu
+{
+ u64 pgd_maddr; /* io page directory machine address */
+ spinlock_t mapping_lock; /* io page table lock */
+ int agaw; /* adjusted guest address width, 0 is level 2 30-bit */
+ struct list_head g2m_ioport_list; /* guest to machine ioport mapping */
+ u64 iommu_bitmap; /* bitmap of iommu(s) that the domain uses */
+ struct list_head mapped_rmrrs;
+
+ /* amd iommu support */
+ int paging_mode;
+ struct page_info *root_table;
+ struct guest_iommu *g_iommu;
+};
+
+extern const struct iommu_ops intel_iommu_ops;
+extern const struct iommu_ops amd_iommu_ops;
+int intel_vtd_setup(void);
+int amd_iov_detect(void);
+
+static inline const struct iommu_ops *iommu_get_ops(void)
+{
+ switch ( boot_cpu_data.x86_vendor )
+ {
+ case X86_VENDOR_INTEL:
+ return &intel_iommu_ops;
+ case X86_VENDOR_AMD:
+ return &amd_iommu_ops;
+ }
+
+ BUG();
+
+ return NULL;
+}
+
+static inline int iommu_hardware_setup(void)
+{
+ switch ( boot_cpu_data.x86_vendor )
+ {
+ case X86_VENDOR_INTEL:
+ return intel_vtd_setup();
+ case X86_VENDOR_AMD:
+ return amd_iov_detect();
+ }
+
+ return -ENODEV;
+}
+
/* Does this domain have a P2M table we can use as its IOMMU pagetable? */
#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share)
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2016-06-08 13:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 13:12 Jan Beulich [this message]
2016-06-09 11:35 ` [PATCH] x86: drop hvm/iommu.h Andrew Cooper
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=575835D202000078000F310A@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@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 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).