Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A197C6FD19 for ; Thu, 16 Mar 2023 07:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbjCPHfM (ORCPT ); Thu, 16 Mar 2023 03:35:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230290AbjCPHer (ORCPT ); Thu, 16 Mar 2023 03:34:47 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6050595BCC; Thu, 16 Mar 2023 00:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678952052; x=1710488052; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=/RZV+NKoVH+A+UzBt07KdobJa/g/QegZ+SlgrfhPIfk=; b=Xmylb12X6N9lZIkfbDlTIQrhYP/b85O8NGOh8Wq/b1GevykvmYr4e/tV YpU6LVbyyzbVL0Ub5Sp7oMorK2u40Cjw7W43Ya8TWtv8zPcj9JsqwgsaM YMftK5totAdNLpmYgHXuRfgBUcQtRAAMkIVt4BH8AjC0Npt1DQX933H39 owAo3+fzf/N5YZvjcrE9loGSe3olVJ1bPopDPAh7Ga8uom7X9RD7MXnLz X8TTg9Vx+oCP0MaE5nn1uKvx9L6WA4jxobWSYFFWT61U7zG4i9CelIjRJ Hc16eBZeka49tnYxco6KtaDhlLDEIIbT8pqb9Vf5bRTnYoT+j2WYzVb18 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10650"; a="321755345" X-IronPort-AV: E=Sophos;i="5.98,265,1673942400"; d="scan'208";a="321755345" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2023 00:31:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10650"; a="657087475" X-IronPort-AV: E=Sophos;i="5.98,265,1673942400"; d="scan'208";a="657087475" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.249.173.173]) ([10.249.173.173]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2023 00:31:21 -0700 Message-ID: <9cd8f9b8-2362-2145-6f5d-edf47087aca3@linux.intel.com> Date: Thu, 16 Mar 2023 15:31:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Will Deacon , Robin Murphy , "Yu, Fenghua" , "Jiang, Dave" , Vinod Koul , Jacob Pan , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 2/5] iommu/vt-d: Allow SVA with device-specific IOPF To: "Tian, Kevin" , "iommu@lists.linux.dev" , "dmaengine@vger.kernel.org" References: <20230309025639.26109-1-baolu.lu@linux.intel.com> <20230309025639.26109-3-baolu.lu@linux.intel.com> Content-Language: en-US From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/16 15:09, Tian, Kevin wrote: >> From: Lu Baolu >> Sent: Thursday, March 9, 2023 10:57 AM >> >> @@ -4650,7 +4650,18 @@ static int intel_iommu_enable_sva(struct device >> *dev) >> if (!(iommu->flags & VTD_FLAG_SVM_CAPABLE)) >> return -ENODEV; >> >> - if (!info->pasid_enabled || !info->pri_enabled || !info->ats_enabled) >> + if (!info->pasid_enabled) >> + return -EINVAL; >> + > > I think you still want to check ats_enabled even for device specific IOPF. Yeah! Updated. Best regards, baolu