From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D15DC00528 for ; Fri, 4 Aug 2023 23:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jJ2pp807RC7sGSts7EI9ux2jEJ+gWqOyKAgKJfXL3C0=; b=hZYfsWohg80rL8 T4rPA9Cdx11C7hZui3O7DY+KeVUKjnX++2nkJ/bft9bBVqKf0Q490O1pGFx/C35k+f8ZIph38VF9m 5DcvDWEz057MUoAPqaNS73QJqsUHanFUY4fBikSlY92DxPQtTVGE5jhm3gxyuV5QBdQ3H1X5wMRK9 dkFuzbOAUonyBYWOFXNy8u6dZHyzl+Vr/NfKBFTrD2jlKNAVHw5ck1XIicpQw3jyFxeZobBKXXgw6 L6Yn5/6jxt7pf/bexgj3Q5Y/RyVaFbNVXlpGZN8fJTVrIoVyCWlN+eiN4ldt8/Bppu51+XvKiXTFM XLKKj9RXYfcnlLY8wxlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qS3xn-00DPpH-0J; Fri, 04 Aug 2023 23:12:07 +0000 Received: from mail-mw2nam10on20600.outbound.protection.outlook.com ([2a01:111:f400:7e89::600] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qS3xk-00DPnt-1l for linux-arm-kernel@lists.infradead.org; Fri, 04 Aug 2023 23:12:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TmFVncfVysgpjsm48iV3XVh6yDcCt+83D7ljmp6rvqbM8abFjVWq6TxofT/uVyoYiFn4IO1DtiefcNBwJHBxG2CRdhWe3ibRH8beVDxsvRRHS8EeaJ37QDw1/oL7J+sKDhvqlsmt3/V61n+U8eorxfi3JeHLvF2sglGzbfKiP2GIj3kLpE6LzM4HU3eDklu0uGg3l6ZrAvTyZRMaQMeBiwDgp6DQYfwo0zoFq428ExlrXhhxgMy10U+hyPZjJghyzX34mq6pVcFXIoLQVVywEpF1qXgMKrObpEyyHnVscpSZjnuvZb55RO4uypVr2YfZCRlK9VtQ0NZ0i+YdMKrvaA== 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=TQMTE2OQGXvgQt2IrJl/m4D/QexcvGY0BIWWg4YUNTk=; b=Z4qWHJ5AT/8Ck416h1zIKmrArInzV5w2UZwvphnGQusMIy6Qy94cB8UfHUm1H8gQIk570cmaML9599T+KCCEDl8Ovqu+F+XvcDhEqrIGuscnsTWtVIwlMfokkLZ7+mfoZiViSE8l6RT3wcbCUSCTogeJ5GM6AdTQKzRFZeijGTXLcIQx2Ipfl5ZTXAc8pvp6uIzLukaObMT1WFnmL692aU6QimRVm5YFCOXac1oOLkgC9mKrBbtT3dj8uMThx5WzWIMmk0KXUYdXSIymAjMLBNQGr77TAHonPQlEIycdY2cOL8br5b4/LomcygAF98PNwlE759zdn7wntqESVDzb2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=TQMTE2OQGXvgQt2IrJl/m4D/QexcvGY0BIWWg4YUNTk=; b=clDc8M98Z4R+8UfZwMUMmBkhp10OqeLbuXI8wVyWTTuR3oQGCMME9kH022wg2FnJQVWSGN96squjlnGVOul9WKKIPYCsD+XKJoT85WK730Srqgz8/N04/n3wQsi0O6JAkVZrcCE0ys2hycbFTzenswi/+Dr6cZUYjI/1LMG1RolDZt8RKD9OQKdIVvKeJ2Y/1crd3Ba1Ck6n5N6P+ICdlYdwE3S8xBWtIxdlfSM6g1BUYZX541c7tZY9F6DSi6Bh1dkbnnyhTGpRMPur0k7TirEB27jK0lqo97Q6IHTJyfQD8/5Xu8FOgHOf1vtSp7JRoKYg1XpzUu6n/HrO0W2+tA== Received: from CY5PR15CA0146.namprd15.prod.outlook.com (2603:10b6:930:67::15) by SJ1PR12MB6123.namprd12.prod.outlook.com (2603:10b6:a03:45a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Fri, 4 Aug 2023 23:11:51 +0000 Received: from CY4PEPF0000EE39.namprd03.prod.outlook.com (2603:10b6:930:67:cafe::f2) by CY5PR15CA0146.outlook.office365.com (2603:10b6:930:67::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21 via Frontend Transport; Fri, 4 Aug 2023 23:11:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000EE39.mail.protection.outlook.com (10.167.242.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.19 via Frontend Transport; Fri, 4 Aug 2023 23:11:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Fri, 4 Aug 2023 16:11:44 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Fri, 4 Aug 2023 16:11:43 -0700 Received: from Asurada-Nvidia (10.127.8.12) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Fri, 4 Aug 2023 16:11:43 -0700 Date: Fri, 4 Aug 2023 16:11:41 -0700 From: Nicolin Chen To: Jason Gunthorpe CC: Michael Shavit , , , , , , Subject: Re: [PATCH v4 6/8] iommu/arm-smmu-v3: Move CD table to arm_smmu_master Message-ID: References: <20230802163328.2623773-1-mshavit@google.com> <20230803003234.v4.6.Ice063dcf87d1b777a72e008d9e3406d2bcf6d876@changeid> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE39:EE_|SJ1PR12MB6123:EE_ X-MS-Office365-Filtering-Correlation-Id: c7c4a1ce-e21c-46eb-8bbe-08db95402fe1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6mao/unLETLQYFqxsgev3b3D7xayg4OpvRExLPgYOKwbFQxuCrxm6kxtHSG0HlQY4rsJ2gC7zPq25Sp9V4ShUGpygf20hZgC1D0vSlq+6Btc1RyRHKR9UcH3wjh1JznuNh877ZjU/+2A5azDZ4dvjEutyru69cVWoIdSLcx5OvYEH3XN+1/MnH8+oURATAhxvspKLpWwPeneFXuiUk/eByeGBibOxpJx3X1CpJUdfGmzU5jBZ5BWBFjEDvqiZB88OF8juTGVnDlnflen6uzE26FYyeSYR/00IWT5bJU0dh1gi4bgGwJYlnuK/e+e07rtoYcFa7et7kAKsl00fKFrB7EVy8HeN6YndSXR/tBmXXU1ahpdsyNRZPM81pJc6AKRAPtOEbk97qODTebN8WLPRbKaNeI32AI79en14FOZK08IZg03YfH0DdsH4qyZl1tokCJB1hoyWMYNIycEYzVDNotBVAgZzoeyxDcdKFxlZiRUH7yk9zfWbEVVqx9TCX7HuxOuSQB79mH90Lymj8Sz3WX1RN3T1KELC1BfRKfGRdgIm7ImWynGeeHVI35gq705lKEYrfYI4kmp2Ttb+YGrtfZ1khFibV2TdDdgsQJ9/uFMX5OphSKuJJYkSmvnz9T0HqbDZ4jvJYVSf9+b3FSWqqzbln3XtOnxLXSBdu0XwtkEzji3WxG88uDHPR3J0ze/YBJp8zre8iOi3t7UKadQhZ1BarVEqI5d4uJzd35pRJI= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(376002)(136003)(396003)(1800799003)(451199021)(186006)(82310400008)(40470700004)(36840700001)(46966006)(83380400001)(40460700003)(26005)(8676002)(47076005)(4326008)(426003)(2906002)(36860700001)(316002)(70586007)(6636002)(5660300002)(70206006)(7636003)(40480700001)(6862004)(8936002)(41300700001)(9686003)(478600001)(55016003)(54906003)(356005)(86362001)(33716001)(336012)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 23:11:51.5407 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7c4a1ce-e21c-46eb-8bbe-08db95402fe1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE39.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6123 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230804_161204_586430_02BE65BF X-CRM114-Status: GOOD ( 23.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 04, 2023 at 07:46:23PM -0300, Jason Gunthorpe wrote: > On Fri, Aug 04, 2023 at 03:25:43PM -0700, Nicolin Chen wrote: > > > @@ -2436,22 +2419,14 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) > > > if (!smmu_domain->smmu) { > > > smmu_domain->smmu = smmu; > > > ret = arm_smmu_domain_finalise(domain, master); > > > - if (ret) { > > > + if (ret) > > > smmu_domain->smmu = NULL; > > > - goto out_unlock; > > > - } > > > - } else if (smmu_domain->smmu != smmu) { > > > + } else if (smmu_domain->smmu != smmu) > > > ret = -EINVAL; > > > - goto out_unlock; > > > - } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1 && > > > - master->ssid_bits != smmu_domain->cd_table.max_cds_bits) { > > > - ret = -EINVAL; > > > - goto out_unlock; > > > - } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1 && > > > - smmu_domain->cd_table.stall_enabled != master->stall_enabled) { > > > - ret = -EINVAL; > > > - goto out_unlock; > > > - } > > > > ... then we remove this stall_enabled sanity also. > > > > This means a shared domain (holding a shared CD) being inserted > > to two CD tables from two masters would have two different CDTE > > configurations at the stall bit. > > I looked through the spec for a while and I thought this was fine.. > > Stall is basically a master specific behavior on how to operate page > faulting. It makes sense that it follows the master and the IOPTEs in > the domain can be used with both the faulting and non-faulting page > faulting path. > > I would expect the page faulting path to figure out what to (if there > is anything special to do) do based on the master that triggered the > fault, not based on the domain that received it. Yea, I went through the spec too yet didn't find anything that could block us. And there is no SW dependency on the STALL bit of the CDTE: actually it has an inverse relationship with the S1STALLD bit in the STE, so following the STE/cd_table/master makes sense. So long as a master has its own cd_table holding its own CDTE for a shared domain, HW CD caching should be fine as well. With that being said, I think mentioning this behavior change in the commit log wouldn't hurt. Someday people might want to check this out in case something breaks. Thanks Nic _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel