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 2CB77C4829E for ; Thu, 15 Feb 2024 21:19:05 +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:MIME-Version:In-Reply-To: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=BmoyfVFliqAY8+Pf25fzW1gMjWN4Qp7Oh1uYQGQHWFA=; b=RFSosoZYN1ws98 Gv0tUPaTDxwkZbmTtqjg15/CJWCc1acmYw0OexQX6LxcOQFe4YXeYOhTwPyUvrR7nKLgfPLcWlH9v OLfUWeu5lfBFqflPx/B+0inN2kWelEC8ioxmO8CFLb+rW1lt8PBDuiAiDZ56nFq/Uik1O3QYhLK2b uqm9RYv5LFMQ5ylWYWx4yuP4bBTuJMI2DfY5WsWOyQG1MhCj1K8pohcI1U6NcBLPAI0HMD/ypk356 Bv0INrjIH9KRBg4mmFdectcc1g2RlHuPprEX/fVSUT7ijtW5Hb9nAb5b/KSOVCqBWpCkOLUzBWYc4 wnJWbNuuSdgEK2wUgpnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raj8B-00000000Asb-2IIk; Thu, 15 Feb 2024 21:18:55 +0000 Received: from mail-bn8nam12on20600.outbound.protection.outlook.com ([2a01:111:f403:2418::600] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raj88-00000000AqI-1FZd for linux-arm-kernel@lists.infradead.org; Thu, 15 Feb 2024 21:18:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aSkP88hheYeUsjf7xhHnfmU7qMqAeYoS/wJ6WLLMXJE1196bmW4zZjcnb9O7HLsHjrz7nCyo9aG83UKgcJDmWWQL7GqbpL2WX9hUq2TCPQGO98VwHzBck8X7bp9TVTiL3/a3m89hAsCH9MyeSxVzybI/ZMoOk6j879Ztt7nNlAtezhFuEWBt6SIe5/lQVDq3A9ig0gAWrNLIRTRNSgq1CZeOfuHj2eUfLdOOZpdoxoR0aUk1noXYH4OU/cRZlZSS4VphIGHn5R8PiQwUQ3MFeR5lfcMDE9uBP8lRgyZKKHs+NX+gKcgIom/lhG3BsOHYKIbsrHErfxcPvG+hsVI6PQ== 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=mm7H180+JqQyDHj6D6BAlIrjJk0fR6p+nRP1A4WlGaA=; b=KbysD064s7zr0/UHXzQKzpUGWI/OAPlfUfhDVT685u/zxBTf5UdKzYecsCIah4zCOGKgjlgpcnKDTeIz1HWwuAw+f25ZeWVrxtvMe4HKcuIU2u0vRYtge8eKECHy2gPNFvgXiDgkNjojAhbayyAjPSMOexOG4PNMaKrRXdsR/YYWq5LAkW4PCkveEQUUbHanW0kN/CtpodCUlW9VIQt4U//3vZXylDe755Rf4KaGMh4EWj6/mYXvNZC775TXUajcLloQVAzrw7KVAIrNxdySlCjxHZU3sWYxtmjvDetEephyZfeRQtBkRQbKAlqc7qYImaVisCohQj0WjxVqdSxQmQ== 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=mm7H180+JqQyDHj6D6BAlIrjJk0fR6p+nRP1A4WlGaA=; b=IsALGH4O8eqsWkN7+aHTQDMbW3jJrkYIIkvy9Q0CaSowAY9fkSTGEGWAiyi7K0IC3wletImU0TEaCUIfZ0y9YXtPpdxFRJxa17e8q1HvzlcSkwGyw9zUVdXvchwzZFXjIQG9G9Ygz2GCToMTdTMP/ZWhtGdYwEsDLIzuBrUTNuhmqji9GgA03LvOEqMe1pN3/Yive1Kz5/ADLeQajmkBFJcMbDc1jKg5v6J4PmvPiIGDkQNVQzMwwl9Vm0qP+ZwCxt4eqVtRQtCkh4uA2o3glZLNaPtBGz9X5Bu6st1Z+SrwXiWCvRti+uLhb5+SNNZk6zUDt7USB6Flu6Yc4vtMrQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by MW4PR12MB7466.namprd12.prod.outlook.com (2603:10b6:303:212::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.12; Thu, 15 Feb 2024 21:18:40 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::96dd:1160:6472:9873]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::96dd:1160:6472:9873%6]) with mapi id 15.20.7316.012; Thu, 15 Feb 2024 21:18:40 +0000 Date: Thu, 15 Feb 2024 17:18:39 -0400 From: Jason Gunthorpe To: Robin Murphy Cc: Mostafa Saleh , iommu@lists.linux.dev, Joerg Roedel , linux-arm-kernel@lists.infradead.org, Will Deacon , Lu Baolu , Jean-Philippe Brucker , Joerg Roedel , Moritz Fischer , Moritz Fischer , Michael Shavit , Nicolin Chen , patches@lists.linux.dev, Shameer Kolothum , Zhangfei Gao Subject: Re: [PATCH v5 03/17] iommu/arm-smmu-v3: Move arm_smmu_rmr_install_bypass_ste() Message-ID: <20240215211839.GO1088888@nvidia.com> References: <0-v5-cd1be8dd9c71+3fa-smmuv3_newapi_p1_jgg@nvidia.com> <3-v5-cd1be8dd9c71+3fa-smmuv3_newapi_p1_jgg@nvidia.com> Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR03CA0011.namprd03.prod.outlook.com (2603:10b6:208:23a::16) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|MW4PR12MB7466:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ddc1b26-4a03-46ba-7151-08dc2e6bae43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XgeV+4BbHun7OrSjhl9DW9xHwoCebICX1tVdnsj0cQ1gaETyZA5OaJsdVIDcggLG8/11d0r3grphlBEj90X5XmHMn1wMC4qoQ98uv/NjEdm3wVf79kzw8z9D3RtxEXoFO4w6XzMYnQoCxP0cjY5NIC6SWcsWYCaDWTvrSZ+sonZH/n4nd8S25e6+4K2nwAuiPmQC5uAQXr4Nh7zivN2d8K5zurpv4w6bgxCXa+jYvYyYP+Xwynu+l38PQIg2Kzc2nzK66G/+kS4XHT3CHuKd+GL0q46jJLKMMU4MURH/RZNHbxpsZ2vUv2dVxj9IvCx9KIyI7HUJ9P+FN47RoJCnFSrEn8FLLvqONqeotu2gS2D+IgU6e7+2zoHfJ4pHNQS8gEdaBO7HrkWBmTbPvN2yGIeeIktHodWdsrQCx0l2FGiEG5md5jZVqdRbMeTgAu46SBpg7eHpWiAVwd2+WgcZqaKysKmrA6GpSO5V4x911NANaagfQ12+/POoLtFpUey9qMtQgS6rCMMrfYXyD2ElEDZ8f97gNn6BgFFDMyLH0Lgol/iRf+8bXQzPpJn19U5k X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(366004)(376002)(39860400002)(396003)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(7416002)(2906002)(5660300002)(316002)(6916009)(41300700001)(86362001)(4326008)(38100700002)(66556008)(478600001)(8676002)(66946007)(8936002)(53546011)(54906003)(6486002)(6512007)(6506007)(66476007)(1076003)(83380400001)(26005)(2616005)(36756003)(33656002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?XSw0UeR/jUGs0YZx3l0PBjC/DIdXHvLOq5HS0q842vV3lqWXBdttmsdobREH?= =?us-ascii?Q?J/tqF9lZpVLrY7v7/824N29rrHebD2hWf46FFP3ofcpq8gSzys+APiiCdnYF?= =?us-ascii?Q?VBKqr9KqqOoO+4LlO2udHFjYyl+ED4UbWATetKr7FkJ/aaNSGJkxiPsrYvwk?= =?us-ascii?Q?O6xcodEZD6To4J8sEsXlEJKNuMuooUNCB7yXhAm+w+PeZxi2n9NQquyHsoPy?= =?us-ascii?Q?u0AUI6Ri1Iqu++0C1Dgen7WQtQZWSxB0Ota4q6fptLSRp4bGSOzbzwZtitTN?= =?us-ascii?Q?MiVheRGNJe3EFd501kvrcg98yriMyIy7UqU0z7IxVFBWzANk7BtYRB1e+aqG?= =?us-ascii?Q?MaW1B6wDsOMFFg3Nm9lPqgNjAqc97/r56UC0+50YCpdYETv/qV2v/gDlDKxc?= =?us-ascii?Q?3K9Gb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?= =?us-ascii?Q?TIIruhLYPJmXMDHN5MDAzzuuU0bPgnjU+yfXN7/WOgC+Mm68ABZ9mGZJMGxM?= =?us-ascii?Q?dXYjiqsr+IlJgetwoGwgL4uy0uozVa9bQgRiwMe4hxui9apANIt0x85+aMi5?= =?us-ascii?Q?GP7qeK6wLOBDzZNPr+hiAEPzAyebwktoZfJYHMMFYSyXdcwQDead6HqrQvVl?= =?us-ascii?Q?axc0EGS6v1dD88ST/K6eKRiYmUfec/UUY53b9Rpm/NB+PSBSHhmXLy0P9Kod?= =?us-ascii?Q?coOFz/Xgs43uK0Xr6n4Rm3QJ9swBLofMZMbdOyc2?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ddc1b26-4a03-46ba-7151-08dc2e6bae43 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:18:40.1263 (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: rXiz+/XNf1jw1UDNBEvj9qyhKlhz8xNWC2ymit3II7YylAHSsyhOjrG2FEBQDQTj X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7466 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240215_131852_432470_9CE4B68E X-CRM114-Status: GOOD ( 18.21 ) 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 Thu, Feb 15, 2024 at 07:01:59PM +0000, Robin Murphy wrote: > On 13/02/2024 3:37 pm, Mostafa Saleh wrote: > > Hi Jason, > > > > On Tue, Feb 06, 2024 at 11:12:40AM -0400, Jason Gunthorpe wrote: > > > Logically arm_smmu_init_strtab() is the function that allocates and > > > populates the stream table with the initial value of the STEs. After this > > > function returns the stream table should be fully ready. > > > > > > arm_smmu_rmr_install_bypass_ste() adjusts the initial stream table to force > > > any SIDs that the FW says have IOMMU_RESV_DIRECT to use bypass. This > > > ensures there is no disruption to the identity mapping during boot. > > > > > > Put arm_smmu_rmr_install_bypass_ste() into arm_smmu_init_strtab(), it > > > already executes immediately after arm_smmu_init_strtab(). > > > > > > No functional change intended. > > > > I think arm_smmu_init_strtab is quite low level to abstract FW configuration in it. > > For example in KVM[1] we'd re-use a big part of this driver and rely on similar > > low-level functions. But no strong opinion. > > Right, the fact that RMR handling is currently based on bypass STEs is an > implementation detail; if we ever get round to doing the strict version with > full-on temporary pagetables, that would obviously not belong in > init_strtab, thus I would prefer to leave the "handle RMRs" step in its > appropriate place in the higher-level flow regardless of how it happens to > be named and implemented today. I will drop this patch Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel