Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp440387rwe; Fri, 26 Aug 2022 07:47:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR74R98zogLLxWUm7FguzvSA2oyB24vW498z9e47zMdhJPXhBx9XMMvOkgS6Fk+0THhsymzo X-Received: by 2002:a05:6402:514f:b0:445:e158:9eb7 with SMTP id n15-20020a056402514f00b00445e1589eb7mr7062441edd.322.1661525263493; Fri, 26 Aug 2022 07:47:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661525263; cv=pass; d=google.com; s=arc-20160816; b=C3NkxoW15wVAEeyrFocnOCXJ8VPdkhVMgCZaDowKSRi3gY4or4tQU0w/Jn2rTobzqz AlFS1kyDcRjnWydHdAewHw9GuHL5G2mKFjb0fbyzjBBX9S5C1aVyJmGwAlwmAzBgM9cI dSdL3GqHWMhxyn7uvIvMy3Sn28XlZz2DDuOxvklNJIKJ9xhAECDj0/NQcpHfGO7+xWr+ 1gr5QJtmwCb1E9NIxgQwCA1uEc+JtPDyf+OT76F+3OUNoq8cNo+XEX2p9QA7aGwtPLkf ygqBvCFXHkXQ0JpLl2BcIZncArq+tvjOCpwIQLtWRPLEm1pBDjZb/NppcbAyJbABIFqf 7Gww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8obkH97+nBvB+rIPVuA+gbhpjvsA/p3prsQUJXDlEEA=; b=fmUsFGE+hWMbOx1NbEu43olxhfKAvCSuz8uSvt0jHAjd2tLd1WxFrI4eJ1Sh9txkH9 DDsaBG68HTlQlj7mpZBQKA9WJyaHX8WxDNxoyTxghN7DZsRrhrxot5pHf/IRovQT+PJV 263v+lG/vvPivYQ2IcPJB0Fiu0Ap3xi24yu3YlJngNFid8PBoAs6kmQScILoCPF1uhjb lxTNDAk68wZqy4Vo2R+XYTCVNPbWGtO3YJohJ3s3qTSmFCAXkoI9P+G2WCIR3CVmrsVh 8zydIkFABXkaidZoy5k2nXY4Ia1ndoPIYA+Hrn0yyBpycM6mTss2mdXEL35mLtslBfWw vRtA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Ov5HFPGK; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a14-20020a509e8e000000b00447bac336ebsi1388629edf.527.2022.08.26.07.47.17; Fri, 26 Aug 2022 07:47:43 -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=@Nvidia.com header.s=selector2 header.b=Ov5HFPGK; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343950AbiHZO0n (ORCPT + 99 others); Fri, 26 Aug 2022 10:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344451AbiHZO0f (ORCPT ); Fri, 26 Aug 2022 10:26:35 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2068.outbound.protection.outlook.com [40.107.96.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D26163ED59; Fri, 26 Aug 2022 07:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ze14l6JEoaTVNHW1NvMOiEDJ+6hUtpybe0K3kiIjJhxFG0YHUZjpVRCDpHRslrJWZTqmi6FVglxd7QKE+h+86GCTP15ih1kYy2ibVx5rOIcxBxILdecqx7qGs1A8ft8TN2l22mYMs+iQzCo3QcX/RWjKwOSQzG7qqSLBQCpMv/eA/HhJCGGL0N3arObFU7GnqKtsR/0B71Pi6IrMpgA49qcSjqUld3W2sYPL0ricbD2/1UPINGRGEAl+QnmsICfiI6Axood2UrGiwP+w9GBuqRslpnLSbb5OmaTgmvLg5ImzX0ki/i16Zdhfdw2F7DTqnaqPAGTpK/XCGC970muH8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8obkH97+nBvB+rIPVuA+gbhpjvsA/p3prsQUJXDlEEA=; b=btNwsjNJwFTevCrjHq3cA0YKUSlCUC1728erd15Ga6AcNcjVMMtrhv0g9VwqXvZMuP0gguxvg13rwtp0qkVjkooKY72bu+ssC/IiyE42veYpAG/Qy7qKWtcqdE5aYU0aNqFBolZ9NdSx8E7v8GgzvYVMYRHu/MP2MrbM4KKqocO28BVxlVy2fDKdMeUlqEN9/+NXprNXzQAQz4UbvWtNPL6LfyLBaSZnHDxOWVbLQqsFIL517KT96yVpBzvCD2oQy36mNtZdGRf6w8wgpfNXD9Tf0HkzPzuRLrLZhU65ig2Eu0hx3Kxm0PNJz79vVioPFzT53W/JTdh+yrfcjCxVvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8obkH97+nBvB+rIPVuA+gbhpjvsA/p3prsQUJXDlEEA=; b=Ov5HFPGK+dzK+ISIDjyTft94xTRGFXHX9q1GmMm/lXPZy+QAMQuUd3AqwH4QjndwOeS7Lo4fjR6Gb8FGwOwfz8bJglWzm29XH8ptvw0w11WYF+RXEvCHC8CVbvl71shA3Jr01LL6r8RHSBKCVGGKw5iEonWDP+z9pWzAN1HU3dEijYM1iccJ6kQ8uCTsj5gH9IWuH38C0/JlotmGbs1Dxken1uGWbMBmQE++6ZAuM/1oDR9B9i+Q7nYIa7+gKt2GSQsoTinVRXXg6BTgNI4f3GWJw4xzOF/uHWw9RLx0UUc2PwyKDtXs9Nnx0k4nedY1uzFtgxdVPxvEa5L0SHut6A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) by CY8PR12MB7363.namprd12.prod.outlook.com (2603:10b6:930:51::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Fri, 26 Aug 2022 14:26:27 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::462:7fe:f04f:d0d5]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::462:7fe:f04f:d0d5%8]) with mapi id 15.20.5566.016; Fri, 26 Aug 2022 14:26:27 +0000 Date: Fri, 26 Aug 2022 11:26:26 -0300 From: Jason Gunthorpe To: Lu Baolu Cc: Joerg Roedel , Christoph Hellwig , Bjorn Helgaas , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Dave Jiang , Fenghua Yu , Vinod Koul , Eric Auger , Liu Yi L , Jacob jun Pan , Zhangfei Gao , Zhu Tony , iommu@lists.linux.dev, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v12 04/17] PCI: Enable PASID only when ACS RR & UF enabled on upstream path Message-ID: References: <20220826121141.50743-1-baolu.lu@linux.intel.com> <20220826121141.50743-5-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220826121141.50743-5-baolu.lu@linux.intel.com> X-ClientProxiedBy: BL1PR13CA0016.namprd13.prod.outlook.com (2603:10b6:208:256::21) To MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 51dcede4-33f4-4595-71e9-08da876ef663 X-MS-TrafficTypeDiagnostic: CY8PR12MB7363:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bIB6sHlHWmWrDq+uHsvE7Y/BCmBcHhDu8elS3WK9Y92R+YMQmShgWmGrJ2OZUdZCqbICfFGvBpCFiIeOylhiLDIPG3hjYr+jNx9oFiQwH9E/SdxDcgUYUyKlkOFP7nGGp30lk6hRu1GfgoVozBbanlYjvKqJkIwOiN6f6xCatPSdpYxGuKXazY3FDzH8ZW6Gev1wnGccqitXY3jnYDu335etpP1H476TpU6WokvcsdmBCiklCt/bXjJJH0xGfQtvsOpUwtaXSchhsXOBtC8E3/Yc6mR6OtfoQrB8WjLJC1Bmh0eW6x53aKcQWC6MyPkBk4ACV95O4ZQN1KvdHjc16s2ArXYBUT0DVe5mTUiKmOuJsmJpW7UaFEINI3jKjbFaA5sjhGpRsWl2fELBrV5VRKBvqNnH/Q5xcmBSrEzESBfer0xO9Q5hi6+IlZGtJnJDFFjiG3DaUK7cOWnhc55FPs75srz302pUXgkqzIR9P0gGlhXCvcdhhvdZM8PkNPjIG9yXpmDAfEW9SnmSae4N5doCnTH+B8tlLl7FOE2S4OUEW8sxJmJaAhYa4fPITUiKz0J+o52nh7B18HtQb5EAwVrrFBFM0OduebT/S0iC4gsAc7z0PSpBGU3CplYpzNensROJHnWV7x0MGgnBCgtOW9UnmCuYinDojziU4P0jFg9C4jvW6xKN+Aa1lmqqi7NsyX/Te0vFQRBwDKDq4Yxb3A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4192.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(346002)(376002)(39860400002)(366004)(136003)(6486002)(5660300002)(478600001)(54906003)(41300700001)(6916009)(316002)(7416002)(86362001)(4326008)(66476007)(2906002)(8676002)(6512007)(26005)(6506007)(66946007)(2616005)(38100700002)(66556008)(8936002)(83380400001)(186003)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bnkSHRha/rohSZH28hmANvWRrn4FHIRUGCyT62Juds/IsvxGD1dVNa6rpz3E?= =?us-ascii?Q?tWJsX0jQgRnkNY3nkkPYge961CWqBwv48OGChrH6NnQms8ln4RYXNkDh6Qvk?= =?us-ascii?Q?2wJhrokUTar+9H5SrDphZ12dBNKC//Jt9ku4+Vz5lfHLRGfA5fWA7YvWs5RF?= =?us-ascii?Q?be0jS+jMlMfV2VN/Ere7H2Z137xHK/izWOthWLDRkn6DiHuPj2aVGbIObE9S?= =?us-ascii?Q?GLv9blJhFdy+KEeaAC0QbPJRhNU9XnxLcTd+x3F0LrXhpt8M3dFLiikSPC9X?= =?us-ascii?Q?Ca7SRd97PL0ppd/2zw1jEf0pTFxGNcQSl7SttU3z2H8kWrGd4z4rS3hAuynp?= =?us-ascii?Q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HTB8SSU3B?= =?us-ascii?Q?Kw3ZRMKeHpqWn1yyVKHONU/ZrU0OjtQYWL3n67448j/bkDQD4sXz/03jdhhn?= =?us-ascii?Q?riXd3kmfXA3h7B/MCe1qTaUiLUQHGkHsKB/T7ywsgPPryJWwuFotDAMctufC?= =?us-ascii?Q?XXutUKoqNd30vP5oEHZcvjSzeZUWOBvhpxgSQioqZGb3wYGZ5O/SetdLGPhG?= =?us-ascii?Q?p4fdFYr+pGq86f/2owo5DO7r9kvPlTyRkEVh//JDi69YOAcJFJuaH2J5a3Bo?= =?us-ascii?Q?G0XdLHgGKMW+zGNu4G4iNXgmgwTzKYSGR31sfBfBHkcWalsbV7dDbJSsFooX?= =?us-ascii?Q?sCWAH4DACJcKV6VP+Kz7CrhAQym+eiR7eG0CmiNB?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51dcede4-33f4-4595-71e9-08da876ef663 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2022 14:26:27.8412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eJ3MAcm+eg6YpWluXztZqnevmYhahFjsO0seQPdxAeM19Nir5izz9iiUXijygS/h X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7363 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Aug 26, 2022 at 08:11:28PM +0800, Lu Baolu wrote: > The Requester ID/Process Address Space ID (PASID) combination > identifies an address space distinct from the PCI bus address space, > e.g., an address space defined by an IOMMU. > > But the PCIe fabric routes Memory Requests based on the TLP address, > ignoring any PASID (PCIe r6.0, sec 2.2.10.4), so a TLP with PASID that > SHOULD go upstream to the IOMMU may instead be routed as a P2P > Request if its address falls in a bridge window. > > To ensure that all Memory Requests with PASID are routed upstream, > only enable PASID if ACS P2P Request Redirect and Upstream Forwarding > are enabled for the path leading to the device. > > Suggested-by: Jason Gunthorpe > Suggested-by: Kevin Tian > Signed-off-by: Lu Baolu > Acked-by: Bjorn Helgaas > Tested-by: Tony Zhu > --- > drivers/pci/ats.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Jason Gunthorpe Jason