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: <6069128f-354c-e708-fa1d-d866dc186d57@linux.intel.com>
Date:   Fri, 15 Nov 2019 08:57:32 +0800
From:   Lu Baolu <baolu.lu@...ux.intel.com>
To:     Christoph Hellwig <hch@....de>
Cc:     baolu.lu@...ux.intel.com, David Woodhouse <dwmw2@...radead.org>,
        Joerg Roedel <joro@...tes.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>, ashok.raj@...el.com,
        jacob.jun.pan@...el.com, alan.cox@...el.com, kevin.tian@...el.com,
        mika.westerberg@...ux.intel.com, Ingo Molnar <mingo@...hat.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        pengfei.xu@...el.com,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Robin Murphy <robin.murphy@....com>,
        Jonathan Corbet <corbet@....net>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Stefano Stabellini <sstabellini@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
        Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [PATCH v5 02/10] iommu/vt-d: Use per-device dma_ops

Hi,

On 11/14/19 4:14 PM, Christoph Hellwig wrote:
> On Thu, Nov 14, 2019 at 01:14:11PM +0800, Lu Baolu wrote:
>> Could you please educate me what dma_supported() is exactly for? Will
>> it always get called during boot? When will it be called?
> 
> ->dma_supported is set when setting either the dma_mask or
> dma_coherent_mask. These days it serves too primary purposes: reject
> too small masks that can't be addressed, and provide any hooks needed
> in the driver based on the mask.

Thanks! So ->dma_supported might not be called before driver maps buffer
and start DMA. Right?

> 
>> In above implementation, why do we need to check dma_direct_supported()
>> at the beginning? And why
> 
> Because the existing driver called dma_direct_supported, which I added
> based on x86 arch overrides doings the same a while ago.  I suspect
> it is related to addressing for tiny dma masks, but I'm not entirely
> sure.  The longer term intel-iommu maintainers or x86 maintainers might
> be able to shed more light how this was supposed to work and/or how
> systems with the Intel IOMMU deal with e.g. ISA devices with 24-bit
> addressing.

Yes. Make sense.

> 
>>
>> 	if (!info || info == DUMMY_DEVICE_DOMAIN_INFO ||
>> 			info == DEFER_DEVICE_DOMAIN_INFO) {
>> 		dev->dma_ops_bypass = true;
> 
> This was supposed to transform the checks from iommu_dummy and
> identity_mapping.  But I think it actually isn't entirely correct and
> already went bad in the patch to remove identity_mapping.  Pleae check
> the branch I just re-pushed, which should be correct now.
> 

Okay. Thanks!

Best regard,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ