Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3041181rwo; Thu, 3 Aug 2023 20:56:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsdSW5TTZ/qhKIfSgD/bX+bW4YH64CEJEWRjoyAxLdU0R14un/aaYpzKqQQ5Upkb7JoRLv X-Received: by 2002:a05:6870:612b:b0:1bd:55be:5880 with SMTP id s43-20020a056870612b00b001bd55be5880mr840356oae.42.1691121417029; Thu, 03 Aug 2023 20:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691121416; cv=none; d=google.com; s=arc-20160816; b=aoeeOBmCbBI9FtgTZ+/CjLsdrcW5Q1LUcoy3GbpKLnremEdgZ6fNeaoQGMiWUY1nTn 5W3dyEZkD4JGPmcRfyMu7sBm9Ky5ae32fXj63F4PJ0lh1/JVntjTV3I9oLlVmPOHBniv bz6mKOOcnSjFgOLisfNDW/JC/g6ZJl+1WHpxh2zHt2jkwARO6v1c19pOFjS7qQ5pn1Fr 6uea5ZUIDhrK2Ro1oibZEnVHaMpJ8PRfFaJsirBBzqIzoWy69ZfvoDfyR0w54PODGb7b 1y5vssFb7GQ5ziyv5ftbKYdNrFbnM2k3OAXQh1I3yQ2f2twQfCw5w94Y4NX7AJ3zXQ5N 2CMA== 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=o99IPJGqenVBr5O0Gl9QwjeeLoEtwIqXzLLihPQldJo=; fh=lUKVdYiTv5UZoEavPARWrYLGgaq0Tzj7zaAZH6YskUw=; b=kLyo3XohnYmV7A0XUnzdceK7FiaehLg9lRDoFnL6YouyRG01gD8lzc2i+MMXpOfByp Nv0yGc+D2koFwSQ7M/hDmjTxR38LCcTQEkEzaQ0xKO98BgraLiDFcQO61kE8tmwkLwo/ kefNxIV0sXzkCkPDr89b5FJR0r6mHdMCx73Eu2/MZJGHpd5Hg4sVkZ6skj7ys2jTgzXM J4PdlHvv9u8d+idDKkxbvhpXBLTIKx1lWxwlSd4BBkRPvsbhdaILU0Efz/suk29sQ1dS ZtYex1ovLULw7znk3k6JByIqawD5Qsky6AgWb/CyXviM3A+U1OjSkvdCcIBVwHou4Yvu aung== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=m3lncYGD; 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 y23-20020a17090a105700b00267f3363479si1124210pjd.57.2023.08.03.20.56.45; Thu, 03 Aug 2023 20:56:56 -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=m3lncYGD; 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 S230116AbjHDDTH (ORCPT + 99 others); Thu, 3 Aug 2023 23:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234031AbjHDDSE (ORCPT ); Thu, 3 Aug 2023 23:18:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA624EC4; Thu, 3 Aug 2023 20:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691119022; x=1722655022; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=p5M6mWZOrJbOzGv3rGRYdsPicseUodG6yxaSQfOLaTY=; b=m3lncYGDC4em4Bj7SOYyGLqWLGtt7DYvZ07Ho/E6651KIBYNwTuKrYyU b5rc9UMLEV4WW9Uie0c6YGpDlUbs0ko5tK0wNc9HlIgtxhSo0QRN+ckX0 MnTo0hI6f7Ja7JExX3w9dB79t/xrNq55S94BwuMYqlnW/zB4fAHxl2d+7 P8v9u7Rw/HbZjALz6PG4kLfKYhtKAkMA51cBooyE1iAsnKLFZF8/HmIs1 yiXlBKyfRdvGTu+Z7BuX1KpiL5W4G1COTRgLH38yjbpjX13i6B09mU6yF vinu0BCfcVy6Lw6PFb/yw4TgVZ6KGA4TV+AWaJPS2MQ5TWO2eZ0Oc9Vzg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="367515880" X-IronPort-AV: E=Sophos;i="6.01,253,1684825200"; d="scan'208";a="367515880" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 20:17:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="723474212" X-IronPort-AV: E=Sophos;i="6.01,253,1684825200"; d="scan'208";a="723474212" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.210.88]) ([10.254.210.88]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 20:16:58 -0700 Message-ID: Date: Fri, 4 Aug 2023 11:16:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: baolu.lu@linux.intel.com, "Liu, Yi L" , Jacob Pan , "iommu@lists.linux.dev" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 06/12] iommu: Make dev->fault_param static Content-Language: en-US To: "Tian, Kevin" , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Jean-Philippe Brucker , Nicolin Chen References: <20230727054837.147050-1-baolu.lu@linux.intel.com> <20230727054837.147050-7-baolu.lu@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=-2.1 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,T_SCC_BODY_TEXT_LINE, 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 2023/8/3 16:08, Tian, Kevin wrote: >> From: Lu Baolu >> Sent: Thursday, July 27, 2023 1:49 PM >> >> @@ -4630,7 +4621,6 @@ static int intel_iommu_disable_iopf(struct device >> *dev) >> * fault handler and removing device from iopf queue should never >> * fail. >> */ >> - WARN_ON(iommu_unregister_device_fault_handler(dev)); >> WARN_ON(iopf_queue_remove_device(iommu->iopf_queue, dev)); > > the comment should be updated too. Ack. > >> >> mutex_init(¶m->lock); >> + param->fault_param = kzalloc(sizeof(*param->fault_param), >> GFP_KERNEL); >> + if (!param->fault_param) { >> + kfree(param); >> + return -ENOMEM; >> + } >> + mutex_init(¶m->fault_param->lock); >> + INIT_LIST_HEAD(¶m->fault_param->faults); > > let's also move 'partial' from struct iopf_device_param into struct > iommu_fault_param. That logic is not specific to sva. > > meanwhile probably iopf_device_param can be renamed to > iopf_sva_param since all the remaining fields are only used by > the sva handler. > > current naming (iommu_fault_param vs. iopf_device_param) is a > bit confusing when reading related code. My understanding is that iommu_fault_param is for all kinds of iommu faults. Currently they probably include recoverable IO page faults or unrecoverable DMA faults. While, iopf_device_param is for the recoverable IO page faults. I agree that this naming is not specific and even confusing. Perhaps renaming it to something like iommu_iopf_param? Best regards, baolu