[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191114081423.GA27407@lst.de>
Date: Thu, 14 Nov 2019 09:14:23 +0100
From: Christoph Hellwig <hch@....de>
To: Lu Baolu <baolu.lu@...ux.intel.com>
Cc: Christoph Hellwig <hch@....de>,
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
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.
> 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.
>
> 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.
Powered by blists - more mailing lists