From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id CE2FE740032 for ; Tue, 3 Sep 2024 18:04:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Htoo8PXaBJeoOBOl6bnWrKxhmvIY2pRyd7FtRja4Dsc=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240830; t=1725386644; v=1; x=1725645843; b=XlzHcaYFvVnDk9p2pjIynjHTC0LbAx33EQn5De0P+nzB+3je2RbDwb9oLqiQRA10VJU2rqSX m3+wuxhxDqivsIDERXfES96kb7hvrPqlV0oOSOnFRXcpZZKgeCsYICFwG9zXbbopJXORR+lSs8R ORdHL9qly8S9CLnAySCDwchyb0OaZ2AwNFx/uvyr00+KbuUhcKAJpjggaK4Kpdni5Deb5ztPDnw Rc1SusZhei/orWEoq3Wu8uM8apTyXiQJthYqFkKBvNYIF+NVwXWAYXKcbcfnT2r+PYwMvsbS1k3 xjmsHTZE2cno0X5+kNQ7OEq/Lhr5WNzCHgTQGo+bJakeQ== X-Received: by 127.0.0.2 with SMTP id m84PYY7687511xYl3OGBgVEU; Tue, 03 Sep 2024 11:04:03 -0700 X-Received: from DM5PR21CU001.outbound.protection.outlook.com (DM5PR21CU001.outbound.protection.outlook.com [52.101.62.128]) by mx.groups.io with SMTP id smtpd.web10.8053.1724919968751160344 for ; Thu, 29 Aug 2024 01:26:08 -0700 X-Received: from DM4PR01MB7596.prod.exchangelabs.com (2603:10b6:8:60::8) by SN4PR01MB7422.prod.exchangelabs.com (2603:10b6:806:1e9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Thu, 29 Aug 2024 08:26:05 +0000 X-Received: from DM4PR01MB7596.prod.exchangelabs.com ([fe80::835c:1756:e2e1:7410]) by DM4PR01MB7596.prod.exchangelabs.com ([fe80::835c:1756:e2e1:7410%3]) with mapi id 15.20.7918.019; Thu, 29 Aug 2024 08:26:05 +0000 Message-ID: <82e50c43-e924-49f3-bc17-8b32cb51bd7b@amperemail.onmicrosoft.com> Date: Thu, 29 Aug 2024 15:25:58 +0700 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH 1/1] AmpereAltraPkg/FlashLib: Fix kernel crash if not call SetVirtualAddressMap() To: Nhi Pham , devel@edk2.groups.io Cc: quic_llindhol@quicinc.com, chuong@os.amperecomputing.com, rebecca@os.amperecomputing.com References: <20240814032242.2353572-1-nhi@os.amperecomputing.com> From: Chuong Tran In-Reply-To: <20240814032242.2353572-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0126.apcprd02.prod.outlook.com (2603:1096:4:188::11) To DM4PR01MB7596.prod.exchangelabs.com (2603:10b6:8:60::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR01MB7596:EE_|SN4PR01MB7422:EE_ X-MS-Office365-Filtering-Correlation-Id: a8d08884-e83b-4a23-ed0a-08dcc80439ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?utf-8?B?OUZyWmtjaGZDWCtaK0RSTHJYUllGQ2pmaUZzSVltWC9GcWpHeWRZbHEzOTZS?= =?utf-8?B?aCtqOEZ1S0s3MWZObEdNZFgzeDFDTStCZlJOU1dPdUF1RkZiM2tXVjhSQ0pu?= =?utf-8?B?bkVsN3BFa1AzbFgra1oxSXV1bE50WjdtWlRabEpjYUV0bEl1RkV4VkNxYUVM?= =?utf-8?B?cGRmSUI2dkxuTVZtOUp0c2hnV0crMmNhaGtZa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lWc1FYNG1xRU83aHN5S3FLZHUzUEdKeUV3Z3RMSzEwYlFR?= =?utf-8?B?V0RhbzRoQ0VCdU1FdGZTTEZXSFI5TytKTEFpb1pDak56TmIxdzcwQTF4a2ZJ?= =?utf-8?B?OFkzOWZNSWJuZ2dRM2FmS3A3QVBEK3JuVUlxd2NOd1Y1SjUwVzlzTUNBdUg0?= =?utf-8?B?WHNacnptcTQxaDNZSmpKUlpGSXdkQTBlTlJlL1F4ZGtlUXpYN0QxbzN1dDFO?= =?utf-8?B?d1JWRGVLWHZFMDJ4aVhzVjJ2aHQxOWIwdkVJRHZYNEFOV0lSalVIdkRKaC9l?= =?utf-8?Q?O5fit8RZh93yAT8oFUNGWXQ=3D?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8d08884-e83b-4a23-ed0a-08dcc80439ac X-MS-Exchange-CrossTenant-AuthSource: DM4PR01MB7596.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 08:26:05.3936 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j7AhPuVvt75IbPKgBXuDLF8OqLY6NRiK02RV5JTfzC4+KbhRjRLefXXeQV45mHMBMCefyLyEovsOcU9fekBuRvhGSW1XIVwSNvg5H9PZypTEi1jpVPz7vTCdNPgi/uKa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR01MB7422 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 03 Sep 2024 11:03:57 -0700 Resent-From: chuong@amperemail.onmicrosoft.com Reply-To: devel@edk2.groups.io,chuong@amperemail.onmicrosoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: hINy0prfhE6shWkbFt6i0JD5x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=XlzHcaYF; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Acked-by: Chuong Tran Thanks, Chuong On 8/14/2024 10:22 AM, Nhi Pham wrote: > From: Chuong Tran > > OS kernel with greater than or equal to 48-bit VA space avoids EFI's > SetVirtualAddressMap() runtime service on Arm64 and simply uses the 1:1 > address mapping that UEFI used at booting. However, AmpereAltraPkg's > RuntimeFlashLib replies on function call SetVirtualAddressMap() to > determine whether it is in boot time or run-time. If > SetVirtualAddressMap() has not been called prior, it causes the kernel > crash. This patch fixes that issue by removing the separation between > UEFI boot time and run-time in RuntimeFlashLib. > > Signed-off-by: Nhi Pham > --- > Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/FlashLibCommon.c | 11 += ++-------- > Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/RuntimeFlashLib.c | 2 -= - > 2 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/FlashLibCommo= n.c b/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/FlashLibCommon.c > index 83695c857a11..0b000c2aad46 100644 > --- a/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/FlashLibCommon.c > +++ b/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/FlashLibCommon.c > @@ -15,7 +15,6 @@ > =20 > #include "FlashLibCommon.h" > =20 > -BOOLEAN gFlashLibRuntime =3D FALSE; > UINT8 *gFlashLibPhysicalBuffer; > UINT8 *gFlashLibVirtualBuffer; > =20 > @@ -34,13 +33,9 @@ ConvertToPhysicalBuffer ( > IN UINT32 Size > ) > { > - if (gFlashLibRuntime) { > - ASSERT (VirtualPtr !=3D NULL); > - CopyMem (gFlashLibVirtualBuffer, VirtualPtr, Size); > - return gFlashLibPhysicalBuffer; > - } > - > - return VirtualPtr; > + ASSERT (VirtualPtr !=3D NULL); > + CopyMem (gFlashLibVirtualBuffer, VirtualPtr, Size); > + return gFlashLibPhysicalBuffer; > } > =20 > /** > diff --git a/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/RuntimeFlashL= ib.c b/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/RuntimeFlashLib.c > index 2dcd13e08146..14cef8e17ece 100644 > --- a/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/RuntimeFlashLib.c > +++ b/Silicon/Ampere/AmpereAltraPkg/Library/FlashLib/RuntimeFlashLib.c > @@ -35,8 +35,6 @@ FlashLibAddressChangeEvent ( > { > gRT->ConvertPointer (0x0, (VOID **)&gFlashLibVirtualBuffer); > gRT->ConvertPointer (0x0, (VOID **)&mMmCommunicationProtocol); > - > - gFlashLibRuntime =3D TRUE; > } > =20 > /** -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120480): https://edk2.groups.io/g/devel/message/120480 Mute This Topic: https://groups.io/mt/107889187/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-