From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.22901.1675964143185758849 for ; Thu, 09 Feb 2023 09:35:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nNwCQDqa; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7805961B6D for ; Thu, 9 Feb 2023 17:35:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D57C4339C for ; Thu, 9 Feb 2023 17:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675964141; bh=QEcVF91mY7D8D5eliP/BicwgBKLGhsj6j+VIUD13S94=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nNwCQDqapjAVu3F3j7dRMthyh+JCRSQG+Z8oN5OQoiOSkLOOK+MWNeOew5AnGFj2q 23+cMwIF2Q5Oq5i83EtPTk79qUk5cdO+fmYd9m3B+Q/yHbS+cL1KS8DBMSHCa2cutF GJwKcOrWV9ZbWtVI8A8mgjrsfTyHQLRy3QBqJqIEDMVmKnSoDiouzq+Y9p4RKv5CdZ o2tX5wqtDzqiaOEqzIfChuVL3KyT96Rrmhy2rcjn9+1LYf5BtgM3FtFAVcVomOXkZ1 lzOakL0SwUL4teYSkOpvRqpIasTTm1lhKAdzJlfmFRcWovfphh1iEqiGsfeBsnVx8J qK+tNZ4qxjtqg== Received: by mail-lf1-f45.google.com with SMTP id x40so4111815lfu.12 for ; Thu, 09 Feb 2023 09:35:41 -0800 (PST) X-Gm-Message-State: AO0yUKXY+55gpAOsB+KPCI2i2UYMM9zvwE9kCxszKXMWOkgMLyOxck8h IXMbL3rMBpNIenxoAvfMMh9NHWLBKWkn+eHIc30= X-Google-Smtp-Source: AK7set8KKyHJfTQRdKvL1WbKda0TAoYQGyOWTChMmZZJgYr9ouUpV5UaDm+vwSa0TSkIpUyOzS5ASuRHQh5cOzIkicY= X-Received: by 2002:ac2:5102:0:b0:4da:ee90:4529 with SMTP id q2-20020ac25102000000b004daee904529mr2069349lfb.63.1675964139938; Thu, 09 Feb 2023 09:35:39 -0800 (PST) MIME-Version: 1.0 References: <20230130162858.1300761-1-gmahadevan@nvidia.com> In-Reply-To: <20230130162858.1300761-1-gmahadevan@nvidia.com> From: "Ard Biesheuvel" Date: Thu, 9 Feb 2023 18:35:28 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/1] StandaloneMmPkg: StandaloneMmMemLib: Change max address computation To: Girish Mahadevan Cc: devel@edk2.groups.io, sami.mujawar@arm.com, ardb+tianocore@kernel.org, jiewen.yao@intel.com, supreeth.venkatesh@arm.com, damian.milosek@intel.com, jbrasen@nvidia.com, ashishsingha@nvidia.com, nramirez@nvidia.com Content-Type: text/plain; charset="UTF-8" On Mon, 30 Jan 2023 at 17:29, 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_ALLOC_ADDRESS macro to determine the maximum > allowed address rather than recomputing it locally. > > Signed-off-by: Girish Mahadevan Merged as #4024 Thanks, > --- > .../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 >