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.53]) by mx.groups.io with SMTP id smtpd.web10.3340.1674865647772054568 for ; Fri, 27 Jan 2023 16:27:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=sKNTx4Sr; 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.53, mailfrom: gmahadevan@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gz7+b8ES53vCpW/AnG11zTfKoZihmVId21ygs75NKPcuRT2qNGGIDzT9gPqlW/60nq1mLZYpZFW9Lt1Jp0aNg+ijwjsEfUX7d51NgKzRRM860LXvvuvhZcx5hBODs6zzN+B/jr+C+Gi2P3+oz2We6eEcI7AZWztYfCaxXgVpLo/bMpnZDt7+tqGCk4ccx+cWhq4sBTdW/yoayZ39qqQzd4yOAlaL4Zts8mD/t90mR0S9V71iGlmSkiihO8jF+ClsM4zSYgH01zpfqN6v4HNtCYTKA00gYyGDRL9QZ0a8UyfHWkDGtCGOfO4si2KLzOvIQ+rwOOxp945l6BoCjO5O5g== 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=tAid4I/eytzysRMydzWqyVdWCvpN1+BfZU92YfSAAkA=; b=eu/HLNhN2j7lSixBPfvMFyAd3bXgz3w7ZNlvdwR3gAXbtwIxaHiQ0fJ2gSOZxegRfPaP8obyFnAekm6aP0oacqxE9wctAPuPmhkwDA9j1iG2Np3KPjG1ApD7ezjr13E9hxU6TQjxHeu03VnUB5MCRjBRSoVAWsjZb75rCzxK4+b+yXI6CHsYXbeT8i/YXYOB7qeUxOkmTjsy/spNGbfAu2EPqblO5K2Ap6ClNEZ0ztZltFycf+V+4i/t2lqmmy5MlpSUZbJROY9vIVAOCXlN6nJv6Se0Z+Hkbl+sun/A2KdQjsbLCvtovWrx6BPjdycozMMJLLciXntpINpIji+Hpg== 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=tAid4I/eytzysRMydzWqyVdWCvpN1+BfZU92YfSAAkA=; b=sKNTx4Srf6BdlZydhZApuTmxSPBR75wrn0+dllXCw1H5eCtcwLJHXh3fPG0AsnK/4x0tCLE9IHtrOTb6rPj4yybziVC8ZmIFCQJjchigsB37J3WZjNQUSkDAIdalNNO5hvG7olLbc032y2ftGddp9wT1kEbZMVZoQcZ45LL2m6uyDt7RBTMaODw9Vyxah/fbRoyV4wgkjdpLLANYCIKoIgt7FliRxKzQ5jEo7QN4TzvHB8WU7Cqkl3DddRKhIz9tvYDNO4//f2otO8qRt38hTxegkhaA10Oi2d1NmeY4EslEDpVYbGot1XIc5pCzKcnUXjEyDmVSLyWiSWq270CNTA== Received: from BN1PR10CA0023.namprd10.prod.outlook.com (2603:10b6:408:e0::28) by SA0PR12MB7076.namprd12.prod.outlook.com (2603:10b6:806:2d5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.25; Sat, 28 Jan 2023 00:27:24 +0000 Received: from BN8NAM11FT112.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e0:cafe::13) by BN1PR10CA0023.outlook.office365.com (2603:10b6:408:e0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.25 via Frontend Transport; Sat, 28 Jan 2023 00:27:24 +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 BN8NAM11FT112.mail.protection.outlook.com (10.13.176.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Sat, 28 Jan 2023 00:27:24 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) 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; Fri, 27 Jan 2023 16:27:20 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 27 Jan 2023 16:27:20 -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; Fri, 27 Jan 2023 16:27:20 -0800 From: "Girish Mahadevan" To: , , , , CC: , , , Girish Mahadevan Subject: [PATCH v1 1/1] StandaloneMmPkg: StandaloneMmMemLib: Change max address computation Date: Sat, 28 Jan 2023 00:26:57 +0000 Message-ID: <20230128002657.1290601-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: BN8NAM11FT112:EE_|SA0PR12MB7076:EE_ X-MS-Office365-Filtering-Correlation-Id: be938a92-2983-4597-e34f-08db00c66d68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1M3EWuLj3XF/+7VBoTNbE3IOEza/cmO6XaUj9UGQsl4xZ5c8UBsbIi7dDyJD9JvKuRabycnCPLLsnJOa6nJm1Mpk1/3Jd/CQL21GKOMXyGgu8Tncp0Ce48DkR1CaLf3IBkwhfziOoiXioJ/2iBfu3Nn4JHiAmS7ttvK0GZOHNIpRWRjK51Q5yIgMs66ObBvpcnPxp/BNNAaNhfhL8L3gWjWan8rIh5qjdb+SfoZnO8DCGJ3QHcWW8C14VEh891dX8777QvNLrD4IheV+4VfbnujkMOKmcxxokowZXoP8A4m8IXvllhhe3v1yJQK/XhQ0UlD5TecIxljNfYwZxdxUWjwCr39Y1GfrHcbH7RLs1iSavMytjdLO0xARPAVoXPNLlVfy+LnkbQxv4ZgPt3ES0B5MimetwCU4VLZ1RvPkPGiNct7S+tKeKo+DwKG80PLOxsjdwEz5lf8jv9nTRtAPJCzIK9i21dej4q0hm5FhaQtDrlr4ZQWX10JQwT7FfsT8kGSHKsYoIn+h2H35ZXCAyVtLGkBjQYA+aBluERpoP+cCuAJtm4ICKF6epsCCSp/aGmoDAjGNkZWVqXwc6VN+NQIJo9LA/USjFLCiA31VxsC4/rVfKWr/kaG1rvaa/PxlJsUVj6BzSFKh6h1qXlM7cBpefiYUe9BbWrQawjKgh+JBg3S92EtV6XRzUyUjOTiTZcchbpFeoUq8qpYchPrj9w== 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)(346002)(396003)(39860400002)(136003)(451199018)(46966006)(36840700001)(40470700004)(47076005)(426003)(336012)(2906002)(82740400003)(7696005)(36756003)(316002)(478600001)(54906003)(110136005)(26005)(40460700003)(7636003)(6666004)(107886003)(356005)(8676002)(70586007)(70206006)(1076003)(83380400001)(4326008)(2616005)(40480700001)(8936002)(5660300002)(41300700001)(86362001)(36860700001)(186003)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2023 00:27:24.0297 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be938a92-2983-4597-e34f-08db00c66d68 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: BN8NAM11FT112.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7076 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_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..4dc392b4e3 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_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