Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp282269rwn; Wed, 14 Sep 2022 21:00:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yjU6JO1ttO4aKV2lPn8USLgaxDoOQbIsSA9Ya7pgUdsNXgRCx4SCAJYn6xX5+kkbbYC+Z X-Received: by 2002:a17:907:a04e:b0:770:79f4:f520 with SMTP id gz14-20020a170907a04e00b0077079f4f520mr27082749ejc.730.1663214400398; Wed, 14 Sep 2022 21:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663214400; cv=none; d=google.com; s=arc-20160816; b=Ber0m5mgiXFtBRtz7Mni0jcDzTv3l/kfXZYtEw9IvJKmiWjRRykBab2pTBwwv+ZJ5p Sut2IYVOekldFK838vg6VNGjdh9T94nULbgirFttGzMsJblztzdzQ5+8UhMX3+IGgCQw hgev2qnhGWlsHNcQBo2vo0ltjJVEPU/8ywgVko9Bfarm3DiC2qKR+CH5F+AmnZ/Mjl52 PdZ6drz8RxfSFYLOXHADVNVQVM80sYsC6fn3bBw/9juICbpISjryhhEuxqDXQWsq2XS2 /lNmFnHRC5T6cZ3VIGJBPMLDKjQZZyHhzlPym7rNBhhF3QnSXvuv9fzlBqN4pscBsu/v Ha+Q== 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=CyNEg5wiPGQ/nz/bhEmTWLDt/zIYBDwi5MHIE0+EiNg=; b=UL8sM2YQqQQzV4+QexzXeur93wKlBnOPZ1Upwzdp/7aDMnpFJsiCbN7puvjHvDqPA5 j1Mul6kkItqLglx8EyRXArgBOApVUW1lG+PsBiRCbTz3AACwbibSbx5vuidpPCOY2JX6 u1aH99wPJ8RZNEglsqTibQLH96TmPe5IO7J7bX0xR6bcWaqeOZtafGpylCvaL01Bo84K pNntl5uM4sXfS2SPtPg0Rp18s6g7usaCH3a2rKl1OSPkDViAKiWgTtpo0W1EzrKU8S5G hmXrQ8h7lg0lKjR8QsPAU/TxIIvZY6t2uEasBHw8gOqElY0lpevh7s6pLqvDj5Rlvmd4 cZ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lVNJmtmt; 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 b5-20020a056402084500b0044ee4ec8915si16432809edz.39.2022.09.14.20.59.30; Wed, 14 Sep 2022 21:00:00 -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=lVNJmtmt; 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 S230113AbiIODGR (ORCPT + 99 others); Wed, 14 Sep 2022 23:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbiIODGM (ORCPT ); Wed, 14 Sep 2022 23:06:12 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 638738FD6A for ; Wed, 14 Sep 2022 20:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663211170; x=1694747170; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=WZZZSPl+QBxBcZfZhpMsL4YrZVmhzfuac91HSUV9DNc=; b=lVNJmtmtKwtz87aNa3UVPDFODWEekkx6wwHtEkhtA1BGTxE4yYeoz07m H4AQOSMkjHvrRBU+dt52x+yPtFt15C6xYQ4Qx5EurL9W+yKODOqMgelHg FvNymlEPEjx7IfeQZeNclTjuPdCObj0/sZUCOX+1djM5huMhDlkzows1X zeKkd74GI7AjyqiM9elILn3u5JaZOTKD1QYBET7zkCHI37y2KzNg1ynY2 WPNuUN46hinHNqk59lWgfjOPfnL5TvxCiMOdexBc6n6nH1ITPL4nCzNoU q4i9e0FVDNzTshUDxI86EJB4VYCzLFkkDTMk1aqL3VGlzkkdnDCyUhXZu w==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="297325857" X-IronPort-AV: E=Sophos;i="5.93,316,1654585200"; d="scan'208";a="297325857" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2022 20:06:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,316,1654585200"; d="scan'208";a="759453213" Received: from allen-box.sh.intel.com (HELO [10.239.159.48]) ([10.239.159.48]) by fmsmga001.fm.intel.com with ESMTP; 14 Sep 2022 20:06:08 -0700 Message-ID: <5415d383-5442-a127-bdab-fce9e9b7a3b2@linux.intel.com> Date: Thu, 15 Sep 2022 11:00:21 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Will Deacon , Robin Murphy , Kevin Tian , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] iommu/vt-d: Enable PASID during iommu device probe Content-Language: en-US To: Ethan Zhao , iommu@lists.linux.dev References: <20220912024826.1684913-1-baolu.lu@linux.intel.com> <046916aa-980c-c40d-1163-6ab839248201@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=-5.9 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 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 9/14/22 4:59 PM, Ethan Zhao wrote: >>> What the error path would be if this code runs on some old platforms >>> don't >>> >>> support PASID, would you print out "this platform doesn't suppor >>> PASID" and >>> >>> give users an interface function to query if the PASID cap of iommu >>> is enabled >>> >>> and if not why ? >> >> It's not an error case if the IOMMU doesn't support PASID. But it's an >> error case if any device drivers call PASID related IOMMU interfaces >> (for example, iommu_domain_attach/detach_dev_pasid()). The corresponding >> error code will be returned to the drivers. >> > So iommu driver withdraws the flexibility/rights from device driver > about the > > ability to enable PASID, looks much more *integrated* iommu works as > relation No. This patch doesn't withdraw anything. It's just a code refactoring. > > controller in device-iommu-domain by enabling PASID in iommu probe stage > > by default -- iommu decides to enable PASID or not though device-iommu- > > domain might not work ? or they should work because they are hard-wired > > together (device - iommu) even device is hotpluged later. > I may not get you exactly. :-) Some IOMMU features reply on PASID capabilities on both IOMMU and device. The IOMMU drivers enumerate the capabilities and enable them if they are supported. Best regards, baolu