[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] IOMMU: remove vendor specific bits from generic code


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 16 Oct 2012 07:11:11 +0000
  • Delivery-date: Tue, 16 Oct 2012 07:11:44 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1350315699 -7200
# Node ID 37bb894121c7e0d7661656656a6e0749b41f2298
# Parent  2e8a6c8fa89cfc0e2630f1088726e7c4805bc0c1
IOMMU: remove vendor specific bits from generic code

- names of functions used independent of vendor should not have vendor
  specific names
- vendor specific declarations should not live inn generic headers
- other vendor specific items should not be used in generic code

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/arch/x86/domctl.c     Mon Oct 15 17:41:39 2012 +0200
@@ -776,7 +776,7 @@ long arch_do_domctl(
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
-            ret = pt_irq_create_bind_vtd(d, bind);
+            ret = pt_irq_create_bind(d, bind);
             spin_unlock(&pcidevs_lock);
         }
         if ( ret < 0 )
@@ -806,7 +806,7 @@ long arch_do_domctl(
         if ( iommu_enabled )
         {
             spin_lock(&pcidevs_lock);
-            ret = pt_irq_destroy_bind_vtd(d, bind);
+            ret = pt_irq_destroy_bind(d, bind);
             spin_unlock(&pcidevs_lock);
         }
         if ( ret < 0 )
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c      Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/io.c      Mon Oct 15 17:41:39 2012 +0200
@@ -95,7 +95,7 @@ void free_hvm_irq_dpci(struct hvm_irq_dp
     xfree(dpci);
 }
 
-int pt_irq_create_bind_vtd(
+int pt_irq_create_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = NULL;
@@ -277,14 +277,14 @@ int pt_irq_create_bind_vtd(
         spin_unlock(&d->event_lock);
 
         if ( iommu_verbose )
-            dprintk(VTDPREFIX,
+            dprintk(XENLOG_G_INFO,
                     "d%d: bind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
                     d->domain_id, pirq, guest_gsi, device, intx);
     }
     return 0;
 }
 
-int pt_irq_destroy_bind_vtd(
+int pt_irq_destroy_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = NULL;
@@ -302,7 +302,7 @@ int pt_irq_destroy_bind_vtd(
     link = hvm_pci_intx_link(device, intx);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
+        dprintk(XENLOG_G_INFO,
                 "d%d: unbind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
                 d->domain_id, machine_gsi, guest_gsi, device, intx);
 
@@ -360,7 +360,7 @@ int pt_irq_destroy_bind_vtd(
     spin_unlock(&d->event_lock);
 
     if ( iommu_verbose )
-        dprintk(VTDPREFIX,
+        dprintk(XENLOG_G_INFO,
                 "d%d unmap: m_irq=%u device=%u intx=%u\n",
                 d->domain_id, machine_gsi, device, intx);
 
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c   Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/iommu.c   Mon Oct 15 17:41:39 2012 +0200
@@ -364,7 +364,7 @@ int deassign_device(struct domain *d, u1
 
     if ( pdev->domain != d )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
+        dprintk(XENLOG_G_ERR,
                 "d%d: deassign a device not owned\n", d->domain_id);
         return -EINVAL;
     }
@@ -372,8 +372,8 @@ int deassign_device(struct domain *d, u1
     ret = hd->platform_ops->reassign_device(d, dom0, seg, bus, devfn);
     if ( ret )
     {
-        dprintk(XENLOG_ERR VTDPREFIX,
-                "d%d: Deassign device (%04x:%02x:%02x.%u) failed!\n",
+        dprintk(XENLOG_G_ERR,
+                "d%d: deassign device (%04x:%02x:%02x.%u) failed\n",
                 d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
         return ret;
     }
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h      Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/extern.h      Mon Oct 15 17:41:39 2012 +0200
@@ -24,6 +24,8 @@
 #include "dmar.h"
 #include <xen/keyhandler.h>
 
+#define VTDPREFIX "[VT-D]"
+
 extern bool_t rwbf_quirk;
 
 void print_iommu_regs(struct acpi_drhd_unit *drhd);
@@ -79,6 +81,15 @@ int domain_context_mapping_one(struct do
 int domain_context_unmap_one(struct domain *domain, struct iommu *iommu,
                              u8 bus, u8 devfn);
 
+unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
+void io_apic_write_remap_rte(unsigned int apic,
+                             unsigned int reg, unsigned int value);
+
+struct msi_desc;
+struct msi_msg;
+void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
+void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
+
 int is_igd_vt_enabled_quirk(void);
 void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/drivers/passthrough/vtd/iommu.h
--- a/xen/drivers/passthrough/vtd/iommu.h       Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/drivers/passthrough/vtd/iommu.h       Mon Oct 15 17:41:39 2012 +0200
@@ -510,6 +510,22 @@ struct intel_iommu {
     struct acpi_drhd_unit *drhd;
 };
 
+struct iommu {
+    struct list_head list;
+    void __iomem *reg; /* Pointer to hardware regs, virtual addr */
+    u32        index;         /* Sequence number of iommu */
+    u32 nr_pt_levels;
+    u64        cap;
+    u64        ecap;
+    spinlock_t lock; /* protect context, domain ids */
+    spinlock_t register_lock; /* protect iommu register handling */
+    u64 root_maddr; /* root entry machine address */
+    int irq;
+    struct intel_iommu *intel;
+    unsigned long *domid_bitmap;  /* domain id bitmap */
+    u16 *domid_map;               /* domain id mapping array */
+};
+
 static inline struct qi_ctrl *iommu_qi_ctrl(struct iommu *iommu)
 {
     return iommu ? &iommu->intel->qi_ctrl : NULL;
diff -r 2e8a6c8fa89c -r 37bb894121c7 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h   Mon Oct 15 17:39:32 2012 +0200
+++ b/xen/include/xen/iommu.h   Mon Oct 15 17:41:39 2012 +0200
@@ -48,22 +48,6 @@ extern struct rangeset *mmio_ro_ranges;
 #define PAGE_MASK_4K        (((u64)-1) << PAGE_SHIFT_4K)
 #define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
 
-struct iommu {
-    struct list_head list;
-    void __iomem *reg; /* Pointer to hardware regs, virtual addr */
-    u32        index;         /* Sequence number of iommu */
-    u32 nr_pt_levels;
-    u64        cap;
-    u64        ecap;
-    spinlock_t lock; /* protect context, domain ids */
-    spinlock_t register_lock; /* protect iommu register handling */
-    u64 root_maddr; /* root entry machine address */
-    int irq;
-    struct intel_iommu *intel;
-    unsigned long *domid_bitmap;  /* domain id bitmap */
-    u16 *domid_map;               /* domain id mapping array */
-};
-
 int iommu_setup(void);
 int iommu_supports_eim(void);
 int iommu_enable_x2apic_IR(void);
@@ -94,25 +78,18 @@ void pt_pci_init(void);
 struct pirq;
 int hvm_do_IRQ_dpci(struct domain *, struct pirq *);
 int dpci_ioport_intercept(ioreq_t *p);
-int pt_irq_create_bind_vtd(struct domain *d,
-                           xen_domctl_bind_pt_irq_t *pt_irq_bind);
-int pt_irq_destroy_bind_vtd(struct domain *d,
-                            xen_domctl_bind_pt_irq_t *pt_irq_bind);
-unsigned int io_apic_read_remap_rte(unsigned int apic, unsigned int reg);
-void io_apic_write_remap_rte(unsigned int apic,
-                             unsigned int reg, unsigned int value);
+int pt_irq_create_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
+int pt_irq_destroy_bind(struct domain *, xen_domctl_bind_pt_irq_t *);
 
-struct msi_desc;
-struct msi_msg;
-void msi_msg_read_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
-void msi_msg_write_remap_rte(struct msi_desc *msi_desc, struct msi_msg *msg);
 void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq);
 struct hvm_irq_dpci *domain_get_irq_dpci(const struct domain *);
 void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci);
 bool_t pt_irq_need_timer(uint32_t flags);
 
 #define PT_IRQ_TIME_OUT MILLISECS(8)
-#define VTDPREFIX "[VT-D]"
+
+struct msi_desc;
+struct msi_msg;
 
 struct iommu_ops {
     int (*init)(struct domain *d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.