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 31CB2C04A95 for ; Wed, 28 Sep 2022 23:56:57 +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=XAyM4XD2+OhyVO9wlbNKFc+gqCLCCMnXEoamaSTOBJo=; b=YCPGXX+uIiKHh7 5+JR8s9j+1hUr88U2m76lIpbcHHkPfHPNkfx9W7eoqxsHMkydDia9IOs+v1PcG0scbl0nC5xfeKzW QZNDueAej9ykRCN6BtrrB5eP/PGrev4CvI0FeKZPG+f2EQ/URZ3kcAKeskBrPWmLk1aWNPwGn2HLp aM7DerKsW44Au485MK4YjYpNu8PuMmVNvpGekk1zUT4GcJ4peu2kXmXvoOfZ0F1+rsy2LqHmo2f61 tE/zJ1JwgbhRJpQhJ5OSM2yeVek5lgNeTcE6WNjUhsLu8vz1gPyHu2U+xHbPmwa5iqRJrIYPipxWa LUu00Jytb2+ftKb4OgqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1odgtz-000h2j-EF; Wed, 28 Sep 2022 23:55:44 +0000 Received: from mail-dm6nam12on2086.outbound.protection.outlook.com ([40.107.243.86] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1odgtw-000h2L-8l for linux-arm-kernel@lists.infradead.org; Wed, 28 Sep 2022 23:55:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U6IayVQ53jw9h7/VzPFO78A5UbZ9gq/GYBpI2xHZqEVlLh/Jei5l1Ezppeoz2M+pDpIK4ChdioCerP0yIdwDAdJYShFUSMhgzK0jpfyvXt7NMZKVkKNiwrMn2G3CzooJiLr9NPKXvnB2Ta6fk8K3R6JRYbA68hmXLeJBEJRiEr/s1cfobFSPrlelA3FvoKUEHSx6up6noNQ50muOgsruOdJQlEgBuHbSZ0BBljjEuNsM2JF2we3oJ+smFZ+iTqqmpaU8I5YiDziJKlkRZTj+SeqCfmEZSezy8brPsk90tInGcs7xd+ixONLJ2/cMAdt1MhtE6Tb9WLEL+3Su3GYwbw== 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=oZe7SZqQvYrb35NpM7XV/1RmeRkmcdmS7e7BNdemkv8=; b=LRNJ8o3XbP6CU71P+6n0gI4aiqn3dh+e7pxPIJxFH2MQFdWXN3X0HjNPqzr8AWNX9nFV2a4+mf7ezLpBwB0o7GgF0LIcazWmTrS8a6EL2uHwJb/4p4O+M7BPptOQpOeciyl3ZGST5bo/PkyjKafS8Tthq2LFJkrcPcxM+aNRUI3AKEvpfauhX0lanlEJXRtd3rV1H/SkIeBBWEBwHmvSVGICeqvUmZQVdCEhwvo/pBsIteqyvlZwh6i9nO+hGTJEajo3VrM+pmZDlMqe7an+kverLb5ueg0h2nm+va53FxMHdJB1JT4R5l3dx9wMgto5c3/M9fyRelM+qR4u1SG78g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=arm.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=oZe7SZqQvYrb35NpM7XV/1RmeRkmcdmS7e7BNdemkv8=; b=ktppUC4pECEXkPrJ2w+iOhdgCfBK7IKwqcLyv7ZPipziiuYuL6ENaw6wnESMUfpKCyA8VrYeRN5rtSDa3vNsRSXg6uqAzGoYZ/rCj9FGNE776NoJk7oneGESaR6p/K7tRrPIwZMnX388cO1hNfB4I1RGYaxEsV5ciLNfdBSXCEVLOj7uKaQTkVFhV3kaYeba3JjqAq28PyaMFPFL6+8ehtsel+qswABjfsClB3YEnLXkavmnJYJani7xdPtBwhLBDpM/TVl+RJklZLmMUHkhVazRtxQRhY234LS3StiZNYLq0qtNsrggJdsI2poblrLdgxMvUFrT4MW1fRiXTegaqA== Received: from DM6PR02CA0151.namprd02.prod.outlook.com (2603:10b6:5:332::18) by MN2PR12MB4504.namprd12.prod.outlook.com (2603:10b6:208:24f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Wed, 28 Sep 2022 23:55:31 +0000 Received: from DM6NAM11FT080.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::a5) by DM6PR02CA0151.outlook.office365.com (2603:10b6:5:332::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Wed, 28 Sep 2022 23:55:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by DM6NAM11FT080.mail.protection.outlook.com (10.13.173.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Wed, 28 Sep 2022 23:55:30 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 28 Sep 2022 16:55:18 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 28 Sep 2022 16:55:18 -0700 Received: from Asurada-Nvidia (10.127.8.14) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29 via Frontend Transport; Wed, 28 Sep 2022 16:55:17 -0700 Date: Wed, 28 Sep 2022 16:55:16 -0700 From: Nicolin Chen To: Robin Murphy CC: , , , , , , Subject: Re: [PATCH] ACPI/IORT: Update SMMUv3 DeviceID support Message-ID: References: <4b3e2ead4f392d1a47a7528da119d57918e5d806.1664392886.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4b3e2ead4f392d1a47a7528da119d57918e5d806.1664392886.git.robin.murphy@arm.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT080:EE_|MN2PR12MB4504:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fd3483b-f465-4141-66f4-08daa1aced0b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gUj0QB3RXOpQKImy9EnGrtYoeael95Bm+1/yfQ2sDGQU5WVwEn5g358tvUt+zcNOkh2yR1wP3j9HR1lrp1G7EljsTcJF4cdh9oG7eOinC6y9Zl8Z8ENf9of6vvjqE3f1XP9jhpUSuodQDsGP0mCGFOQcYINf2FLnxh3KduIn1TcW+0Nb8v5jBXhhBomPLLtO7sMNSyY6D5IvYsBWTb8ptOMpBOgIjoJKjxmqNw8Eu17JtoKZzNEUH+nlPGAPgg6YiNMIW4/cDlRSqQiX+1sKUzxqmZzX+PwKMdSRerxoVAtvRxxM8OFTZVM+9TpwYtLEIiLSG3tyyefzgfaM6SZOhx0QuWCeyU2SBbTW18vEMg2LU51kzht1OANK/5WRFJ0V//8Cky+QK2O639Z3z1h20GRUT7upZOxAIdTPHzPt7L17dGRGFcomoWJtlNp4CZ2dD2OtyS5wziwh828aBK0zoNQesVK7AT3pKfemhu+7x3moqg4Rsvf88JFtxe3mAap/jLhdltTr8MAWRglCXQ9GnSjNwnj3ZPsl7J+qPsQsekaePIUBytI35i3cR145CB6lSy9rudJAoA4moQVCz7ft1BEKm6XIFyWdH9yKOUWr7nKlc4hO+TF9BtPoZVtyPv/bLa3D2xjjpUS1zfA49UuXkRLlvTbl+sAtBvMn1CTISx72arwva8KXPN0o1pnvomLeRPgTfK4h1i0c7AY3sC1NanGhf6ZHSh+Shox7geBiYUjX1muEnm/HSBhSHXiqjEhpptk+ABBhvkYHlBe9N0Yv7Q== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(396003)(39860400002)(136003)(451199015)(36840700001)(40470700004)(46966006)(4326008)(54906003)(8676002)(86362001)(6916009)(356005)(47076005)(36860700001)(186003)(5660300002)(82740400003)(83380400001)(426003)(7636003)(336012)(9686003)(26005)(41300700001)(55016003)(70206006)(478600001)(8936002)(316002)(2906002)(40460700003)(70586007)(33716001)(40480700001)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 23:55:30.8334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fd3483b-f465-4141-66f4-08daa1aced0b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT080.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4504 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220928_165540_358616_6B82B2EC X-CRM114-Status: GOOD ( 27.02 ) 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 Wed, Sep 28, 2022 at 08:21:26PM +0100, Robin Murphy wrote: > External email: Use caution opening links or attachments > > > IORT E.e now allows SMMUv3 nodes to describe the DeviceID for MSIs > independently of wired GSIVs, where the previous oddly-restrictive > definition meant that an SMMU without PRI support had to provide a > DeviceID even if it didn't support MSIs either. Support this, with > the usual temporary flag definition while the real one is making > its way through ACPICA. > > Signed-off-by: Robin Murphy All the indentations in this patch are using white spaces vs. tabs, so it fails at git-apply. I manually fixed them and tested the PATCH by applying a small revision hack to the IORT binaries: --------- diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 3269a888fb7a..5a4eef7b937c 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -333,8 +333,20 @@ void __iomem __ref return NULL; } - if (!acpi_permanent_mmap) - return __acpi_map_table((unsigned long)phys, size); + if (!acpi_permanent_mmap) { + virt = __acpi_map_table((unsigned long)phys, size); + if (!strncmp((char *)virt, "IORT", 4)) { + u8 *tmp = virt; + int i = 0x30; + while (i < size) { + if (tmp[i] == 0x4) /* SMMUv3 */ + tmp[i + 3] = 0x5; /* Revision */ + i += tmp[i + 1]; /* next node */ + continue; + } + } + return virt; + } mutex_lock(&acpi_ioremap_lock); /* Check if there's a suitable mapping already. */ --------- Once the indentations are fixed, Tested-by: Nicolin Chen Reviewed-by: Nicolin Chen Thanks! Nicolin > --- > drivers/acpi/arm64/iort.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index ca2aed86b540..51bc3c1d8d42 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -402,6 +402,10 @@ static struct acpi_iort_node *iort_node_get_id(struct acpi_iort_node *node, > return NULL; > } > > +#ifndef ACPI_IORT_SMMU_V3_DEVICEID_VALID > +#define ACPI_IORT_SMMU_V3_DEVICEID_VALID (1 << 4) > +#endif > + > static int iort_get_id_mapping_index(struct acpi_iort_node *node) > { > struct acpi_iort_smmu_v3 *smmu; > @@ -418,12 +422,16 @@ static int iort_get_id_mapping_index(struct acpi_iort_node *node) > > smmu = (struct acpi_iort_smmu_v3 *)node->node_data; > /* > - * ID mapping index is only ignored if all interrupts are > - * GSIV based > + * Until IORT E.e (node rev. 5), the ID mapping index was > + * defined to be valid unless all interrupts are GSIV-based. > */ > - if (smmu->event_gsiv && smmu->pri_gsiv && smmu->gerr_gsiv > - && smmu->sync_gsiv) > + if (node->revision < 5) { > + if (smmu->event_gsiv && smmu->pri_gsiv && > + smmu->gerr_gsiv && smmu->sync_gsiv) > + return -EINVAL; > + } else if (!(smmu->flags & ACPI_IORT_SMMU_V3_DEVICEID_VALID)) { > return -EINVAL; > + } > > if (smmu->id_mapping_index >= node->mapping_count) { > pr_err(FW_BUG "[node %p type %d] ID mapping index overflows valid mappings\n", > -- > 2.36.1.dirty > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel