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.92.23.108]) by mx.groups.io with SMTP id smtpd.web12.41855.1609128458418267228 for ; Sun, 27 Dec 2020 20:07:38 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=VpcYCTj0; spf=pass (domain: outlook.com, ip: 40.92.23.108, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSClDhFY5M5CRt5ReWkTBucw8EhMhFfxFNh/RrNBAT0hp0N7uLsza0fun0ws7KC+Bo5+pFGpzPn3NVv6tya0zzyoJ74pxWRXzNr8hMitZ5YcfMCJukbAUKzlKLRLuvoS7bj4b5DNSs69QvvjYXQj6a+phdW7+vNlJWQm0IUJGnn/1ZlkU7CNEC1mTaXhiba9Q5sYooPU5jV1elZoXcoOsFLzTsKlhQNxMtF0VDPn4Xo1670fbojyHZbvI2cHeNyaEyBh7/13cv8ekxgDt+EQ6pCB7hWs0+d9lnr/tXp51f+9T3GqKDGFSwwvhFHFRyBquAPku/5CkfW1Ws65+Px1yw== 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-SenderADCheck; bh=+6Yoj4SiMX1fFuQH5VoZyNm/yQl7ovldi9AMh5KHKSQ=; b=U9GCnMBofrAv8zD7TZm1bXFXBhBm81SEhv/+fBD+DqNqWaAzl798KBWg+l0DUIeSpSJbFYevADQr2Aah7Xigb+0zxT5P5sCQhYjReHP6Ji/g9M2nveOPyTj8+UVkJNb8rjVL8zcHRv7do3RTuvq6U47y5W5zv//t9Ne6qvsWk6eD+89iGGxl4Kscm1dJXb/JkNBPEpV4t2qAO/D8XL+jspF9HffBKNuOf37yBXk39Na2U/t3Ia09w0NXeVdNPGJ0F7Q6d4mbWHbKoyr09xPXKr64yUw2TMGQXZmyHX9ifqRqnmGzAJkWRr8fY+ghsZ4g99uBjXsR5mXQFdujtmqwZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+6Yoj4SiMX1fFuQH5VoZyNm/yQl7ovldi9AMh5KHKSQ=; b=VpcYCTj0Huzx4ft2WeVB7R4myHKPyD3J3A6mUcj1+V4AvN09SwbTi6Wgln7i2Cc1aOeg9b6q2Zxau+xtl2r5zzZi4TE9A2JGjH8waty6ev68YXHN58grP/9FmGYqtz06YiCkIz25CWJ6io2UxG56JKKU/CaNIwb4LT0rJRGotbLlt+HRCn9ybQ9K80Qk6u+A9j0d4qBzdZkX2YHqPN1Og7yyC1G4oe0/fsiW7KgYcQRCM+hj6phckgMIePt1fPeVlc+HKUtIGuJYqQqqT5wSGPtKSefLI8EcBopBSKFkA6JgjKaTyVBxdwY4XhWi2r2dxyQzEKX5CDLE377Mm0Na0Q== Received: from MW2NAM12FT029.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::40) by MW2NAM12HT063.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.10; Mon, 28 Dec 2020 04:07:37 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:fc65::46) by MW2NAM12FT029.mail.protection.outlook.com (2a01:111:e400:fc65::318) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.20 via Frontend Transport; Mon, 28 Dec 2020 04:07:37 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6%5]) with mapi id 15.20.3676.035; Mon, 28 Dec 2020 04:07:37 +0000 From: "Kun Qin" To: "Yao, Jiewen" , "devel@edk2.groups.io" CC: Ard Biesheuvel , Sami Mujawar , Supreeth Venkatesh Subject: Re: [PATCH v1 03/15] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Thread-Topic: [PATCH v1 03/15] StandaloneMmPkg: StandaloneMmCoreMemoryAllocationLib: Fix compiler warning Thread-Index: AQHW1W6nnQhEQIJZTUCqyBPzWzmwQ6oLsdMAgABBHy8= Date: Mon, 28 Dec 2020 04:07:37 +0000 Message-ID: References: <20201218185011.1366-1-kun.q@outlook.com> , In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:C8305CB46D6237F28C0EE976E2A8CAC77D289EC99EE3A19766D93D85049AE289;UpperCasedChecksum:B8D6688C69D5E463ACC4E5BF24152C1D6A4DEBA8AABE00C867F38C06C92F9118;SizeAsReceived:7237;Count:44 x-tmn: [5q2LtoAIuJeeY622++r+lK+l5OnzZVm0] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: f0a906b2-bb4e-4a17-ce58-08d8aae61cb5 x-ms-traffictypediagnostic: MW2NAM12HT063: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SPiEWOJGZG34xR/+J3tfDNh+GOGgq6TE5blZgDs/gQmQOHelOKVe/hXBoVAuF1ClxBkDocB6Gqjd+c1TcXLdEj15UKGDXRoo3PBUQqbNKUiz7iv+3PVhC0zIHIGXgaEg3X3OwdyVho0/ChKdQZKTFVkaZwSN7A8z63PTbPndjGscax1YEDw7KH5jJK2wfDnEVK0Ld+1hWMclni5+zd95dCw79JZGmfzQ820mFIIXfJGnRGyw/FghxaMhk2qYPPOb x-ms-exchange-antispam-messagedata: R337P+8dUkN79nb8PEsXM/Rf920K4MwXHb4smCIJX/elj94qnT2fifuOEM/hF0Ornr7gI+kaS3yO6rXIrMpoX3FsaBgrVFREP69cqUbZj586DQ1a6URgztCHKEAmesnnLtMarkqVqZX1oRh8P34/6w== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT029.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f0a906b2-bb4e-4a17-ce58-08d8aae61cb5 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2020 04:07:37.2692 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM12HT063 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MWHPR06MB31022B94BBDA7F7AD5C6B225F3D90MWHPR06MB3102namp_" --_000_MWHPR06MB31022B94BBDA7F7AD5C6B225F3D90MWHPR06MB3102namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jiewen, Good point. Will update this in v2 patches. Thanks, Kun From: Yao, Jiewen Sent: Sunday, December 27, 2020 16:14 To: Kun Qin; devel@edk2.groups.io Cc: Ard Biesheuvel; Sami Mujawar; Supreeth Venkatesh Subject: RE: [PATCH v1 03/15] StandaloneMmPkg: StandaloneMmCoreMemoryAlloca= tionLib: Fix compiler warning Since below code is using (UINTN)MmramRangeCount, MmInitializeMemoryServices ((UINTN)MmramRangeCount, (VOID *)(UINTN)MmramRan= ges); I recommend to UINTN for MmramRangeCount, and use (UINTN) cast. > -----Original Message----- > From: Kun Qin > Sent: Saturday, December 19, 2020 2:50 AM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; Sami Mujawar > ; Yao, Jiewen ; Supreeth > Venkatesh > Subject: [PATCH v1 03/15] StandaloneMmPkg: > StandaloneMmCoreMemoryAllocationLib: Fix compiler warning > > Assigning MmramRangeCount from MmCorePrivate (UINT64) to local > variable > MmramRangeCount (UINT32) will cause compilation failure due to "warning > C4244: '=3D': conversion from 'UINT64' to 'UINT32', possible loss of data= ". > This changes defines local MmramRangeCount as UINT64 type. > > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Supreeth Venkatesh > > Signed-off-by: Kun Qin > --- > > StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Stan > daloneMmCoreMemoryAllocationLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git > a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > index eb3d772e18c5..798d546a2037 100644 > --- > a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > +++ > b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta > ndaloneMmCoreMemoryAllocationLib.c > @@ -841,7 +841,7 @@ MemoryAllocationLibConstructor ( > VOID *HobStart; > EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData; > EFI_MMRAM_DESCRIPTOR *MmramRanges; > - UINT32 MmramRangeCount; > + UINT64 MmramRangeCount; > EFI_HOB_GUID_TYPE *MmramRangesHob; > > HobStart =3D GetHobList (); > -- > 2.28.0.windows.1 --_000_MWHPR06MB31022B94BBDA7F7AD5C6B225F3D90MWHPR06MB3102namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Jiewen,

 

Good point. Will update this in v2 patches.

 

Thanks,

Kun

 

From: Yao, Jiewen
Sent: Sunday, December 27, 2020 16:14
To: Kun Qin; devel@edk2.groups.io
Cc: Ard Biesheuvel; Sami Mujawar; Supreeth Ve= nkatesh
Subject: RE: [PATCH v1 03/15] StandaloneMmPkg: StandaloneMmCoreMemor= yAllocationLib: Fix compiler warning

 

Since below code is u= sing (UINTN)MmramRangeCount,

MmInitializeMemoryServices ((UINTN)MmramRangeCount, (VOID *)(UINTN)MmramRan= ges);

I recommend to UINTN for MmramRangeCount, and use (UINTN) cast.

> -----Original Message-----
> From: Kun Qin <kun.q@outlook.com>
> Sent: Saturday, December 19, 2020 2:50 AM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; Sami Mujawar
> <sami.mujawar@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>= ; Supreeth
> Venkatesh <supreeth.venkatesh@arm.com>
> Subject: [PATCH v1 03/15] StandaloneMmPkg:
> StandaloneMmCoreMemoryAllocationLib: Fix compiler warning
>
> Assigning MmramRangeCount from MmCorePrivate (UINT64) to local
> variable
> MmramRangeCount (UINT32) will cause compilation failure due to "w= arning
> C4244: '=3D': conversion from 'UINT64' to 'UINT32', possible loss of d= ata".
> This changes defines local MmramRangeCount as UINT64 type.
>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
>
> Signed-off-by: Kun Qin <kun.q@outlook.com>
> ---
>
> StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Stan
> daloneMmCoreMemoryAllocationLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta
> ndaloneMmCoreMemoryAllocationLib.c
> b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta
> ndaloneMmCoreMemoryAllocationLib.c
> index eb3d772e18c5..798d546a2037 100644
> ---
> a/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta
> ndaloneMmCoreMemoryAllocationLib.c
> +++
> b/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/Sta
> ndaloneMmCoreMemoryAllocationLib.c
> @@ -841,7 +841,7 @@ MemoryAllocationLibConstructor (
>    VOID        =             &nb= sp;       *HobStart;
>    EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHob= Data;
>    EFI_MMRAM_DESCRIPTOR     &n= bsp;      *MmramRanges;
> -  UINT32         &n= bsp;            = ;     MmramRangeCount;
> +  UINT64         &n= bsp;            = ;     MmramRangeCount;
>    EFI_HOB_GUID_TYPE      = ;         *MmramRangesHob;
>
>    HobStart =3D GetHobList ();
> --
> 2.28.0.windows.1

 

--_000_MWHPR06MB31022B94BBDA7F7AD5C6B225F3D90MWHPR06MB3102namp_--