* [PATCH v3] drivers/pci/intel-iommu.c: intel_iommu_map_range failed at very end of address space
@ 2010-04-19 21:37 Tom Lyon
2010-04-30 22:27 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Tom Lyon @ 2010-04-19 21:37 UTC (permalink / raw)
To: linux-kernel, iommu, joerg.roedel, chrisw, dwmw2
Bug: intel_iommu_map_range didn't allow allocation at the very
end of the address space.
Signed-off-by: Tom Lyon <pugs@cisco.com>
---
V1 and V2 of this patch were patch of a larger patch, this is now independent.
--- linux-2.6.33/drivers/pci/intel-iommu.c 2010-02-24 10:52:17.000000000 -0800
+++ mylinux-2.6.33/drivers/pci/intel-iommu.c 2010-04-13 16:51:55.000000000 -0700
@@ -3632,7 +3631,6 @@ static int intel_iommu_map_range(struct
{
struct dmar_domain *dmar_domain = domain->priv;
u64 max_addr;
- int addr_width;
int prot = 0;
int ret;
@@ -3645,18 +3643,14 @@ static int intel_iommu_map_range(struct
max_addr = iova + size;
if (dmar_domain->max_addr < max_addr) {
- int min_agaw;
u64 end;
/* check if minimum agaw is sufficient for mapped address */
- min_agaw = vm_domain_min_agaw(dmar_domain);
- addr_width = agaw_to_width(min_agaw);
- end = DOMAIN_MAX_ADDR(addr_width);
- end = end & VTD_PAGE_MASK;
+ end = __DOMAIN_MAX_ADDR(dmar_domain->gaw) + 1;
if (end < max_addr) {
- printk(KERN_ERR "%s: iommu agaw (%d) is not "
+ printk(KERN_ERR "%s: iommu width (%d) is not "
"sufficient for the mapped address (%llx)\n",
- __func__, min_agaw, max_addr);
+ __func__, dmar_domain->gaw, max_addr);
return -EFAULT;
}
dmar_domain->max_addr = max_addr;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v3] drivers/pci/intel-iommu.c: intel_iommu_map_range failed at very end of address space
2010-04-19 21:37 [PATCH v3] drivers/pci/intel-iommu.c: intel_iommu_map_range failed at very end of address space Tom Lyon
@ 2010-04-30 22:27 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2010-04-30 22:27 UTC (permalink / raw)
To: Tom Lyon; +Cc: linux-kernel, iommu, joerg.roedel, chrisw, dwmw2
On Mon, 19 Apr 2010 14:37:46 -0700
"Tom Lyon" <pugs@cisco.com> wrote:
>
> Bug: intel_iommu_map_range didn't allow allocation at the very
> end of the address space.
> Signed-off-by: Tom Lyon <pugs@cisco.com>
> ---
> V1 and V2 of this patch were patch of a larger patch, this is now independent.
>
> --- linux-2.6.33/drivers/pci/intel-iommu.c 2010-02-24 10:52:17.000000000 -0800
> +++ mylinux-2.6.33/drivers/pci/intel-iommu.c 2010-04-13 16:51:55.000000000 -0700
> @@ -3632,7 +3631,6 @@ static int intel_iommu_map_range(struct
> {
> struct dmar_domain *dmar_domain = domain->priv;
> u64 max_addr;
> - int addr_width;
> int prot = 0;
> int ret;
>
> @@ -3645,18 +3643,14 @@ static int intel_iommu_map_range(struct
>
> max_addr = iova + size;
> if (dmar_domain->max_addr < max_addr) {
> - int min_agaw;
> u64 end;
>
> /* check if minimum agaw is sufficient for mapped address */
> - min_agaw = vm_domain_min_agaw(dmar_domain);
> - addr_width = agaw_to_width(min_agaw);
> - end = DOMAIN_MAX_ADDR(addr_width);
> - end = end & VTD_PAGE_MASK;
> + end = __DOMAIN_MAX_ADDR(dmar_domain->gaw) + 1;
> if (end < max_addr) {
> - printk(KERN_ERR "%s: iommu agaw (%d) is not "
> + printk(KERN_ERR "%s: iommu width (%d) is not "
> "sufficient for the mapped address (%llx)\n",
> - __func__, min_agaw, max_addr);
> + __func__, dmar_domain->gaw, max_addr);
> return -EFAULT;
> }
> dmar_domain->max_addr = max_addr;
OK, I split my copy of the patches up. I also added your Signed-off-by:
to my copy of this patch.
David? Jesse? Anyone?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-30 22:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 21:37 [PATCH v3] drivers/pci/intel-iommu.c: intel_iommu_map_range failed at very end of address space Tom Lyon
2010-04-30 22:27 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®