Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp472758ybe; Fri, 6 Sep 2019 02:20:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVqgYNbPJv6d/j4wwIC4ziGAp8YbDRDVlUmsOzW5kKQ5deCSQJBA0ya4BXfqn41BNBNmea X-Received: by 2002:aa7:8259:: with SMTP id e25mr9239944pfn.166.1567761656313; Fri, 06 Sep 2019 02:20:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567761656; cv=none; d=google.com; s=arc-20160816; b=AJMzrkdFB7TJ511McvVujKzzk0TfImID4Thfiq8McmbKof6TE+3q/3xNRZMvmEdyzj +bAHzxI91IQj5u4H0ZjGjlkOaJVa3vvCWBy/LC1uY2uRWgPcN8SaxMgt2sxYb0HEuars K1B1DW+fpuEA093QjvGxOQL7beC/QSV+jzlJ47j6uoqZNYF76lQcllx3Y5e3aQ1odhq5 aPOzmHNvP4h4axWFx0sZHBt4IEjlps9AnVI1WwFDaR0nzxoTnokWglT2LIWZJiWTXpZT /Lehe7WICSNAWaKgSTrVtE6HCvQ91CBkoSe+KQOYDXeNsELx9A6Yd1Cserku4vvhj9dU yKnA== 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=GjBspe2tpCYYNWjl2LkWvULdU+0U6Dxr2p5C7+1bhNo=; b=MP12sCAp2cq9URH170VzeWmBcdT/VhCqPw7UONVpQHMGrFjgFj4mtqcmMqoLh+TSBm zeqXza2OwEJdQuXvYcoOq2pyHI5Fdi8CEiLw6VSEEubC0sVHcIprxm2DMrRySf5sk7WM 9PzwDydSM97DwSQsPmoejNTVujo6Vuw9hdAbBI/GK3MzjEiXFjNmEefOE+9IQ4UeCk5Y x/70oWm34IOK/o9U0i5lwoJHTfru1IuTVRrPDMosMDT0IBj7BTfftqcgF+PCzAyL7l9/ pr63vaJjp3yYU4GL0kc9r00+mykkFlGzoAoTAtEa0dhVoYEzNEJWa0lbCk8SeK2XOBKN 1Tqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Y1yQmcMa; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si4276599pgj.442.2019.09.06.02.20.40; Fri, 06 Sep 2019 02:20:56 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=Y1yQmcMa; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390334AbfIEWhT (ORCPT + 99 others); Thu, 5 Sep 2019 18:37:19 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33895 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731969AbfIEWhT (ORCPT ); Thu, 5 Sep 2019 18:37:19 -0400 Received: by mail-pf1-f195.google.com with SMTP id r12so2878980pfh.1 for ; Thu, 05 Sep 2019 15:37:18 -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=GjBspe2tpCYYNWjl2LkWvULdU+0U6Dxr2p5C7+1bhNo=; b=Y1yQmcMalmEQm/Vqme6jPHNnMCdfGOzjjTtdcAIQEZZxyHtB2fOyO9RcDwAenVynP1 oU2EWbBV8k3A/zrgzHKlhFl+OCjJA7+iFcROUVfqu0zVQJtdvGeCfe7NjlSjJt95b1D/ +sI71E2Mgibu6zo1UdRBXiR6W+COpXDLAoZJKjTAFkblQQyepPHdb4Yw2B60eqK0bc/c 5EZFQrraRiPZCgjeT/i0tuIlybmJBkDEeBq26FP+YjU3DIMEx+nkahOJs0NYOvvE8G4b wnhaXgd+jxqZlunLBkPxADJY04Lpuw8sXJbBOQ+cwbRupYKGQyxmFyerDToQmxrK9FHT swJA== 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=GjBspe2tpCYYNWjl2LkWvULdU+0U6Dxr2p5C7+1bhNo=; b=Z3dXioqv6vpxeUPXfvRiQYfAMtP4AyZ1OojN8ulsMN24ofRa8/tcxBSFxAe5LXD+5B wFKIP3X4kcMfvPoIqkbA8lsL50bXTLW1u3Q8dQaIg0PisRhLKUp5VlDllnaM5DmSNcFJ jxgqPLGFjgyBmdFZmzNKunIyMTPv2HT/kSxor4OknlcHLzqMnyHJN12uIPm+4+tP5Gp6 qSolNvqYpo4FT+OvOdGtfnnVaIuoHb0rNOdaVX8R2eYnI35e52V2oaw5ztRNYnjz4E9H wqqtNyZPX3y9oqCycO4s6RT802pl8iIeTBt3UeAW13wsbVNWNXJ3uyYwBRy3/zf4rHRA lsvw== X-Gm-Message-State: APjAAAV5xjFaDgb0vOKqjKaxYubqaYQyp0fPEnvNr7i5f1XrR2p6mM61 WVaKBW68dQ+zLlszVU39S/Q16A== X-Received: by 2002:a17:90a:32c8:: with SMTP id l66mr6539209pjb.44.1567723038296; Thu, 05 Sep 2019 15:37:18 -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 l72sm8557163pjb.7.2019.09.05.15.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 15:37:17 -0700 (PDT) Date: Thu, 5 Sep 2019 15:37:16 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Hellwig cc: Tom Lendacky , Brijesh Singh , Jens Axboe , Ming Lei , Peter Gonda , Jianxiong Gao , linux-kernel@vger.kernel.org, x86@kernel.org, iommu@lists.linux-foundation.org Subject: Re: [bug] __blk_mq_run_hw_queue suspicious rcu usage In-Reply-To: <20190905060627.GA1753@lst.de> Message-ID: References: <20190905060627.GA1753@lst.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) 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 On Thu, 5 Sep 2019, Christoph Hellwig wrote: > > Hi Christoph, Jens, and Ming, > > > > While booting a 5.2 SEV-enabled guest we have encountered the following > > WARNING that is followed up by a BUG because we are in atomic context > > while trying to call set_memory_decrypted: > > Well, this really is a x86 / DMA API issue unfortunately. Drivers > are allowed to do GFP_ATOMIC dma allocation under locks / rcu critical > sections and from interrupts. And it seems like the SEV case can't > handle that. We have some semi-generic code to have a fixed sized > pool in kernel/dma for non-coherent platforms that have similar issues > that we could try to wire up, but I wonder if there is a better way > to handle the issue, so I've added Tom and the x86 maintainers. > > Now independent of that issue using DMA coherent memory for the nvme > PRPs/SGLs doesn't actually feel very optional. We could do with > normal kmalloc allocations and just sync it to the device and back. > I wonder if we should create some general mempool-like helpers for that. > Thanks for looking into this. I assume it's a non-starter to try to address this in _vm_unmap_aliases() itself, i.e. rely on a purge spinlock to do all synchronization (or trylock if not forced) for purge_vmap_area_lazy() rather than only the vmap_area_lock within it. In other words, no mutex. If that's the case, and set_memory_encrypted() can't be fixed to not need to sleep by changing _vm_unmap_aliases() locking, then I assume dmapool is our only alternative? I have no idea with how large this should be.