Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2056766rdg; Sun, 13 Aug 2023 07:28:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSuxYuQWFWUPb2FfRD4aYMPHLHKvaajJCBECzz6hMPnsWmyoav+qme1S/gD7ojg7Z2kHsd X-Received: by 2002:a05:6a00:807:b0:64f:aea5:7b49 with SMTP id m7-20020a056a00080700b0064faea57b49mr7389940pfk.17.1691936910519; Sun, 13 Aug 2023 07:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691936910; cv=none; d=google.com; s=arc-20160816; b=Q3AhqHhlz7nF0gS+4pomKBotA6vg1nrOhfVm2uBF0aF931qJZR0dm5SxaInzddGQT1 bKIVIWmVE84wx4JvLmKd408nu0mv8flCMfuukk5KOsEfHJ1RiRF0lBLtW5g1wCR5CWz4 rfyUGONnMMSHT9O7zbcrBTQw5gLV1hUd9Bg7n4kd10Abz59q+jWvXFXWexQNK/eE01H/ WP1dZzIJD9m8K0IHAxmDULLRETcENOr1PfJzSSos44NGGSFvob71IBpyx8o9sjcaVoKC 4efeCgTNCXXdRMMtINF8WAm7UGvHm6hkLjPczSA0iV11OZ/vQUyxy43xVF+kT033AIUb uWig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=hXE5Jozl2TPweRN3216tRkvqTJXcEdtOSikeva+mjcw=; fh=UEz6sMa6Z9Yb82DQLgJsUzYwiRGN2Hd1hUPApeOyPVE=; b=L7ftiUa3Ef0fl1zK7tLpO9VW5WtunuuUFFDwIBvKYwvOhxJ04QGuQd3C6RhGwm1w91 C7CJwjjDm/1pWENFewtrt+MjSH05FVJA7oqIThqYHfB81X5vwc4EmAxL6LGjvErsH4gD ZTb7ZY+YZpDDbUFHOaLldBz4rad9ACYMWgIJQhYxyTYC8RYQpEMwxuSETAcNPbm51NVE coefTrSJgTPtHaHu6adQHw9IghyiZapQd3H5aUu3A+YLY0sBJ3dU7+QT+H9NL296Yh+/ IzAiIjSv/PsMchyr3jHWZ9Qt6Tn9+1sPnEqAKzTwIjA2vQboGSAxcM2QW1rvFPvAW7em oYjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hA1Q1p/h"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c23-20020a63d157000000b0053fb354c194si6647585pgj.659.2023.08.13.07.28.18; Sun, 13 Aug 2023 07:28:30 -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=@intel.com header.s=Intel header.b="hA1Q1p/h"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjHMLT4 (ORCPT + 99 others); Sun, 13 Aug 2023 07:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjHMLTy (ORCPT ); Sun, 13 Aug 2023 07:19:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD1B10DE; Sun, 13 Aug 2023 04:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691925597; x=1723461597; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=+CUXVj1jmKu9wNFCyhaP7miPAmbIeMOb158GcXhBV/M=; b=hA1Q1p/hm6h3s62Vd79DvDaGCDb6sa3JPG2pXwIXUO7C9ZbE4w2yHH+k zSk7FKFMLH0vcycOjaZlfMMl+9rfqXoWyW3aB1kVqEM8NWMJQAgQ6NDIy bjilzJwXXJ+0rbwNAwYVYc2s7fM5tnJp+Lh+FW5WfM2hJAsQ709kRE8M3 8bXxq9T4TjwKc9gyUW1Xle29CRFWepkyDj8SCyB5rpBHnHu+qN8a/c9a4 CTIhVDAckv1KNR3IIMCs/BGO59FUDsxXkdYTdQtFB11qFNkfNGM03opwy M/KP4OHHxm6CzgIfloM2cv9+r5M4j0G4MBHc+ogQlXD/iNZBWfXyVQhlw A==; X-IronPort-AV: E=McAfee;i="6600,9927,10800"; a="438222205" X-IronPort-AV: E=Sophos;i="6.01,170,1684825200"; d="scan'208";a="438222205" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2023 04:19:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10800"; a="683016422" X-IronPort-AV: E=Sophos;i="6.01,170,1684825200"; d="scan'208";a="683016422" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.215.185]) ([10.254.215.185]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2023 04:19:53 -0700 Message-ID: <08ef3338-535a-751e-0cc2-5f5af8107194@linux.intel.com> Date: Sun, 13 Aug 2023 19:19:51 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Cc: baolu.lu@linux.intel.com, "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 Content-Language: en-US To: Jason Gunthorpe 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> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 2023/8/11 21:27, Jason Gunthorpe wrote: > 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. Yes. That's the reason why I added below helper int iopf_queue_work(struct iopf_group *group, work_func_t func) in the patch 09/12. Best regards, baolu