Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5040327ybe; Tue, 17 Sep 2019 01:20:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmq5Y9Ihd0AxYcvMc/t3MC55jfiYB3JvDt/vYwsAOcJ+rZNOaCX//JlhEeiZkkDV1QxYMN X-Received: by 2002:a50:ab49:: with SMTP id t9mr3269305edc.301.1568708431737; Tue, 17 Sep 2019 01:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568708431; cv=none; d=google.com; s=arc-20160816; b=NDQtcjJLU3CvKDUGCWS/uu0hCFXIxjideshxAyAWYxj9xAgsxvTIxx0Mk+camJ8jyL oFOP4GFXZgaRUPTEwRQ7Gj13XBRccrGC8qA2JTDvJ5cuhnpKgnOMFICOpcAtyjjVMvOQ QZb+fQSeXtkprVFThmPAz50tcoKQeQZRmwPLA1x0Rb5wAbrZ1uoX32718Z+RdUwShLO3 Dw/9kc5u9j6rUhjXIGuDKFwXSF6xy6sqCFxNU8BGeAcqXub+2ODS7SnQQwRogYPLxi1W K5csrNQWTaogbGtHu/prIg1VWaUymDgzIWW4ZxwBEQtUghN2BTV+vCR4G5Uya7PTQSCP pMMQ== 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=gPeqNA84uKm/2CLfm5fXdDKqLvuPs/0PfIC1lZBDVcE=; b=jAg6VBhJXO95MNm1wmKJX8RFa+LmngJkohvmv+j5nxkFXkjOf3dF6aPul26ZV+rIaP 3BdXdaL7l3hdrY7MVjWeS+WSju68y/lL9elSgvPowB8yzQHh9KX5jntEoTBvVpYaC3SO djZWnBKeuyPS/wcAiut+k9PiBUfQ6qUtjJjUZLIHudRMou68UIVJx5IyCuIhwOYi1kSz oqZ2YuVRhAKrnDOHQ9tEkcXnYv8vO57eElFMxX4ndzwq3Qw7d8/yYzrXJNMW7YpXG74G FG+NSgGD2uJhlL2VTu/ZwtumYeEnktHfahKSO0o4m5GYzM7Wjtk74QJwO8u/bTrQfccH z6hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="r5a/XbNS"; 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 c12si914164edb.394.2019.09.17.01.20.08; Tue, 17 Sep 2019 01:20:31 -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="r5a/XbNS"; 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 S1728108AbfIPXp3 (ORCPT + 99 others); Mon, 16 Sep 2019 19:45:29 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45698 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbfIPXp2 (ORCPT ); Mon, 16 Sep 2019 19:45:28 -0400 Received: by mail-pf1-f193.google.com with SMTP id y72so894845pfb.12 for ; Mon, 16 Sep 2019 16:45:26 -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=gPeqNA84uKm/2CLfm5fXdDKqLvuPs/0PfIC1lZBDVcE=; b=r5a/XbNS/jvudcLZbnEeEeBgDSpXdAkOEjlEqjWaVl7O/Keuu9SWppYwdpzqS9XUXd I++cPOGgE3jNUdIa30WtGkrBMf4xdS9Zym5SrGinlequi+YmMUh3dt3nzoY9x4MaQWbL a1PPBz0ECe86QyfBSkBMtFmZttbnAAC9nF7T3lvNBSbvbSfKh3CY6yHLQClu7mta6BxQ qFbfpNyr2CMtxnhne3PMeSYau+1m6+CUl680SgEhuv4n7UrmGSjgdWsNsQX3wZLaNXlB xWZyM1MT6hkXu/o0YiAC0cwF3yKfzKv0gwjjjK9Rc4eSqWan27FtAEqudrqfcz8ao8b2 yYzQ== 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=gPeqNA84uKm/2CLfm5fXdDKqLvuPs/0PfIC1lZBDVcE=; b=nDZIcojodXKG/avNN1XxoGTKy8eVS1TDcc12SM/7yH6L2fD72aYLEJKMNOotIPQ2N3 HXmI7rAdeRHHEC4heUM+wRkZO340WpZAfqINVLucI1MoZu06xSWy33tb4LGcvar6KVtS fhohcb8yNbFFmJDCEN2iSIvMNX8Ut5q0dcRBwZkU4pnZjoRAtTr94Uqd9iXY6BbEn4hB Cn8mJwc9uJk7+BTWHP9xwrYBDYtPBehMxnPkiWnj2hHoZp97vu6ckxdBW77OQ6Cae49d 6l8Nhtsj/bQ9gqVkD6GMpnZg/uUh/eXq10LkAHAWPkD+fLfmtmyajUnFVcUxWwqncwne S1VA== X-Gm-Message-State: APjAAAV77i57fNBQFVq29KMYzBj6BPcPnS9U2mKcIhb7xOnl7wxhJDgC x5JyvQu93bkwqk345Sng/QQgSQ== X-Received: by 2002:a62:b406:: with SMTP id h6mr1028857pfn.260.1568677526290; Mon, 16 Sep 2019 16:45:26 -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 m24sm183103pgj.71.2019.09.16.16.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 16:45:25 -0700 (PDT) Date: Mon, 16 Sep 2019 16:45:24 -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: 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, David Rientjes 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. > Brijesh and Tom, we currently hit this any time we boot an SEV enabled Ubuntu 18.04 guest; I assume that guest kernels, especially those of such major distributions, are expected to work with warnings and BUGs when certain drivers are enabled. If the vmap purge lock is to remain a mutex (any other reason that unmapping aliases can block?) then it appears that allocating a dmapool is the only alternative. Is this something that you'll be addressing generically or do we need to get buy-in from the maintainers of this specific driver?