From patchwork Mon Feb 27 13:21:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 5892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2413327wrd; Mon, 27 Feb 2023 05:23:02 -0800 (PST) X-Google-Smtp-Source: AK7set9aYYEPXFToCqqcJm6eTRCHKKQgk7FulYd1YgQpWZ03DTtTpLjcWPxMmnazqwgzOPedDvOw X-Received: by 2002:a05:6402:1f04:b0:4af:6e95:861b with SMTP id b4-20020a0564021f0400b004af6e95861bmr6686764edb.2.1677504182762; Mon, 27 Feb 2023 05:23:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677504182; cv=pass; d=google.com; s=arc-20160816; b=a8xrRyTNA4NiDL/rdOHNqD95pyg7OMUkDOgsfPAdY9ROYsiZ0/jaezHkcTtCZf0dOg 87rW32Uel5Ii3ffYRNfT3pqW/voCymspqPKD3CuPqdk0YlhDtiHxse8AN49f2fdljEBZ mv30rE5FpPW8/D7skejDa98l+UkabFLw+5zC0OeuYD8bxgFRG2ohYTAOgF+sByVDcezM 1rUxmwhyeWk4HqyFcpfJ+ejGP+rbfjsOrE2TobdG8rbo9Y5yYvo4FoZKEq2xA35sD7uA 4sS4N4DJ6iLPTLC2llK/1HjRK76/6JiNOEaJu+rugEUKAg2vl3YB5O99a754DIF8Uax9 JqCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=hEHzOK+0dYpV0ltEgeBv9S5VqpSxJaAI5Jzyun9Aabw=; b=OK/kjDFVEj2Sfxx2W71ii2PUEsvlVeMnhaNc6Mn9aJC/YvH/1mMr4BMOmFaihNaQ/P GXp9g5RUODpjjBRzo27uFMN8XvE9ojhp+kAWi7Wo6HiAC0Jg8pdNBlWjAfpiHjSRa0DZ MI58rqAEeYasqxgXGQdzo4cqZtMwuT0u2qwqhKkhq7GdaTfmBTQ0CWBq+5mbZORaG+ef 3dk2P8FhprfaNFpPaNQLLZicL92LtoBkETBAB79RkkqrGJ8V92spZwl/pwlY6iw8tiLP By0UTfPDgRjxVgmUTfWtkEgZxN34MAYRWKpVvViXJ8jpP3be3Nnc+lOyh11Z7aP3KBz3 kmBQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=IqhQjMKs; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020aa7dcc5000000b004af60cc2a8csi8138766edu.486.2023.02.27.05.22.40; Mon, 27 Feb 2023 05:23:02 -0800 (PST) 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=@os.amperecomputing.com header.s=selector2 header.b=IqhQjMKs; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230042AbjB0NW3 (ORCPT + 99 others); Mon, 27 Feb 2023 08:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjB0NWZ (ORCPT ); Mon, 27 Feb 2023 08:22:25 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2094.outbound.protection.outlook.com [40.107.93.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE40E2054B; Mon, 27 Feb 2023 05:22:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cf0Fwhi57cWm+d6ApZeqqqX1Jn1y56PziNjQ658Nf/2GyXulTrhFLbssTlbiUlSzKAmp6Y/lLbE6E0n2Xo/gRwij56uSk3lIIFrWKuY6LoPrnBKhaq/3gfZ5AnWOoGDHVn/1t/AfedaR/isly+eng0UltN4Ogq4A2UnCME9kFgJndFxrOb+Fyle09uXqNIbaq7rl9/8vJ/iD1ZqbXoES+TZfHw/67IND2NQZ6He2E0XBSi0dsNY7phcd7KUdA2eiy78b6jNpXGA1Sd7w/xDec2gp6JHweFkqG5VJXHYpINOpaaY3wXxL2ssqfWqwv8nFzm9AG6TQ9XqAuDExDBhEag== 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=hEHzOK+0dYpV0ltEgeBv9S5VqpSxJaAI5Jzyun9Aabw=; b=nsyXl5ziNVsF+Ub4A9QlMQCbCq9BvZhEydBfwFwPwX1EAsINnmclCLTGuoEqCHZ532cot/u5YsU5oun9ofjC64raVNbn7rym2r5cRShV1aL/Vb0+NIWxIQ0T0rvpl7xLhXuQqNh1HmQyMdPFzSEFR9jFRcPipgoxHAmwKIjjtvZKdRK7uOzuDgLUWuC55FUsnCYUBoUO56qqLxaksU92WsgWY+JnACHIpECy3BMDOrwlGkDpZ0vXrqjTNfmMT2IwUVjRR45W7jRg9EAfbrI0Np0cDxi1lYtjh2PuINurhjedwwTWaA7gldZEueVYxnDofjaFotpsiikoeK0hQsuIbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hEHzOK+0dYpV0ltEgeBv9S5VqpSxJaAI5Jzyun9Aabw=; b=IqhQjMKsBFePAwitmyshNDtya9E5pkMx9HZoYGEmYViFXnZOUiKf93o/K45bD3FAxjRtTLF4VjmhDW70Fv6jpdVGvq1c+3CiyZ2e/OfCbdIxO1pyq9LXkOpBk8Th+qa25Xd+4nzwKCPnIIiRYcq4FP7pt1Fh7b6p3WCmrDj/Uuo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM8PR01MB6824.prod.exchangelabs.com (2603:10b6:8:23::24) by MWHPR01MB2719.prod.exchangelabs.com (2603:10b6:300:f8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 13:22:09 +0000 Received: from DM8PR01MB6824.prod.exchangelabs.com ([fe80::fc8b:5e5e:a850:7f0a]) by DM8PR01MB6824.prod.exchangelabs.com ([fe80::fc8b:5e5e:a850:7f0a%6]) with mapi id 15.20.6134.029; Mon, 27 Feb 2023 13:22:09 +0000 From: Ganapatrao Kulkarni To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, joro@8bytes.org, bhelgaas@google.com, robin.murphy@arm.com, will@kernel.org Cc: jean-philippe@linaro.org, darren@os.amperecomputing.com, scott@os.amperecomputing.com, gankulkarni@os.amperecomputing.com Subject: [PATCH 0/2] Add support to enable ATS on VFs independently. Date: Mon, 27 Feb 2023 05:21:49 -0800 Message-Id: <20230227132151.1907480-1-gankulkarni@os.amperecomputing.com> X-Mailer: git-send-email 2.38.1 X-ClientProxiedBy: CH2PR05CA0013.namprd05.prod.outlook.com (2603:10b6:610::26) To DM8PR01MB6824.prod.exchangelabs.com (2603:10b6:8:23::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM8PR01MB6824:EE_|MWHPR01MB2719:EE_ X-MS-Office365-Filtering-Correlation-Id: b1be4bbd-a2d4-4748-b392-08db18c5a0d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: er4aGU0PqCGl6XUX4dp6vcKwDqDVsIJQ8pw3Vr4lNB+7N4f4YXjCEFeon7mOW+65IeSNDT0JLFGrVrcdt7Fy8v+rhVZ8xN/w6+sBT54zWI5EjPnNQfEafdO7AW9EhCWhFa8LURVxriHRaYVHEQ/FD6h1UfQ+CC97Bt8vKjOxw5IB8rbRz63kKVXUZ7Qel6YGOacAgJTK/KyA7bWp0VpCr37ugnRMtlMeI0+W2wMGhW2bzfcYE70nRO737ypkkT9n9Uv0PuvCP+hrjtoi4c0jhO36blK0JXzFCIjoAYvbJuJbxCvPuHHFQKTH0zEzl2LsgEoipg+uRJsLJhLEtN0mUERs+rVUelHdKjfZ0ZgbOsmVX9+lyR21rIUaMGeNCyoQcgI8xaa0ZHGldRBFHa74COfPzxC9wtaih8J7PALRamNaw0+tPsitKrihKvmGOxoHObsm9ISP67cZ4QYOMcnVev9hSL4I5iqfTWisdEQ+6TxFMPoIPuanEjjfWZEnDb4ddHt3URfFyQUBPnILVnEzpHclAQsZd4xizhLS+J9pPeiRCO4Hsub+ErNBx7ZcftlXdMaG2PHKcvqZtiIy9WBJ4+EywvrSg9Zq/pq3RcTeGwmvBdJe2TMuD44ZbdRjztiMtsfg5tk83Nylk5KdtZKncVaNt3CMsoyF2r62QhkXNAJM/WkHSoRwnT9/ErkSpzjm X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM8PR01MB6824.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39850400004)(376002)(366004)(346002)(136003)(396003)(451199018)(8936002)(2906002)(5660300002)(4744005)(41300700001)(66946007)(66556008)(66476007)(4326008)(8676002)(316002)(966005)(478600001)(6486002)(52116002)(6666004)(107886003)(26005)(6512007)(186003)(1076003)(6506007)(2616005)(86362001)(83380400001)(38350700002)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lj7RxcjC/qptuwKdOJXcQXYoYhd4W1pCi19OVgb9/2zCn6/M8G9Cxsr0wTyDtbSCITME12lm5g1MBpkKNcNoK81FCpYDlYBoCpl4KbIbwqfkbH7AzrOYq/hgDzeb542nLw1mvGLDctxZNXaGHpKilreAr3cxCBNPNQqyYra5oayCkDxgXw96KSPlYdqijqEVLRifsY0/DaOtWzxU2BGkm6pJv7wN7oASTShnq59YrWhWnNTHLPrKuRvO5W4IA0Xl1OZDFDcflQBjfkJMPyzI0s3Obx5cMIvNd68dA4D9Z5EpMApSSq9+ducWYnWQW4kr22F1aLPvfyFHbUSuk1KUZ2Rx2T9Mpo//lu2h5e2gl9TFkwv6YYzRTi/OhQZF0Qi+42PlXZwyAncAhn2DFPTjakjcy53CSaR39CsE6eTj3qp/uXI7YKtq3RFfl8FV2vb8M8UQiNRI0eZrFQP8ilRm3OPRqQDizZxEPzUUTQg9mplDdQPgSvDTO4VhzgjD/Zs08QcX6sPJ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dRyuNoJpvF+Rg/j69DuZcAzBOie8DOdz+p1xD2YHPSdw= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1be4bbd-a2d4-4748-b392-08db18c5a0d6 X-MS-Exchange-CrossTenant-AuthSource: DM8PR01MB6824.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 13:22:09.0525 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q6cXfBwqFawXe29bX34iQptQL1H2BGlhFWB3es7UcFonVq+tuuuXLcxMqu5HX2WtaMZX3TYy8O4NorBIMHpBJlLQGVq8bs+NszNubnZmO5s26wVJrOzVgHyW05/GXE1U X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR01MB2719 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758990625788696359?= X-GMAIL-MSGID: =?utf-8?q?1758990625788696359?= As discussed in [1], adding a helper function to configure the STU of an ATS capability. Function pci_ats_stu_configure() can be called to program the STU while enumerating the PF, to support scenarios like PF is not enabled with ATS, whereas VFs can enable it. In SMMU-V3 driver, calling pci_ats_stu_configure() to confgiure the STU while enumerating a PF in passthrough mode. [1] https://lore.kernel.org/linux-arm-kernel/20230221154624.GA3701506@bhelgaas/T/ Ganapatrao Kulkarni (2): PCI/ATS: Add a helper function to configure ATS STU of a PF. iommu/arm-smmu-v3: Configure STU of a PF if ATS is not enabled. drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 25 +++++++++++++++- drivers/pci/ats.c | 32 +++++++++++++++++++-- include/linux/pci-ats.h | 1 + 3 files changed, 55 insertions(+), 3 deletions(-)