From patchwork Fri Sep 20 05:55:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ronak Jain X-Patchwork-Id: 13808144 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 B74A2CF58CD for ; Fri, 20 Sep 2024 05:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=47XTNsDyl8+kL+jRjufp4akVyGY1gJk5zH5TCF53W9A=; b=0Gsy2K23VDdj3YXbDtQrd7V8QP TXYWZUu8tM3yo/1ImzNLUujoLjEunNVvEPxEztK2AveIpgf3PNR8lIcWblsW5JuJjzo0BZF6w1Wj9 ggz5XtnirTjhv0Kf4J7K9Q0l0YxlIfmj9iAGOhLRoVdWIr8MPNbMokbuLJfDgB7Be9lqghDi4WMo+ hAQGY/SW62HS59wy8Q12H3e/8OfruKxOxWTGbIX02Vlkd81D+L3kQgBI49oATb7y3shNkC8skBlgw J7shKi5tigFOhUeHvHPT378Xo19T2JRhpeVLpBY5h7/MNKnjngL7PprlgjsQSodji63iL0OJFzkc5 ScX5f0Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srWeL-0000000BVir-38Dp; Fri, 20 Sep 2024 05:57:49 +0000 Received: from mail-bn8nam11on2061e.outbound.protection.outlook.com ([2a01:111:f403:2414::61e] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srWcU-0000000BVWw-1qG1 for linux-arm-kernel@lists.infradead.org; Fri, 20 Sep 2024 05:55:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yoTdf313aSjUXH+kSXp3/yaj5f2h4U8f3MT6pUUnmf9zJUKO5UMC+wXd+DqaiDL+PvZZ9uc7HBPpy1iWF5LEtbGTuVPN7HpLkd8gRHVqc1ByMHK/TeRzpuNi6Hx212K9ll7QEQ0b6UQokTCCcqJsg48PbcyWdgPANvY7JVObHPJQWr5QIMk3dT6zVPDDrviRUDJCkDJeyR0KbMlCjn2QWLOdXhhQVLqdb6qcVm1SE/gX5wEiC+jh+UQ3kXYqxRcuJzr6/p5Z3RvdeEUSR5s3WW5qUJEnFzbJ6b+/TmgJ3XvIJ8d6SoGxWFjl4qBI/acFEOC3XVs+HVEy/Sjp8gBf3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=47XTNsDyl8+kL+jRjufp4akVyGY1gJk5zH5TCF53W9A=; b=B1TMgEw1U44B670g+7eYc8ZXkGSyN6W0RKhpJOsn2qUUGBZGNIrOH6a3AqFsxj9YGxxUnWPjddIg3+d57VKiFemGKCisfCod9z+EeDiD26SQVBrxGVQbvHD2ORtVSne7QpHILw3Th7L+UaAXks76WPF5d0Z7rVmsGOWQPnxvor6wI94ZV+2nMQFxc3EnZK9ZE7GwwOz8m/Pb/XQVxgj7LA8a5AeNGcNO3cuZjl4wAnXKfVHBt4/YjDmLdOqehHr4P6ZOIqfXY8duDpT6s0r7NpKXpo5j663JnfOGUiTZGvzBBZCAOV86wQA7zjJIr94Kq4Sn4j9MU71lVucQQ/NlaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=47XTNsDyl8+kL+jRjufp4akVyGY1gJk5zH5TCF53W9A=; b=FDmfhAe086g5/i4UX/Smi6Mcx/T2nYGGBl1QxvOI3ui305LtAyv3foa9RqlyclhUUE3R5bsOGDzYm+vi36lZpBArgaPNl0c7sT7lY6iXER1R5+5L+WwOoZ7EkT9HKm/oikqYhCiTET84FAmTMiUF7XGJJJPvVg9sVMTBzlO/AVI= Received: from MW4P220CA0020.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::25) by SA1PR12MB7319.namprd12.prod.outlook.com (2603:10b6:806:2b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.22; Fri, 20 Sep 2024 05:55:49 +0000 Received: from MWH0EPF000A6732.namprd04.prod.outlook.com (2603:10b6:303:115:cafe::c9) by MW4P220CA0020.outlook.office365.com (2603:10b6:303:115::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.25 via Frontend Transport; Fri, 20 Sep 2024 05:55:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000A6732.mail.protection.outlook.com (10.167.249.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Fri, 20 Sep 2024 05:55:48 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 20 Sep 2024 00:55:47 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 20 Sep 2024 00:55:47 -0500 Received: from xsjwillw50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 20 Sep 2024 00:55:47 -0500 From: Ronak Jain To: CC: , Subject: [PATCH] firmware: xilinx: fix feature check logic for TF-A specific APIs Date: Thu, 19 Sep 2024 22:55:46 -0700 Message-ID: <20240920055546.2658783-1-ronak.jain@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: ronak.jain@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6732:EE_|SA1PR12MB7319:EE_ X-MS-Office365-Filtering-Correlation-Id: d172a2f3-e10a-42c1-4813-08dcd938e091 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310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Szip+VY/Gy2vGBjxFjNKeXpvm8LriYpR0qd1Tp5Q+saacpiEc0ZUO70Qn3RNaLkPljXVOfMUuzLx4PotSWmhA943rJdNvzCs20W0lTV7ceCvZ+xhJNyOwkrelL5UmF6kBLe/VSPxA8Bed7vhz/4RhXbkW3xjxMKEAfVfLnw/FrSukckxKRsUX4WhZBimCa3ZCUNELVjdAd1SMissv/eRKtj7lblk9kZkGH1EToNmN7tccen9F1yzHgRNGKRovmhubBd91VqetT3UltLpDVbqlrVvN18a2YBy/DbHoBrh0/Tjw1IDif1MOiHFlV8GweSgJglZHbc8j4QuDqzTM+auT2d0jAFHGrqvzHZiaEWJVd0POPQAHQrgnifQjFIgOo+lXaztEQGQkzxDEnDiS3rxKvLeH X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2024 05:55:48.6906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d172a2f3-e10a-42c1-4813-08dcd938e091 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000A6732.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7319 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_225554_505771_892F6236 X-CRM114-Status: GOOD ( 13.08 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently, Linux is passing only API ID for feature of TF-A specific APIs but for feature check of TF-A specific APIs, TF-A is checking for Module ID + API ID as a result incorrect version is received for all TF-A specific APIs. So, fix feature check logic to pass valid arguments to get correct version. Signed-off-by: Ronak Jain Signed-off-by: Jay Buddhabhatti --- drivers/firmware/xilinx/zynqmp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 5ab0dfb2b225..0b2ad46c8bce 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -225,11 +225,14 @@ static int __do_feature_check_call(const u32 api_id, u32 *ret_payload) * Feature check of TF-A APIs is done in the TF-A layer and it expects for * MODULE_ID_MASK bits of SMC's arg[0] to be the same as PM_MODULE_ID. */ - if (module_id == TF_A_MODULE_ID) + if (module_id == TF_A_MODULE_ID) { module_id = PM_MODULE_ID; + smc_arg[1] = api_id; + } else { + smc_arg[1] = (api_id & API_ID_MASK); + } smc_arg[0] = PM_SIP_SVC | FIELD_PREP(MODULE_ID_MASK, module_id) | feature_check_api_id; - smc_arg[1] = (api_id & API_ID_MASK); ret = do_fw_call(ret_payload, 2, smc_arg[0], smc_arg[1]); if (ret)