From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.52]) by mx.groups.io with SMTP id smtpd.web11.45880.1675096144455201966 for ; Mon, 30 Jan 2023 08:29:04 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=uaeAPUXp; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.244.52, mailfrom: gmahadevan@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gBKVvVeJtR8oIKr6vPDocLRxSnthIgpG0pgFfKUTX6DQx8k+0MMpD5K4pPyeJR2Z7XcJT8GL2XwmWHa2eBYYyx28XVzumUcQ2g/YlZ/F5DTTfvz2WosefbCkzgw/e9leDYMUl4MxFVO4sydhY6IKtCd4095wRKmgRUAakJtbSr9FuqskrFwR/QdsnlqegkkRR+b66Nn+h+0f1ETRDzrGr53DY/6EZhLpRJgMFKrNfQwOG7bf0kNYgF1Py80hyVjTLPxEc9Ge58dBnmD1nsWdNbrIQCJpWp1gcVXKddim9BR1weo8+ogzAzhdsWjAXYBuHeGH/cZfOZ9ZS7C+nSnFXw== 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=sA4c1RRqFedvqpWEEjOKCUTg/qTGtLU8VNdwv6ih9L8=; b=A3nRpMDLHUpRKcjwJ67SkCAFOQYRMjHI/0HTqtJatvl5RvZZOXLMV0Q1RkTo0hYnFVxetJpKYR4oYJHi3eKSaD4gCHP0JG+dI+MHlnZcWaYkYVcivS0Z+AIY+XdJU2R7q/JIHyGDlB1RVFHxORFWETtnx8TTf7DT952yG5EMdKfrXrjl3Oo0BQ2q0szFTqJyv2/nTyp/Sqh1q/ksYrNMhBTPoVkWfxQ4hnQv2CIl5NHDMz/qYixrBDE/O07Vyamo61pC1n4zsMaxCcyN6FH2K2WbusABtKuCkdgiiQnm56eRnW5yX2MwZrl8zUqHRxFgbWhI81ycXPm1tzqdc6vxZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=edk2.groups.io 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=sA4c1RRqFedvqpWEEjOKCUTg/qTGtLU8VNdwv6ih9L8=; b=uaeAPUXpuotPO9K4zLYfVCoPgIA/dOwpIirw/73lKJO9niPaofLWr9NTBGgPH1KHTkhStmz31BC7hAf+H9SyygUsVKit0pi2+qlLs6yOzufW4/NAy5XIaDxHxtO6b90SiDF39ElTspUkJxjyj+IrhY30pdgTi93OOx+3EauoJe/zL4hWCTjCQtKNHdn/d+Ux9aQlgZeoB4b/XnY8kngh3W8B4cHL3AA/FemvNdgPmInZr8glNkt08Z7abGzMAs3PpAMqvh4+FwvjnjWzqcDtKebI7HuSDmD9DWfDd1VO6ynVtlMOvuPuYzxfCsxFeRUogmtv90wt02RnW5X6WZ9Oaw== Received: from DM6PR01CA0003.prod.exchangelabs.com (2603:10b6:5:296::8) by LV2PR12MB5990.namprd12.prod.outlook.com (2603:10b6:408:170::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 16:29:02 +0000 Received: from DM6NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::54) by DM6PR01CA0003.outlook.office365.com (2603:10b6:5:296::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36 via Frontend Transport; Mon, 30 Jan 2023 16:29:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DM6NAM11FT034.mail.protection.outlook.com (10.13.173.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Mon, 30 Jan 2023 16:29:01 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 30 Jan 2023 08:29:00 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.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.36; Mon, 30 Jan 2023 08:29:00 -0800 Received: from build-gmahadevan-20230109T020417557.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.986.36 via Frontend Transport; Mon, 30 Jan 2023 08:29:00 -0800 From: "Girish Mahadevan" To: , , , , , CC: , , , Girish Mahadevan Subject: [PATCH v2 1/1] StandaloneMmPkg: StandaloneMmMemLib: Change max address computation Date: Mon, 30 Jan 2023 16:28:58 +0000 Message-ID: <20230130162858.1300761-1-gmahadevan@nvidia.com> X-Mailer: git-send-email 2.17.1 X-NVConfidentiality: public Return-Path: gmahadevan@nvidia.com MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT034:EE_|LV2PR12MB5990:EE_ X-MS-Office365-Filtering-Correlation-Id: 86973132-64e4-4ca4-dda8-08db02df18b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7KH3u98gSAHmYtfX2eYgCLWCgr2vr8epkJRJqaXHM4+tETaDahy242kb/somM8Q2CWg34WWmGb4xzmkRl4tU6c4JJOyjNiy+rJYfELIM5qIJKaBiMULYco6YSLQ+BH5zkEabGTgqXKmBNCObmm/FD5dHSj+YrooBo779yXg8XW8vTnCa0eZt/Uk2tpjd3hiC17IkZNYyLTC7wUSTkxT+5dWDChhH7jjuZcntdIDF/D88nUhaIMtFIzk2Z7MDThO/sTjY5cRDDQj9M6IFj8DccO6Csd9bcQZoUU1cn+b9eouroyrQPbggUqB/sbHpzBslhMPdXFDC9WMVIW32Esxk9Jk6T3hUzurHVWMOzhuW6Udm87aaGQhEnGN7/965/tnGPA9PowFLmh/a6xORoAVpXkF6CT1Tvflq2FmY3GA9iyfaAom+h7TBBxQY5w1NV14VlJB9/y/X7fZyTlQfkg0j2TJiZJlwQGZ8UA+6Rc0hDCcfWwtHqZ5XXql2ePzEy8uq35/LWvyZ1qzcJztcTi9g7mfN74rhB1cqG9NOVb3oYywm1/TqvU2uqM6spjjKi0VOaFXDMGw+e8GMinGP3iAR1xvA3KdRukQwZBsiSBXMFXBrzS9xwJkvaOtbbzfRd8Spy+p5/QRRtD6BfDo0edu6zLxVVrj4p8EBM7uVLP1ywF+cC15ABPk1Q61BNsIkyj8fo2ZIT7ubWgMKfWeV9/Ks7A== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230025)(6029001)(4636009)(376002)(39860400002)(346002)(136003)(396003)(451199018)(46966006)(40470700004)(36840700001)(4326008)(70586007)(70206006)(41300700001)(8676002)(107886003)(8936002)(110136005)(316002)(40480700001)(54906003)(5660300002)(83380400001)(36860700001)(36756003)(2906002)(7696005)(40460700003)(26005)(186003)(478600001)(1076003)(47076005)(86362001)(2616005)(426003)(82310400005)(356005)(336012)(7636003)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 16:29:01.7119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86973132-64e4-4ca4-dda8-08db02df18b4 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.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5990 Content-Type: text/plain Currently the standalonemmlibinternal assumes the max physical bits to be 36 which is causing issues on v8 architectures. Instead use the MAX_ALLOC_ADDRESS macro to determine the maximum allowed address rather than recomputing it locally. Signed-off-by: Girish Mahadevan --- .../ArmStandaloneMmMemLibInternal.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c index 297cfae916..fddcecf6da 100644 --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c @@ -20,13 +20,6 @@ // extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress; -#ifdef MDE_CPU_AARCH64 -#define ARM_PHYSICAL_ADDRESS_BITS 36 -#endif -#ifdef MDE_CPU_ARM -#define ARM_PHYSICAL_ADDRESS_BITS 32 -#endif - /** Calculate and save the maximum support address. @@ -36,14 +29,8 @@ MmMemLibInternalCalculateMaximumSupportAddress ( VOID ) { - UINT8 PhysicalAddressBits; - - PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS; + mMmMemLibInternalMaximumSupportAddress = MAX_ALLOC_ADDRESS; - // - // Save the maximum support address in one global variable - // - mMmMemLibInternalMaximumSupportAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)(LShiftU64 (1, PhysicalAddressBits) - 1); DEBUG ((DEBUG_INFO, "mMmMemLibInternalMaximumSupportAddress = 0x%lx\n", mMmMemLibInternalMaximumSupportAddress)); } -- 2.17.1