Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp604792ybz; Wed, 15 Apr 2020 15:00:42 -0700 (PDT) X-Google-Smtp-Source: APiQypK04b7+OBhpMZe1MVc9SxQHfny56HkxfZjt2sfsHHe+idD3JdMCkGcDPFxdcNOxnSj+uk8x X-Received: by 2002:a50:9d83:: with SMTP id w3mr27534503ede.23.1586988042254; Wed, 15 Apr 2020 15:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988042; cv=none; d=google.com; s=arc-20160816; b=kiDedZlfRfDvK3N85DlsUN6yfJA43ZV6uqI2gWt09uLPhabFqPV1jVLIkBrNUnexIJ DybLuLu8UY3EvAHSbaJD6jzmsQ8bDS9SLb1Ouh4DFhVDdsxZ7L03bF5rR+N+y9+0J3Jz jjL4ctEBJr87PdmwyH2iWeakBYIeK9/N7bQpmQcgBmjErVVGCNxfPZlOmwUEy3o0jd3t gkcp6oexe9MjlTVCM3MNfQ/puzj3he0VxiTFmj7d6aULH67hpDMrIFYrvfHuQ86WFTCo 4GlA7e/9hk5DroUSZH225h/41v1u96o8MuYE1XcwvW/TUe7052zZYEKJBMOzd8YjLBYd i7Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=KR6uSQVGwCyM0LnuYfYFDEMfJVon1ni6IuCovgn4/s0=; b=OSDmN/CF0Rb2nKdQjdg8YCf4Hu5efr2e3IC+iT2SXGwTKHO1TV88c19Zn5sQ5Hqthw TJEkDh1Lk1LYdhERcKdPo+v//T48O4kJTU8iplDGKu7UIq/r2zDrThabJL+JLg/zLjWm Gpauq8fpYCD8zTXcbpttbf0lGB1UH9OMmUZbLZVOggGVaQepKpHWy4bJ6liwX/CMdr2R 99FCK9KJGL4CfIuRT2tucWNbior29+GJtCVNspRUvqpKW/EqDsYUlhhItSlF6nZso0Zx FHHfkAxW7yjMpaRb2zn77Mpkcs6VDmFDcX0hlwpY2Zlv3JmM77US4v8myS4kRO+OJO54 qIcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rqKtzwFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv23si9698752ejb.330.2020.04.15.15.00.18; Wed, 15 Apr 2020 15:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rqKtzwFZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392225AbgDOAGf (ORCPT + 99 others); Tue, 14 Apr 2020 20:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2634556AbgDOAFD (ORCPT ); Tue, 14 Apr 2020 20:05:03 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042DEC061A0F for ; Tue, 14 Apr 2020 17:05:03 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id h11so567633plr.11 for ; Tue, 14 Apr 2020 17:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=KR6uSQVGwCyM0LnuYfYFDEMfJVon1ni6IuCovgn4/s0=; b=rqKtzwFZVZWUOiIrgJExufYVXu3Tq6MqN9fZu+ZH2YWZFYDd36z9cKaQb1z64mO7tH MqHd3c/DVdGpEppY6hDK2NUcvYFc9GB0boflgmYFjwRnXpj7C88Raa2vtIKHZltPbaZY Yq4XjmwAMnLhc5OAOpmyCEprZER5wgs9TG0NXMxxpAvZslYPLWReI9hEIrUglD3v33nE uvdcK2H6ZpBcTwk6YibzffwOAU+UcafvBxlbh/n+dtdh5ojeU1wXawqu+7tuuraTSg2r hAMC56p50b97myh5kSGVE5o5KJpXUH8ugjcM1X8zg5XSTobhilOhGVEwO0sF61kP7SMB 57ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=KR6uSQVGwCyM0LnuYfYFDEMfJVon1ni6IuCovgn4/s0=; b=IjhZKlYgBZh/GBkvoJpYNEXQvfF/XZWaVbuzd70CA1ytLybHQunDKuGW70zgOTxbWE Y9+Xca/0+nfzBZ6fMwDMJAmanixdS7C7S+RHRZyDWzh6QVh9RVQlTTKh1CRoejIuJhqj v3w10Y+rpkbq9m4JYzurxNssM7i3Q0VHi1QUgD+tsmmAMaBVTRZc+m3XWKdglUEP/ivD sgQ/OXPHuI+yKPGSqdPEQ3GPI8RnrbUQBb8qC6FF0GMlIe6kX4qvh1Zr3XfxUvaZ1/Yh EqQrED/g2LJEbthgXEg+DYg9Rz+MrFNFHoGqG7mHpZMQXCnH6jIKIVG/L9hwfcgO4VbY UKHA== X-Gm-Message-State: AGi0PuZzFTzuAiRjA5/JhHUGWKUOH9R8wuXuTbL8C/QN0Ld8WFk51FHn 2+ntp8bfDO5YxL+stAwPXFHf2cxW+Io= X-Received: by 2002:a17:90a:22e9:: with SMTP id s96mr2911139pjc.46.1586909102385; Tue, 14 Apr 2020 17:05:02 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id z7sm7286945pfz.216.2020.04.14.17.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 17:05:01 -0700 (PDT) Date: Tue, 14 Apr 2020 17:05:01 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Hellwig , Tom Lendacky cc: Brijesh Singh , Jon Grimm , Joerg Roedel , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Subject: [patch 6/7] x86/mm: unencrypted non-blocking DMA allocations use coherent pools In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_AMD_MEM_ENCRYPT is enabled and a device requires unencrypted DMA, all non-blocking allocations must originate from the atomic DMA coherent pools. Select CONFIG_DMA_COHERENT_POOL for CONFIG_AMD_MEM_ENCRYPT. Signed-off-by: David Rientjes --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 1d6104ea8af0..2bf2222819d3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1520,6 +1520,7 @@ config X86_CPA_STATISTICS config AMD_MEM_ENCRYPT bool "AMD Secure Memory Encryption (SME) support" depends on X86_64 && CPU_SUP_AMD + select DMA_COHERENT_POOL select DYNAMIC_PHYSICAL_MASK select ARCH_USE_MEMREMAP_PROT select ARCH_HAS_FORCE_DMA_UNENCRYPTED