From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: Re: [PATCH 22/34] dma-mapping: add an arch_dma_supported hook Date: Fri, 2 Feb 2018 09:47:23 -0800 Message-ID: <5d7dfb29-eeef-2280-13c9-5260e9104f67@infradead.org> References: <20180112084232.2857-1-hch@lst.de> <20180112084232.2857-23-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lVIIme6Jt6IhTbkXZiY+PAPS8MQ/8RDT2Vt7EuQJO88=; b=QySTwjJwAvqnh7 r4gu4lkTUP9tp/zaluUeEnKdryw6NHNzaQhly68EZQeaTDWBqZ3S3MU895j/wewsRl+nNU4CgNnJg YDT8IykYC3jbtU8kkdniD92TMefRDz6VQgt0Lg+g4KZK2xbA3EokRhFR+KwVLQ3HbL9kV+nX7OI8x u+TTxB2FPcs0v4qhkQafX6kavHVKl5AtzdqbZIzLKEKcsxMctrZLM+3Y9l1+ixu2MrPiGGuyU8jMm 9zxbP8yg3eo3lNw3i7iqQEWewfkkHDx8iPEO8DcYgubKcUMBaccl8dULmknoGn5M5UAAWgzmkEzc7 kYq3nyazG/jPfhxVKoiA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wOahYfPH3eqAbGWl///EiVWN8yzu/m5QdifGTHB8Dgc=; b=bWdqdLJiICz/HhEQHmVEEI9V5I b2NnwYz3+AT9i6+gB90OLvygXVj+ETZUSoe4TY2NtRL1Ou2id6xAZwEf3UpLgaU44Cpx7JjjkQUP3 etDxjgstCKm66c3EY/JUQ8XY6Ivaeunqcb+BTwgb8tSrTnTqiOFnsiZlhrFRMwrqTP3Kl+2Qc44Ou TEJzNs5IBKctMdwM4eoAEUgV1xZQG08+UMNH/3LlgcjU/Ui7UJL72bQSYxJbnr0VBvgxF0AsSfrsx MZiu506SOcRAg/Z80PEz4X36xfUD/2XBHdrL18WV2G9A4x+vZrlAqDWJVfy2nGPbWeBgO1dzgxy7+ nmOySb5Q==; In-Reply-To: <20180112084232.2857-23-hch@lst.de> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Christoph Hellwig , iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Guan Xuetao , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-hexagon@vger.kernel.org, x86@kernel.org, Konrad Rzeszutek Wilk , linux-snps-arc@lists.infradead.org, linux-m68k@lists.linux-m68k.org, patches@groups.riscv.org, linux-metag@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Simek , linux-parisc@vger.kernel.org, linux-cris-kernel@axis.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org On 01/12/2018 12:42 AM, Christoph Hellwig wrote: > To implement the x86 forbid_dac and iommu_sac_force we want an arch hook > so that it can apply the global options across all dma_map_ops > implementations. > > Signed-off-by: Christoph Hellwig > --- > arch/x86/include/asm/dma-mapping.h | 3 +++ > arch/x86/kernel/pci-dma.c | 19 ++++++++++++------- > include/linux/dma-mapping.h | 11 +++++++++++ > 3 files changed, 26 insertions(+), 7 deletions(-) > diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h > index 88bcb1a8211d..d67742dad904 100644 > --- a/include/linux/dma-mapping.h > +++ b/include/linux/dma-mapping.h > @@ -576,6 +576,14 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) > return 0; > } > > +/* > + * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please > + * don't use this is new code. in new code. > + */ > +#ifndef arch_dma_supported > +#define arch_dma_supported(dev, mask) (1) > +#endif -- ~Randy