Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37745858rwd; Tue, 11 Jul 2023 19:58:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGxrCRK9Plu4IO2KjOJolpN9sFJXq999Jy2z10cXYI76L/vLMoIYTBo2Uipp9xKf0a2TLMl X-Received: by 2002:a05:6358:9307:b0:133:b16:b714 with SMTP id x7-20020a056358930700b001330b16b714mr13609931rwa.7.1689130717455; Tue, 11 Jul 2023 19:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689130717; cv=none; d=google.com; s=arc-20160816; b=Qhsg4e2fyH/ZikfTZ41vrSRb5olixaNVxWIwpZZV97V98jBTlSswKNY+IxIJ4bMjIm kFEXq26YfhadnTtLsEKm8JIrDRdB1Z88E6nMODkQBVWnglYKELXzweXwo0bYi7+qkEUy Y5UWT82R4gS38A69XoTKPddmYp1j28Y8jk0wdoJlMGHfvsDRRpC9MKcCsOsg6FVbM2Ed 0ikhAKj5/PyCdTfrYIz29tUUsR8FC+4rboiVUa/kAl0r2sSXuwmB/KBDrr1LKiYdMNCh qa1uA7ae7fsnJC0nJi5Otj9YnnENqOKQT6kwn8Xlg8gWNY6ZfvgrFdIKdoSvzDXCAfOy mWVQ== 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=us9UOfGtYFd7S5Xkk0HsxKN0KdtxapMB3gnxQKvNE3E=; fh=lUKVdYiTv5UZoEavPARWrYLGgaq0Tzj7zaAZH6YskUw=; b=fSBCwDcplYHINXSyxxXKU7XkMl4IE7z7n4dVGAa5B8DDpG4EBcyHMISKT1AVM0AjY7 Ie8gnyBaJa6gy4qmz+yj+QIh9ZInYFvi1scQAJJG7MJB4xhzzTEb1ejPZ+tCFbZr5M8r jJ3JjKjOkFR680pbE2JAUUI/RxWEa844/e0vvtMMGHPwRaho2hO07Wnm1L07d5fyuloq 7JQETaePV22TTzK1l6WIU9lcQcyz946qmZI8hUzRowS6LrNJprI9gQqgerO6vpmkSk8p sWj6jQlKVaufOIv9xXXMAZrw3wCfPxaOvRvNNvyNjyQw5pRkcrUmrIsVBJ5LQ0izhFSb iqGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xbve3BMK; 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 k24-20020a634b58000000b00542ad648fbasi2226866pgl.188.2023.07.11.19.58.25; Tue, 11 Jul 2023 19:58:37 -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=Xbve3BMK; 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 S231532AbjGLCov (ORCPT + 99 others); Tue, 11 Jul 2023 22:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231588AbjGLCot (ORCPT ); Tue, 11 Jul 2023 22:44:49 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 676BD1993; Tue, 11 Jul 2023 19:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689129881; x=1720665881; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=iWj+6wrVCX+Ik7s49Gkyi64YGWWOKVozpQXtsPYZBfA=; b=Xbve3BMKnyxpZRrsgvG1nZ+XYB2SS6CPEB+SLvZmfXnMxmT2Y7ZU2rus gYyBxcLE1QNP+6SY2TXg7h4pN1vI8xZ640YDz7dcSofD/5xzOl11qteuB 3892SOk32cBShh0tNS47txqhd+TPtF1pzphGDS08ZZpp/vE3RQwwv8dTC ElZo/ZTNt9/w3yB3HYnEDcdGxiB+tUHOnJtwIpX4+Y0k9IsK+baItN078 eBPQNT+Ht+PqFBPauZA4YEYoujfTdFsjeoi0WZ42oPYpJw7pU2hjo9lUN py0GEgJimiAjs6l9Ti/Fw0IqVsjCcd+RuXyfQvv2a2O2wDbW7DMK/DnPJ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="451149380" X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="451149380" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 19:43:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="756592673" X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="756592673" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.252.187.60]) ([10.252.187.60]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 19:43:49 -0700 Message-ID: Date: Wed, 12 Jul 2023 10:43:46 +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 5/9] iommu: Make fault_param generic Content-Language: en-US To: "Tian, Kevin" , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Jean-Philippe Brucker , Nicolin Chen References: <20230711010642.19707-1-baolu.lu@linux.intel.com> <20230711010642.19707-6-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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/7/11 14:14, Tian, Kevin wrote: >> From: Lu Baolu >> Sent: Tuesday, July 11, 2023 9:07 AM >> >> @@ -299,7 +299,15 @@ static int dev_iommu_get(struct device *dev) >> return -ENOMEM; >> >> 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); >> dev->iommu = param; >> + >> return 0; >> } > > Upon above changes is it slightly cleaner to call it dev_iommu_init() > to better pair with dev_iommu_free()? dev_iommu_init() was introduced in Jason's series. It's not landed yet. https://lore.kernel.org/linux-iommu/0-v3-328044aa278c+45e49-iommu_probe_jgg@nvidia.com/ Sure. Should refine this code after above patches are landed. Best regards, baolu