lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOZdJXXtZq6uyE+5sseX7M_6Kq8wFG+37qd5TNSusKj=0gd8zA@mail.gmail.com>
Date:	Fri, 15 Apr 2016 13:29:14 -0500
From:	Timur Tabi <timur@...eaurora.org>
To:	Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc:	iommu@...ts.linux-foundation.org,
	Marc Zyngier <marc.zyngier@....com>,
	Tomasz Nowicki <tn@...ihalf.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	lkml <linux-kernel@...r.kernel.org>,
	Will Deacon <will.deacon@....com>,
	Sinan Kaya <okaya@...eaurora.org>, linux-acpi@...r.kernel.org,
	linux-pci@...r.kernel.org, Hanjun Guo <hanjun.guo@...aro.org>,
	Jon Masters <jcm@...hat.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>, vikrams@...eaurora.org
Subject: Re: [RFC PATCH 09/11] drivers: acpi: implement acpi_dma_configure

On Thu, Apr 14, 2016 at 12:25 PM, Lorenzo Pieralisi
<lorenzo.pieralisi@....com> wrote:
> +void acpi_dma_configure(struct device *dev, enum dev_dma_attr attr)
> +{
> +       struct iommu_ops *iommu;
> +
> +       iommu = iort_iommu_configure(dev);
> +
> +       /*
> +        * Assume dma valid range starts at 0 and covers the whole
> +        * coherent_dma_mask.
> +        */
> +       arch_setup_dma_ops(dev, 0, dev->coherent_dma_mask + 1, iommu,
> +                          attr == DEV_DMA_COHERENT);
> +}

I have a network driver that is impacted by this code, so thank you
for posting this. (See
https://www.mail-archive.com/netdev@vger.kernel.org/msg106249.html).

One one SOC, the driver needs to set the mask to 32 bits.  On another
SOC, it needs to set it to 64 bits.  On device tree, the driver will
use dma-ranges.

In your patches, where is coherent_dma_mask initialized?  I found this
code in add_smmu_platform_device(), but I think this is setting the
mask for the IOMMU driver, not the individual devices.  Either way, I
don't understand where the correct value is going to be overridden.

+       /*
+        * Set default dma mask value for the table walker,
+        * to be overridden on probing with correct value.
+        */
+       *pdev->dev.dma_mask = DMA_BIT_MASK(32);
+       pdev->dev.coherent_dma_mask = *pdev->dev.dma_mask;

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ