Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1002502rdg; Fri, 11 Aug 2023 07:00:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBRUcOhD9heuTiDytsTvIwouujLnz8uVdCCaS6zImYuoNdOFMLK0E/txYdVxMPMqm3Fgml X-Received: by 2002:a05:6a20:9151:b0:126:af02:444e with SMTP id x17-20020a056a20915100b00126af02444emr2795515pzc.8.1691762409311; Fri, 11 Aug 2023 07:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691762409; cv=none; d=google.com; s=arc-20160816; b=gR/nSDZyZjkBRfjb+pivZZFyXdzTX6F7U/e/PfyZKfADMuXeriLXxWg+7lubIF9M/+ ADmPxva5yKXSR+N1bcw2WFKzwnAivZU1D6hiAYyxRY8SuPspgacC0LBurfarz1UbeztU j4EH2gGWY/2YAp1Si6brst1deuBQ5oh9ba73aUZq+X4BJOgTvCVMLWjd0LDVBPiW6DJn merZoMwBOG+40xUlxSSCeSmqKb5Mf5ECVSwrDAfGHiM9op3QxbUFbdGqUripgU09ASG9 ukd1GfntcHScU5QL+jckv3z+/q3KOK2oRiGbTU620foxWynbu9/hw5FrMk1M0fi/iCQJ pCkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=F7v0CVgY9abtWYoDC5bZkBPB2nRR3jrM6lzMQZBvyuU=; fh=AU6Jht05cQluBdkwxVnH5KkPo1KD/d2ngmHWHNOPqRI=; b=pVqSmjcmn2jXGZ82qNQbc0Huq1Uv860Shuy6JHYa9Xyjb+BMl6jH2b432ts515Qt06 bqz7qCJIzRG0JyC/XOeLTMY14n76+6y3Y6RemJ5cPylLbP3w0I0Qfq+vrYtM4m6JsPVC mKwh15dxeJSyIFXJZHFieY5GImqp7QaLbs2N84m6yAW1HFiIT7wzW2Mgjsru8sWDq+T9 gWiRgpkEeIO7TwrpOIAUKUKCLHPfKILeyx4iNgRaUGVohVXEnNCfTPjD4f8Ze9wliQI5 AWlURSsM0f3LN8Icz1S9ux0Mg81pAbDbhmVSAfqv7ltiiGM4kBhxe0nN9NcTjxp5+vYg MPKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=d1FmtARK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t2-20020a639542000000b0056513695aecsi3542918pgn.821.2023.08.11.06.59.48; Fri, 11 Aug 2023 07:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=d1FmtARK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234926AbjHKN1P (ORCPT + 99 others); Fri, 11 Aug 2023 09:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjHKN1O (ORCPT ); Fri, 11 Aug 2023 09:27:14 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 256D690 for ; Fri, 11 Aug 2023 06:27:13 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bdb801c667so4596275ad.1 for ; Fri, 11 Aug 2023 06:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1691760432; x=1692365232; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=F7v0CVgY9abtWYoDC5bZkBPB2nRR3jrM6lzMQZBvyuU=; b=d1FmtARKaIJHCFVHZhIvjyWeh9YdGWhpXHg47bzfdOXmJHlxrslCa7zHg+/JD34q0e E9/3cip0qUiYQyaSEfw8LW1KYUNSfz7+aubYzAfkCKxHzXz1aD/zcjb2url7DUGw3QFK kXh/FNJld8j2cKTYqxjXigAi37lX18p01LLlG5uqSynfTOhbWhbZ0fNQFC7p238++VRQ Zs3Uxt3iiHDirlnfq3y2keMcgFiobHWlXmeW33RUglZ5pN91g1cbMZjZhs4rHwsn9r1M 9rdF/SAB3CLwR+1IA27XUCeOTCmo4PB5RcAUhTvJUQJ7k0WobwUKOsY994haEl65WxVD I38g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691760432; x=1692365232; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=F7v0CVgY9abtWYoDC5bZkBPB2nRR3jrM6lzMQZBvyuU=; b=YqrtyI/1ggTDl/X/oFEiDzrf3vTwjvvYT4/dnmXWagqM0pPnSdnfBQAW9KKtSUzEcL UiWkbNnt14dmLkaufE+6IKnMGAy+uTfecf5CV+hVtEGjeoo2UMapLK6TX8smwqd4D7YG XP1vdGto174/ALCDuG9mBNmjWfZqXMeFTi4QT4qInWqtT9erltrpK23dhCWBEPRoSb8s 5rMbVWz6zTYU3Kpju0MhrNYr5D0o8ZGxajoY4Kynj/n+dkKrdA8xDhG/hc/LzK0zTDPM cIMQNncAn5+sHowaNWpTo6qrlPyxGwCAj9KJBol0y5yVrvynm8YRjBmaAvRYQcAYG4dx 0s1w== X-Gm-Message-State: AOJu0YydDelrD32DcptaPF2Kw8EK1uajNB9X5fVPY+vdaceYBoaLALT2 4wBZwpCWtyIjxw1AsL7aBiTjIw== X-Received: by 2002:a17:902:f551:b0:1bb:97d0:c628 with SMTP id h17-20020a170902f55100b001bb97d0c628mr2378919plf.31.1691760432689; Fri, 11 Aug 2023 06:27:12 -0700 (PDT) Received: from ziepe.ca ([206.223.160.26]) by smtp.gmail.com with ESMTPSA id s13-20020a170902988d00b001bdc664ecd3sm19894plp.307.2023.08.11.06.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 06:27:12 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qUSAY-005R9K-MW; Fri, 11 Aug 2023 10:27:10 -0300 Date: Fri, 11 Aug 2023 10:27:10 -0300 From: Jason Gunthorpe To: Baolu Lu Cc: "Tian, Kevin" , Joerg Roedel , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Nicolin Chen , "Liu, Yi L" , Jacob Pan , "iommu@lists.linux.dev" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 08/12] iommu: Prepare for separating SVA and IOPF Message-ID: References: <20230727054837.147050-1-baolu.lu@linux.intel.com> <20230727054837.147050-9-baolu.lu@linux.intel.com> <0771c28d-1b31-003e-7659-4f3f3cbf5546@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 11, 2023 at 09:53:41AM +0800, Baolu Lu wrote: > On 2023/8/11 0:47, Jason Gunthorpe wrote: > > On Thu, Aug 10, 2023 at 02:35:40AM +0000, Tian, Kevin wrote: > > > > From: Baolu Lu > > > > Sent: Wednesday, August 9, 2023 6:41 PM > > > > > > > > On 2023/8/9 8:02, Tian, Kevin wrote: > > > > > > From: Jason Gunthorpe > > > > > > Sent: Wednesday, August 9, 2023 2:43 AM > > > > > > > > > > > > On Thu, Aug 03, 2023 at 08:16:47AM +0000, Tian, Kevin wrote: > > > > > > > > > > > > > Is there plan to introduce further error in the future? otherwise this > > > > should > > > > > > > be void. > > > > > > > > > > > > > > btw the work queue is only for sva. If there is no other caller this can be > > > > > > > just kept in iommu-sva.c. No need to create a helper. > > > > > > I think more than just SVA will need a work queue context to process > > > > > > their faults. > > > > > > > > > > > then this series needs more work. Currently the abstraction doesn't > > > > > include workqueue in the common fault reporting layer. > > > > Do you mind elaborate a bit here? workqueue is a basic infrastructure in > > > > the fault handling framework, but it lets the consumers choose to use > > > > it, or not to. > > > > > > > My understanding of Jason's comment was to make the workqueue the > > > default path instead of being opted by the consumer.. that is my 1st > > > impression but might be wrong... > > Yeah, that is one path. Do we have anyone that uses this that doesn't > > want the WQ? (actually who even uses this besides SVA?) > > I am still confused. When we forward iopf's to user space through the > iommufd, we don't need to schedule a WQ, right? Or I misunderstood > here? Yes, that could be true, iommufd could just queue it from the interrupt context and trigger a wakeup. But other iommufd modes would want to invoke hmm_range_fault() which would need the work queue. Jason