Received: by 10.213.65.68 with SMTP id h4csp663387imn; Fri, 23 Mar 2018 12:53:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELtEPw3zfD2jvZLaeBtQPYqnk5eyTx0/8b20F+ghYR+0/AnbXBLbCdKi5qUAsLPj3KFgWQFd X-Received: by 10.98.204.214 with SMTP id j83mr13754220pfk.182.1521834823428; Fri, 23 Mar 2018 12:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521834823; cv=none; d=google.com; s=arc-20160816; b=Ai2tlUH+dl/AJVWkCHuxgrAi1XoEUO0Je/57gbFTuUsm4OA0Q5DbxdnhqMgtyGz7Vt WEqUp5HXTJx7ZyoCqD1wbIEWM5neZ3RLjLS8E+YLz5Hydmb3H+0s7FicAaAe0qumaOOB JkBznQlXqvR6CAxur6wPX+cyDkZU/DJW2+RleEmKMLj2lbSoyBtBC4WjJ15EVUEoWVYd bUqZlhD9J3twwNwXFheNTXjkldsFOyticpbeYVs5ph/a0k1gnPtyRNca/Lu3Ihk7O+af dNFwZMEtS75w9rY9cN1mSq6tf0GZSb4hDclJEu9cTOBaW9/0C4WqVdoxbO+UrOoEX1xH 8N0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=YwLB2YK+CtJaYvORncon1m488xpzhNEnwmbcnO0bw2c=; b=N5u3p2ZG4I0uzN5UN7ZmVTvGBjht6deqDdSeV1oV3gwZ0aX7K2/9G3OVu8JTW/B4j+ bMq3poIkpDCcIWAnfl3OqX3oHRaIWpSO42w/U5pfr8PUeiito0QOw4JqMPnHDngcD1rn Gwr1cgt6P0T54yykZJxyDMGMFbXZbeuBxQLt9UnOnq94lT4mS5vSIcyIS/wyyqydmBUN bvAjP21uZOhKsjYiw5iQDdjHRCe+CZcjQqNMoiN4oVHcOfLplXsnHv5xscQsfLyg/CEV EK071dGAoh12P9MTRAcUiGk4CXMJYeTFL2ZrKKlDG+DqRrrgAYgCHS/ZYmtfyF2hTuUG hFrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j25si6413088pgn.592.2018.03.23.12.53.28; Fri, 23 Mar 2018 12:53:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752384AbeCWTwa (ORCPT + 99 others); Fri, 23 Mar 2018 15:52:30 -0400 Received: from terminus.zytor.com ([198.137.202.136]:57889 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbeCWTw2 (ORCPT ); Fri, 23 Mar 2018 15:52:28 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2NJq304019929; Fri, 23 Mar 2018 12:52:03 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2NJq0vH019924; Fri, 23 Mar 2018 12:52:00 -0700 Date: Fri, 23 Mar 2018 12:52:00 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Christoph Hellwig Message-ID: Cc: hch@lst.de, mingo@kernel.org, mulix@mulix.org, hpa@zytor.com, thomas.lendacky@amd.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, dwmw2@infradead.org, konrad.wilk@oracle.com, torvalds@linux-foundation.org, jdmason@kudzu.us, joro@8bytes.org Reply-To: peterz@infradead.org, dwmw2@infradead.org, tglx@linutronix.de, joro@8bytes.org, torvalds@linux-foundation.org, konrad.wilk@oracle.com, jdmason@kudzu.us, mingo@kernel.org, hpa@zytor.com, mulix@mulix.org, hch@lst.de, linux-kernel@vger.kernel.org, thomas.lendacky@amd.com In-Reply-To: <20180319103826.12853-10-hch@lst.de> References: <20180319103826.12853-10-hch@lst.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/dma] x86/dma: Remove dma_alloc_coherent_gfp_flags() Git-Commit-ID: 178c5682447ac0e315f0f3e27664fd4e0d2721cc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 178c5682447ac0e315f0f3e27664fd4e0d2721cc Gitweb: https://git.kernel.org/tip/178c5682447ac0e315f0f3e27664fd4e0d2721cc Author: Christoph Hellwig AuthorDate: Mon, 19 Mar 2018 11:38:21 +0100 Committer: Ingo Molnar CommitDate: Tue, 20 Mar 2018 10:01:58 +0100 x86/dma: Remove dma_alloc_coherent_gfp_flags() All dma_ops implementations used on x86 now take care of setting their own required GFP_ masks for the allocation. And given that the common code now clears harmful flags itself that means we can stop the flags in all the IOMMU implementations as well. Tested-by: Tom Lendacky Signed-off-by: Christoph Hellwig Reviewed-by: Thomas Gleixner Cc: David Woodhouse Cc: Joerg Roedel Cc: Jon Mason Cc: Konrad Rzeszutek Wilk Cc: Linus Torvalds Cc: Muli Ben-Yehuda Cc: Peter Zijlstra Cc: iommu@lists.linux-foundation.org Link: http://lkml.kernel.org/r/20180319103826.12853-10-hch@lst.de Signed-off-by: Ingo Molnar --- arch/x86/include/asm/dma-mapping.h | 11 ----------- arch/x86/kernel/pci-calgary_64.c | 2 -- arch/x86/kernel/pci-dma.c | 2 -- arch/x86/mm/mem_encrypt.c | 7 ------- 4 files changed, 22 deletions(-) diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index df9816b385eb..89ce4bfd241f 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h @@ -36,15 +36,4 @@ int arch_dma_supported(struct device *dev, u64 mask); bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp); #define arch_dma_alloc_attrs arch_dma_alloc_attrs -static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp) -{ - if (dev->coherent_dma_mask <= DMA_BIT_MASK(24)) - gfp |= GFP_DMA; -#ifdef CONFIG_X86_64 - if (dev->coherent_dma_mask <= DMA_BIT_MASK(32) && !(gfp & GFP_DMA)) - gfp |= GFP_DMA32; -#endif - return gfp; -} - #endif diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 5647853053bd..bbfc8b1e9104 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c @@ -446,8 +446,6 @@ static void* calgary_alloc_coherent(struct device *dev, size_t size, npages = size >> PAGE_SHIFT; order = get_order(size); - flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); - /* alloc enough pages (and possibly more) */ ret = (void *)__get_free_pages(flag, order); if (!ret) diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index db0b88ea8d1b..14437116ffea 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -82,8 +82,6 @@ bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp) if (!*dev) *dev = &x86_dma_fallback_dev; - *gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp); - if (!is_device_dma_capable(*dev)) return false; return true; diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index f6cd84beb610..1217a4fab915 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -203,13 +203,6 @@ static void *sev_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, void *vaddr = NULL; order = get_order(size); - - /* - * Memory will be memset to zero after marking decrypted, so don't - * bother clearing it before. - */ - gfp &= ~__GFP_ZERO; - page = alloc_pages_node(dev_to_node(dev), gfp, order); if (page) { dma_addr_t addr;