From: "Wei Wang2" <wei.wang2@amd.com>
To: xen-devel@lists.xensource.com
Subject: [IOMMU][PATCH 2/4] Add a generic layer on top of intel and amd iommu code
Date: Wed, 13 Feb 2008 17:46:56 +0100 [thread overview]
Message-ID: <1202921216.3677.110.camel@gran.amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
Signed-off-by: Wei Wang <wei.wang2@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: vtd.patch --]
[-- Type: text/plain, Size: 2093 bytes --]
diff -r 2c343b0341d5 xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
--- a/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c Wed Feb 13 14:24:17 2008 +0100
+++ b/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c Wed Feb 13 14:51:58 2008 +0100
@@ -1047,7 +1047,7 @@ static void free_iommu(struct iommu *iom
agaw = 64; \
agaw; })
-int iommu_domain_init(struct domain *domain)
+int intel_iommu_domain_init(struct domain *domain)
{
struct hvm_iommu *hd = domain_hvm_iommu(domain);
struct iommu *iommu = NULL;
@@ -1055,11 +1055,6 @@ int iommu_domain_init(struct domain *dom
int adjust_width, agaw;
unsigned long sagaw;
struct acpi_drhd_unit *drhd;
-
- spin_lock_init(&hd->mapping_lock);
- spin_lock_init(&hd->iommu_list_lock);
- INIT_LIST_HEAD(&hd->pdev_list);
- INIT_LIST_HEAD(&hd->g2m_ioport_list);
if ( !vtd_enabled || list_empty(&acpi_drhd_units) )
return 0;
@@ -1550,7 +1545,7 @@ static int domain_context_mapped(struct
return 0;
}
-int iommu_map_page(struct domain *d, paddr_t gfn, paddr_t mfn)
+int intel_iommu_map_page(struct domain *d, paddr_t gfn, paddr_t mfn)
{
struct acpi_drhd_unit *drhd;
struct iommu *iommu;
@@ -1589,7 +1584,7 @@ int iommu_map_page(struct domain *d, pad
return 0;
}
-int iommu_unmap_page(struct domain *d, dma_addr_t gfn)
+int intel_iommu_unmap_page(struct domain *d, dma_addr_t gfn)
{
struct acpi_drhd_unit *drhd;
struct iommu *iommu;
@@ -1921,7 +1916,7 @@ int device_assigned(u8 bus, u8 devfn)
return 1;
}
-int assign_device(struct domain *d, u8 bus, u8 devfn)
+int intel_iommu_assign_device(struct domain *d, u8 bus, u8 devfn)
{
struct acpi_rmrr_unit *rmrr;
struct pci_dev *pdev;
@@ -2151,6 +2146,14 @@ int iommu_resume(void)
return 0;
}
+struct iommu_ops intel_iommu_ops = {
+ .init = intel_iommu_domain_init,
+ .assign_device = intel_iommu_assign_device,
+ .teardown = iommu_domain_teardown,
+ .map_page = intel_iommu_map_page,
+ .unmap_page = intel_iommu_unmap_page,
+};
+
/*
* Local variables:
* mode: C
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2008-02-13 16:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1202921216.3677.110.camel@gran.amd.com \
--to=wei.wang2@amd.com \
--cc=xen-devel@lists.xensource.com \
/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.