Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp608112oof; Tue, 25 Sep 2018 02:10:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV633H7NulVnqzogjMggGMJ3P9ZVUojT+++WuN6LooBFg9C5xAnmdZX53NBsch10tQvgWpQtC X-Received: by 2002:a63:4563:: with SMTP id u35-v6mr139922pgk.30.1537866618217; Tue, 25 Sep 2018 02:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537866618; cv=none; d=google.com; s=arc-20160816; b=U4M39fNaugtGpboiop7RtDpJvYnx8BMRNJxJd/TBAek/NJQqrkCpIY/3nZ2UwCTjwI CUBB+uMj1KfTa9beSBbK2J/NOxNdc5Q+oxg/ryF0xTu2YxCjlvstsoaGmXbqH8YIg90l 7J0AW421uXrPA+nNR4CblI/jY9XLH79c+VT97xH76jUq0Sh2SkgILLlBDzH88FQn3BZl qLpql1nzyPN0EzgaeOJgGvcSWl/AbKAOV0elR6Ud6XpPYSxcUWtWnaecBF272rhpB1GL TzkC4i39+9GpMBY3cVfqfwjgbS4VmW3Se5UjY1/wqlLemN9l7sXKknzoJb0AasgQJw72 2IXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2Wl7MLR2L2ayMRv/VO5yyxhu0Y24n/EbSCjq6c7ygsA=; b=RX5cZApYznlgS7lhE7xlrvibPr7vdLpqFQvFwOfz3HqYd3MD6yRnSlIomK8Co8+BUa VS84o7d3n3c0F4EhXHXnjG/qioV59PWM9YZmYokjpzFkaL4BmSUARUoODzi+qIpTb61p SpV9lIRqi3kk1vYF/0YQhx9m7lbrXgTc0HOU8ts7q5IcL0cXVhueLOtFl1ns+2cRrxeS pS9gMBE6ujkL0Ryw8j+GPeVytN101jcXm+oPWfKrDgTBuHCh+3tLBnD5COm3WC0jW6CJ izRMC+zium5CbQL/xCR9YkHy35l3+sZLLPS3TthL+vKZ4dZNVVdMIO/5mdYJJj8GQOT6 bGFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b="XF/8tkNt"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn22si1831433plb.139.2018.09.25.02.10.01; Tue, 25 Sep 2018 02:10:18 -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=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b="XF/8tkNt"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728510AbeIYPQY (ORCPT + 99 others); Tue, 25 Sep 2018 11:16:24 -0400 Received: from 8bytes.org ([81.169.241.247]:33750 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbeIYPQY (ORCPT ); Tue, 25 Sep 2018 11:16:24 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id A8F506FB; Tue, 25 Sep 2018 11:09:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1537866589; bh=EP0pGRqKC2ZQwSyO2dkc1ia5+0d39Y3Q4LQHEcqeuqM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XF/8tkNtfUF7PuXDLGDvLy0DOjGapCsIa1DejJenGRg/7MCN7HI0rF9jR9G+dpYCK f+0Re2fR65NeQWxzSGcLxKSVZ3vNJ639s+n5CIuldXMwvB/VfWxEzBLqyo+DUlrNC+ 1O/6Q7Y2bG/QUwsO8pUIp1EQNK562jHfKwFcfmusbZ9TDEU8JdGsmXOObLEFdzUtww R2WnJfdYDm3nnFdOq9kXg+5fEwMSj9CmdsnL43OUPQcrOQit3Q4dqzEIl/FFFM1n0O GFO25kLZUhPZRxClyvAVTgnpwgEbq9Ljhvw3GZ/wbQaA8kNU15vUKo9hhuU0oMlC3c MLp9gAIqnq0UA== Date: Tue, 25 Sep 2018 11:09:48 +0200 From: Joerg Roedel To: murphyt7@tcd.ie Cc: leo.duran@amd.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Changing the AMD IOMMU API path to work in an atomic context which is necessary for any custom drivers using the IOMMU API while holding a spinlock. Message-ID: <20180925090948.k62lms4t5qduwnpo@8bytes.org> References: <1535120929-5693-1-git-send-email-murphyt7@tcd.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1535120929-5693-1-git-send-email-murphyt7@tcd.ie> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 24, 2018 at 02:28:49PM +0000, murphyt7@tcd.ie wrote: > From: Tom Murphy > > --- > > This patch allows the IOMMU API path in the AMD driver to be called > from an atomic context. This is useful for anyone building a driver > which needs to call the IOMMU API while holding a spinlock. A bit more context would be helpful here. This is a pretty intrusive change since we will drain the memory allocators atomic pools now while building page-tables. This needs some more justification than just 'some drivers might need it'. Further, if we really address this problem it needs to happen through the IOMMU-API, because the functions you are patching are called from iommu_map()/iommu_unmap(), and these functions are allowed to sleep. So the required approach here would be to introduce something like iommu_map_atomic()/iommu_unmap_atomic() and implement call-backs for that in more than just one driver. Regards, Joerg