From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.75]) by mx.groups.io with SMTP id smtpd.web11.45689.1675095760667000614 for ; Mon, 30 Jan 2023 08:22:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=EJAaK+8J; 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.100.75, mailfrom: gmahadevan@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vs8haBfOMi0+7VzUDFA4y56YTJH28DeLjNvgEBdBvkg/v9Gg+BK582wG22RG/gT/CUhqlsdres5XjFGZm/2/sSGoRTWQa102hJyQfettb8Ns14h5ow4N/rNsObf06HodpsSGVWOTgRciMMAaohE36ZUfuM7GEVaHXOsT+APbf+IZZ7h9JSHc0s6IkeuFV5qKLqUnDfW/f3+/AKXeS0dnC2SPs6Xt09TEpnaF9CBCWlYhBB2rKlfCohfJmBKKN985415MSmv1afnllrF4Nob+ldbtlY42xtPD2/4yvzYUIoHufDScpdlK4vibyOUuGjXJlxlv0wIB2B1djh12VdH/LA== 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=aEB6Khk3mx7PRkesCLS8s304JAM9qH+D/1xO1nX1iRA=; b=bSny480hPI/NnFZoIx4lzeDl0b1/OQXt7Xa3rMj7MG/92Q0SHn1Xjg7xTFc20KSZWm6th1ABCNNu8mN/AJiVlcZXeBLkB5c1Dn0vOOkY11bv1L/D4v/6aH6mx0K3GjLhNhQHJPNnM/vQiSPA0T6nudRzAdbyEtEsSaPxUkPQIL2X0hqO4TogaoQ9hMi3XH8nqxxGTRQpLSFM/P+rDig/7esXDnm9ZXA8wshE3lKSqmh1FPiTrRX1wP95i4KBRscF0JlAtkxyOaghmPmwYEEVO3qdnJLW6I2lWaAxSRySVX2oJ+MdunxuFIazYPikmHpq/B3SYMtqCp3w+8eZs5yknw== 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=aEB6Khk3mx7PRkesCLS8s304JAM9qH+D/1xO1nX1iRA=; b=EJAaK+8Jri1HII0xrpcBNyMO42aj90mbb10D9Lbq52LUAPjH9yMxlxcTuXjPnaxZp/dC8ge2vWWija7YlGPYBdm9DVjZz7NOj4K3HDyIdtWbVK8sCOPa23vOQSFNZgV5QK0ZKF2n4FXHW1rn9L1gDRttGA6N2gXIRjvaJuLen8wic7vR7YBLcGWgI0KfP3yfYdN+6NK6kvvbNK0M7hUELdntZLci/rLuKoqHj7wHwv8k8g3n/06cSoYJrvVQapGmLVJ5B8TYmLlu5pK4irDUyEhcc/CCbdoxmYUE2lwgQq5OfMrqfgXWAoai04b1D7qgN2X+2im/mOm9buxIfkObGw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6297.namprd12.prod.outlook.com (2603:10b6:930:22::19) by SJ1PR12MB6338.namprd12.prod.outlook.com (2603:10b6:a03:455::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.33; Mon, 30 Jan 2023 16:22:37 +0000 Received: from CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::41d1:95ad:101e:7491]) by CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::41d1:95ad:101e:7491%6]) with mapi id 15.20.6043.033; Mon, 30 Jan 2023 16:22:37 +0000 Message-ID: Date: Mon, 30 Jan 2023 09:22:31 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v1 1/1] StandaloneMmPkg: StandaloneMmMemLib: Change max address computation To: Ard Biesheuvel , "Milosek, Damian" Cc: devel@edk2.groups.io, sami.mujawar@arm.com, ardb+tianocore@kernel.org, jiewen.yao@intel.com, supreeth.venkatesh@arm.com, jbrasen@nvidia.com, ashishsingha@nvidia.com, nramirez@nvidia.com References: <20230128002657.1290601-1-gmahadevan@nvidia.com> From: "Girish Mahadevan" In-Reply-To: X-ClientProxiedBy: BLAPR03CA0141.namprd03.prod.outlook.com (2603:10b6:208:32e::26) To CY5PR12MB6297.namprd12.prod.outlook.com (2603:10b6:930:22::19) Return-Path: gmahadevan@nvidia.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6297:EE_|SJ1PR12MB6338:EE_ X-MS-Office365-Filtering-Correlation-Id: b9616e28-1dfb-47d0-c374-08db02de3361 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vxOh//1YcH65Va7dkTh42aL35tFFhg0E9TphFGOSohrSgtEnhl0sQHUTIyTofD49V5YyDqu5LDfoKemQp91aXDzZ+FEfR5abqbbc7XUgWullTLj8JjX7793mUScks6/6UboVMcz/jVzMXHQQGIO622PTNy5ne/91Wv1wnVU46X7qVUA5jisH1fieFknjYsrBlQpuAO9wuvgCaSoWJa6mWHoOxQeJtau9dYDW0pFAAo4zb9pIQ7UDeH0FwrAEiqHAg+xn/TWry+ixYCqa9kNMv8w6fgZvaZi0UZjFfAfjBziNRvZ+LRwal2XZxb9PzahYeuIoSwOPx76Vl4+DlUCS92K3dbrZvI0BE8BLI86uwgbBNgfY/I84PDlvvY7WSUIKlBEA58kHpg5Vcjd6vZbs5uCGH2Wt/Twk3q2bnVVXIvMN8ewch3gwnxxwMgIAlM+l4pkJyPCXx4ZXewSafm5bXdBWJND0vpQjGs1fT5hGf2Wib28sdTSwAvfzfojWa10z8zdM1BmeiLQWhtLtsX03HVXo4suetHwEtovbT0UccQF2I1CWifClveFHg5+xeWLPfW7yEWgeNoH0CTaz6yv2mCQ8ie5FXDwR7OVrTLn4n40cAsevPQIP4XKG3otqHwt/VCyXvnfnC3aP40hIs2qkimHFE+RYQCVL2QIfXqQrYNRt1Qn+aZAS34Ilg0Dg8maQaNv0+nAk9LTzgxSmzHGtVYv81w5mq2KPSg9D362PpIY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6297.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(6029001)(4636009)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199018)(110136005)(2616005)(31696002)(86362001)(38100700002)(2906002)(36756003)(53546011)(6506007)(26005)(6512007)(478600001)(186003)(83380400001)(6486002)(107886003)(41300700001)(6666004)(8936002)(8676002)(31686004)(66556008)(4326008)(66476007)(5660300002)(66946007)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MURlOVRXeSs0Z1hTWTZlYjR6am5vWEgrTTZEYlRZTmpBWDNHM0FqKzhsVEZI?= =?utf-8?B?WFF6Y3ZqYmpaZmVHcHBnMHYzdFh5dUVLZm9TL2JKRUFLS21ya3p1K2EyTElm?= =?utf-8?B?YkM5bDFDVzQ0WGM0UGNjMHcxYlczc0tEaE1nanlwMTJZMDFTQ2kxL3lYWjBI?= =?utf-8?B?c2V5VU5yRXVGaE51VmJWcDNZWUlSMSto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?= =?utf-8?B?NktIWDNIZyt2N210ei85Q05pVTcvRk0yZEMrd295S1dIUEt2UmpDWk1jR2Mz?= =?utf-8?B?VC9GdHQzZS9Bd1NsMjNDOThxa0pCZjJ0elJ3dlE5TkZqVHBKSmRBbmV5dWpO?= =?utf-8?B?ZnZDNmhSanB3UC9SNEh5NlRyQjg2RE9LbXhXVCtMNVFWSnhRVk40NnNuU2Yx?= =?utf-8?B?WlE9PQ==?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9616e28-1dfb-47d0-c374-08db02de3361 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 16:22:37.2972 (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: t3mPEmW/sKzpWLc7ZuctjiOpS8u2vikgspd4Y2rRHN3SkyWSMOBexgBT/QT3e6Y+q5p1T5hbz3ng01/N6tQX/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6338 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi On 1/30/2023 4:27 AM, Ard Biesheuvel wrote: > External email: Use caution opening links or attachments > > > (cc Damian) > > On Sat, 28 Jan 2023 at 01:27, Girish Mahadevan wrote: >> >> 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; > > This should be MAX_ALLOC_ADDRESS not MAX_ADDRESS > ACK. Best Regards Girish >> >> - // >> - // 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 >>