From 37a487763bbd5bb8d0efc5b187ceca33ecae96c7 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Fri, 11 Nov 2011 17:26:44 -0700 Subject: [PATCH] --- yaml --- r: 331519 b: refs/heads/master c: 2e12bc29fc5a12242d68e11875db3dd58efad9ff h: refs/heads/master i: 331517: d24314212e6b4dfc45b31502ab8063d51deadff3 331515: 91c159cca11f490391d891729caaae7a58d008b6 331511: 73471a32971ce1d4da9b3ff73a7cf6773c9a7021 331503: 2b9b62a5f800cff0875ae4664e2df6cde5fed0e4 331487: aff95eedad6983cc0edc2c28fd469643bd727520 331455: d06bfff7c9f22b7046525d351493c8cf45f03f26 331391: 4dafa5449856a73d921a21aa062e76e2bc83c517 331263: c160b4aab23651039df575458b70a6bf56a786fa v: v3 --- [refs] | 2 +- trunk/drivers/iommu/amd_iommu.c | 10 +++++----- trunk/drivers/iommu/amd_iommu_init.c | 13 +++++++------ trunk/drivers/iommu/amd_iommu_types.h | 4 ++-- trunk/drivers/iommu/intel-iommu.c | 4 +++- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 9a9b73dc6d42..ba5c82b143e5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 500c25edda62a5d39c4d3b345c2e229a3f9d26be +refs/heads/master: 2e12bc29fc5a12242d68e11875db3dd58efad9ff diff --git a/trunk/drivers/iommu/amd_iommu.c b/trunk/drivers/iommu/amd_iommu.c index 450b25808d98..b64502dfa9f4 100644 --- a/trunk/drivers/iommu/amd_iommu.c +++ b/trunk/drivers/iommu/amd_iommu.c @@ -684,7 +684,7 @@ static void iommu_poll_ppr_log(struct amd_iommu *iommu) /* * Release iommu->lock because ppr-handling might need to - * re-acquire it + * re-aquire it */ spin_unlock_irqrestore(&iommu->lock, flags); @@ -802,7 +802,7 @@ static void build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address, CMD_SET_TYPE(cmd, CMD_INV_IOMMU_PAGES); if (s) /* size bit - we flush more than one 4kb page */ cmd->data[2] |= CMD_INV_IOMMU_PAGES_SIZE_MASK; - if (pde) /* PDE bit - we want to flush everything, not only the PTEs */ + if (pde) /* PDE bit - we wan't flush everything not only the PTEs */ cmd->data[2] |= CMD_INV_IOMMU_PAGES_PDE_MASK; } @@ -2153,7 +2153,7 @@ static bool pci_pri_tlp_required(struct pci_dev *pdev) } /* - * If a device is not yet associated with a domain, this function + * If a device is not yet associated with a domain, this function does * assigns it visible for the hardware */ static int attach_device(struct device *dev, @@ -2403,7 +2403,7 @@ static struct protection_domain *get_domain(struct device *dev) if (domain != NULL) return domain; - /* Device not bound yet - bind it */ + /* Device not bount yet - bind it */ dma_dom = find_protection_domain(devid); if (!dma_dom) dma_dom = amd_iommu_rlookup_table[devid]->default_dom; @@ -2942,7 +2942,7 @@ static void __init prealloc_protection_domains(void) alloc_passthrough_domain(); dev_data->passthrough = true; attach_device(&dev->dev, pt_domain); - pr_info("AMD-Vi: Using passthrough domain for device %s\n", + pr_info("AMD-Vi: Using passthough domain for device %s\n", dev_name(&dev->dev)); } diff --git a/trunk/drivers/iommu/amd_iommu_init.c b/trunk/drivers/iommu/amd_iommu_init.c index 1772b3cbebf4..18a89b760aaa 100644 --- a/trunk/drivers/iommu/amd_iommu_init.c +++ b/trunk/drivers/iommu/amd_iommu_init.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -177,7 +178,7 @@ u16 *amd_iommu_alias_table; struct amd_iommu **amd_iommu_rlookup_table; /* - * AMD IOMMU allows up to 2^16 different protection domains. This is a bitmap + * AMD IOMMU allows up to 2^16 differend protection domains. This is a bitmap * to know which ones are already in use. */ unsigned long *amd_iommu_pd_alloc_bitmap; @@ -477,7 +478,7 @@ static int __init find_last_devid_acpi(struct acpi_table_header *table) /**************************************************************************** * - * The following functions belong to the code path which parses the ACPI table + * The following functions belong the the code path which parses the ACPI table * the second time. In this ACPI parsing iteration we allocate IOMMU specific * data structures, initialize the device/alias/rlookup table and also * basically initialize the hardware. @@ -690,7 +691,7 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu, } /* - * Reads the device exclusion range from ACPI and initializes the IOMMU with + * Reads the device exclusion range from ACPI and initialize IOMMU with * it */ static void __init set_device_exclusion_range(u16 devid, struct ivmd_header *m) @@ -1114,8 +1115,8 @@ static void print_iommu_info(void) if (iommu_feature(iommu, (1ULL << i))) pr_cont(" %s", feat_str[i]); } - pr_cont("\n"); } + pr_cont("\n"); } } @@ -1140,7 +1141,7 @@ static int __init amd_iommu_init_pci(void) /**************************************************************************** * * The following functions initialize the MSI interrupts for all IOMMUs - * in the system. It's a bit challenging because there could be multiple + * in the system. Its a bit challenging because there could be multiple * IOMMUs per PCI BDF but we can call pci_enable_msi(x) only once per * pci_dev. * @@ -1198,7 +1199,7 @@ static int iommu_init_msi(struct amd_iommu *iommu) * * The next functions belong to the third pass of parsing the ACPI * table. In this last pass the memory mapping requirements are - * gathered (like exclusion and unity mapping ranges). + * gathered (like exclusion and unity mapping reanges). * ****************************************************************************/ diff --git a/trunk/drivers/iommu/amd_iommu_types.h b/trunk/drivers/iommu/amd_iommu_types.h index d1390b82b194..d0dab865a8b8 100644 --- a/trunk/drivers/iommu/amd_iommu_types.h +++ b/trunk/drivers/iommu/amd_iommu_types.h @@ -255,7 +255,7 @@ #define PAGE_SIZE_ALIGN(address, pagesize) \ ((address) & ~((pagesize) - 1)) /* - * Creates an IOMMU PTE for an address and a given pagesize + * Creates an IOMMU PTE for an address an a given pagesize * The PTE has no permission bits set * Pagesize is expected to be a power-of-two larger than 4096 */ @@ -404,7 +404,7 @@ struct iommu_dev_data { struct list_head dev_data_list; /* For global dev_data_list */ struct iommu_dev_data *alias_data;/* The alias dev_data */ struct protection_domain *domain; /* Domain the device is bound to */ - atomic_t bind; /* Domain attach reference count */ + atomic_t bind; /* Domain attach reverent count */ u16 devid; /* PCI Device ID */ bool iommu_v2; /* Device can make use of IOMMUv2 */ bool passthrough; /* Default for device is pt_domain */ diff --git a/trunk/drivers/iommu/intel-iommu.c b/trunk/drivers/iommu/intel-iommu.c index 2297ec193eb4..cb9e1146b02f 100644 --- a/trunk/drivers/iommu/intel-iommu.c +++ b/trunk/drivers/iommu/intel-iommu.c @@ -589,7 +589,9 @@ static void domain_update_iommu_coherency(struct dmar_domain *domain) { int i; - domain->iommu_coherency = 1; + i = find_first_bit(domain->iommu_bmp, g_num_of_iommus); + + domain->iommu_coherency = i < g_num_of_iommus ? 1 : 0; for_each_set_bit(i, domain->iommu_bmp, g_num_of_iommus) { if (!ecap_coherent(g_iommus[i]->ecap)) {