Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1539193ybg; Thu, 11 Jun 2020 12:26:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMFZSWGfrf2kNZ6PgoJhAmkzGuT5gVM7BC2UP+67SOb6+3/MfXutcRNAFAOqpk9oT/sKKO X-Received: by 2002:a17:906:695a:: with SMTP id c26mr10079365ejs.214.1591903615136; Thu, 11 Jun 2020 12:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591903615; cv=none; d=google.com; s=arc-20160816; b=TBN435ueEOkHCNtvawxtYS/FWPJ2oGMwSWjEz9b2+5oWnHJQUFAKtp6Em67BGiU6xd HUQsChGxIuQt64eP8mP7EGZRYsVfW5l5Mohb30RBaZqf0Sf6ThIDFkZcxr2CTmMGq8Sv pxx1LF1UEn2rPOdCnt2Xfsk7A+A6Me6O4S59X95L8JLZ2U2nbAp4umlklcLsmB+0UJfC FeiXrysH8J/oAuZpdCk3Ju8e5MenV3sDGMA8M11uEjLnMsEFoKKJdYzCizzR+RQyH/y8 6t06fHw4XUmL1K8leaoHbLp55nhhMTFLQYmV+RIi+lDlKGYAqQfn644nLbcjgHrqLr7k uFQQ== 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:message-id :subject:cc:to:from:date:dkim-signature; bh=vs8zuDzvjHdETDEcGTy3L+gn3DFxvZBwvmNgqN4PsP8=; b=VxAU71wIrQU4Ae1gs09XosqYcNkfbpBnekSRQHLGybhqiCrp/pNq58rKbfEcXMApVS xx80YvE6/IubTMx/2y1nmAPh9Q3luSKKIPHEpCuGgWFiLrJZCJZ22cYRqlStqAjz+cpl YKwTazNQK/EtuMa7BGvsD5ByS+yQNdmvtEjlUimmuy1u0eT1MwRs+uuCXXvVVONoon1Z 8OBZpzn0bzciF6dlmKBhBb95zwENCrna6Reio4Xn+1LEOFL0yZQDmRtqgBhCyt5Cjyi5 9tTiUP7PJ7B/68iUsQs0mw7qUeeR6sZTQEgzZZGUZQh8mGyhDrtExJ1K2OIqaGdebzCb mtYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cLhqFJsu; 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 ob23si2636339ejb.93.2020.06.11.12.26.31; Thu, 11 Jun 2020 12:26:55 -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=cLhqFJsu; 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 S1726597AbgFKTU2 (ORCPT + 99 others); Thu, 11 Jun 2020 15:20:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725873AbgFKTU1 (ORCPT ); Thu, 11 Jun 2020 15:20:27 -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 CD769C08C5C1 for ; Thu, 11 Jun 2020 12:20:27 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id y17so2690201plb.8 for ; Thu, 11 Jun 2020 12:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=vs8zuDzvjHdETDEcGTy3L+gn3DFxvZBwvmNgqN4PsP8=; b=cLhqFJsu1N/2ngljNE1bZa8+nfqnzZi/4WMjB13VYRrKiXxxh9TnKyU3rnpTIuEqso LrbP0J0WrIybuzHP4Hy9ob/t/lIMe7AAn2rdgO23DyfahHsHhNNFLgXadYJV1JPpHAZn NZo8AWG6yiXW9qWaUFsMOIfIwugr8kjyEJp6RNFql5qP25/9l/K1VZmqeFLH99dd+VIf 4FNfqf9Q5nQcyO2ezmSMHoC3IuvOiUyCZKDO5ZkKXq08No6Buqb/VdHc2FXM9B37sb+g whOTRTL/rvO/vAqmYaglbc8vp1f1CmqUKu1wvN5iEBvg7lfiFI4+oss2G7quLINrYGl9 i8Xw== 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:message-id:user-agent :mime-version; bh=vs8zuDzvjHdETDEcGTy3L+gn3DFxvZBwvmNgqN4PsP8=; b=khDcBwP3eEGF0t6IV/URTN0Z8kCrF6rK1JU87DL/9uGxe5RcjBtOqS4PUIG+BFRqGj k+jifoPLoCLNwtRuN6aUzW/Cu6fs4onuXIJVrd6Oy9NTxQWo048Dw6+842ggWPVv7sMN Odc/kSBzIub5UPBw5T53eplgXmKVde1YCe8BCtiP37Wb5GUUbdSBiXHMw9Qfj6hyHUAq cGUcJTNR0wkyn1CC9WK/MEA/9T4TvPXHpAQFhOxW5VbEUt7E3fKNB2K5K2BDvBuwoqxO /4ZphgYXftKkOomaLwFiOIbhbK1PTxjyq3GGv544RLL5f26H866D+NFA0g1QMtv89nEf Wg7g== X-Gm-Message-State: AOAM531btsJ2jbYyeJnqK2AlwBllvkHxzpjtDgoFz3k532SINdAiCYsT Y4rWDIE6i3tfnw+AcfRCQYBlPw== X-Received: by 2002:a17:90a:e801:: with SMTP id i1mr9154849pjy.79.1591903227192; Thu, 11 Jun 2020 12:20:27 -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 f29sm3470376pgf.63.2020.06.11.12.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 12:20:26 -0700 (PDT) Date: Thu, 11 Jun 2020 12:20:25 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Hellwig cc: Thomas Lendacky , Brijesh Singh , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [patch for-5.8 0/4] dma-direct: dma_direct_alloc_pages() fixes for AMD SEV Message-ID: 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 While debugging recently reported issues concerning DMA allocation practices when CONFIG_AMD_MEM_ENCRYPT is enabled, some curiosities arose when looking at dma_direct_alloc_pages() behavior. Fix these up. These are likely all stable material, so proposing for 5.8. --- kernel/dma/direct.c | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-)