Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1949845imi; Sun, 24 Jul 2022 01:56:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAONa8o2pvEEO9iTOVpF747eepd3vX3pF0LPrOywQ113ZgfBMvkaXLy7BOuS4vCQVz/eow X-Received: by 2002:a05:6a00:230a:b0:52a:d0e8:c936 with SMTP id h10-20020a056a00230a00b0052ad0e8c936mr7899656pfh.67.1658652989365; Sun, 24 Jul 2022 01:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658652989; cv=none; d=google.com; s=arc-20160816; b=r9qppxSzEM/a8bbkxOxQCdwmE7dZmodtQA+3ZiQoMmQwRJLhUfr9mFndjDIy9nwbaD cuA/ZNpPSXFVzn6fk1iPafUe1MiCCI2YwcttoPMsiP6DqwTPc6UEkfY5+BfhAfpDLxAs 3ESNfLvAPby+N+IUhrMtfSlLYHrkBNhFDb01Dq383X+5jNPIiLjn4nSdxhCxSxDBcbIs r/tOQnECLTbbALs0Db4K2Bvb6vmyR8KrOCHWuQytbBhydvTc21glUmjn1HgSPBs+vJUy 3j1/9e5eTEGmvHaJeZayqhegc2iAnoswLNLI8UjPyKv6CnSj2rmeLOMDrHGjNoYliVed oNbQ== 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=Penwy9Bg6VoHdLibQIMy6cZuuQxtubRo7g3rdk6Ojz4=; b=WQPBiVedtnc00Bq9hOUfX37Rfxq43qah2THjrW/MefNcyArhRKEwH/CRPxNwrujmLK Ws/mKoQ3maoY14+VKSMcaNh0pW8VEUlJmcGefvleMwkLl2WOFy+bFLCi324ea9Lu2MTn CizHJJNLqV+Fsr053Q156kFf7JiizWU3+XPDIHEYZP1lhV/Qi/K/K8Kw/6Q1K69itdJ2 kzfXesQhnnHkocU+In18l2Kn23TLVk1SHOzcEmJSMm0BZzYpM2UdlL06x3UAx87LtP5i FzJonk26mSj+T0nN/0CkDXq1r+0fUX6vZsHfN5VZDBZXSiJRnmXC3QOTz3wuIj8/dUjs 0HEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=feEi8R8a; 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 t5-20020a63dd05000000b00415dfbed12bsi10343897pgg.514.2022.07.24.01.56.14; Sun, 24 Jul 2022 01:56:29 -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=feEi8R8a; 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 S230264AbiGXIjc (ORCPT + 99 others); Sun, 24 Jul 2022 04:39:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiGXIja (ORCPT ); Sun, 24 Jul 2022 04:39:30 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0A0514082 for ; Sun, 24 Jul 2022 01:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658651968; x=1690187968; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=ziLiSEQbzWjCi7B0eTZt1SCYgRe+J/hqHUnOduqyHUc=; b=feEi8R8a/CyYKdMJmPO8NqJU75K8CYcLCvrNFcnh/5B81F0xfWGLcWFr qPbIeYRXECyRc34iuqcJRHFjnTqFMVcVPoNIXFziyrqvreOhiY3vTMT+j I/ABpQkJHddcUl0ofArXB7bEJ8H7r6pNMNZcBoUR05NqGng8hJoAgFPoo HMaQuPMXK7M7gd3N/2CElFN2Imqb4RqMbevFuKa9P82IIaRyl9G+cEQdi o4rQfKE8F5VZMgvIlxMN5qiJCGwOxpkfNRvb4Zy8HDW8jk+UinUaczK4P kZjNKenDgMAdkxBnqxa8br5uMTnnldosCpk0cpquBnR4vCDhNN8QQJAWO Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10417"; a="288285000" X-IronPort-AV: E=Sophos;i="5.93,190,1654585200"; d="scan'208";a="288285000" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2022 01:39:28 -0700 X-IronPort-AV: E=Sophos;i="5.93,190,1654585200"; d="scan'208";a="657758458" Received: from zjiang1-mobl.ccr.corp.intel.com (HELO [10.249.170.155]) ([10.249.170.155]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2022 01:39:23 -0700 Message-ID: Date: Sun, 24 Jul 2022 16:39:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Dave Jiang , Vinod Koul , Eric Auger , Liu Yi L , Jacob jun Pan , Zhangfei Gao , Zhu Tony , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Jean-Philippe Brucker Subject: Re: [PATCH v10 04/12] iommu: Add attach/detach_dev_pasid iommu interface Content-Language: en-US To: Jason Gunthorpe References: <20220705050710.2887204-1-baolu.lu@linux.intel.com> <20220705050710.2887204-5-baolu.lu@linux.intel.com> <20220723141118.GD79279@nvidia.com> From: Baolu Lu In-Reply-To: <20220723141118.GD79279@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 2022/7/23 22:11, Jason Gunthorpe wrote: >> + xa_erase(&group->pasid_array, pasid); > It is worth checking that the value returned from xa_erase is domain > and WARN_ON if not, since we are passing domain in.. Yes, will do like this: WARN_ON(xa_erase(&group->pasid_array, pasid) != domain); Best regards, baolu