[PATCH] UefiPayloadPkg: Align Attribute value with UPL spec


Ni, Ray
 

+ upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0

I am not python expert. Above statement might be interpreted as:
1. (upld_info.hdr.Attribute |= 1) if BuildTarget == "DEBUG" else 0
2. upld_info_hdr.Attribute |= (1 if BuildTarget == "DEBUG" else 0)

Are we sure that the #2 is chosen in by the python interpreter?


Ni, Ray
 

Reviewed-by: Ray Ni <ray.ni@...>

-----Original Message-----
From: Guo, Gua <gua.guo@...>
Sent: Monday, June 27, 2022 1:03 PM
To: Ni, Ray <ray.ni@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

Yes, #2 is chosen in by the python interpreter.

-----Original Message-----
From: Guo, Gua
Sent: Monday, June 27, 2022 12:07 PM
To: Ni, Ray <ray.ni@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

The python logic will like for below

upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0
=========>
if BuildTarget == "DEBUG":
upld_info_hdr.Attribute |= 1
else:
upld_info_hdr.Attribute |= 0
Thanks,
Gua

-----Original Message-----
From: Ni, Ray <ray.ni@...>
Sent: Monday, June 27, 2022 11:44 AM
To: Guo, Gua <gua.guo@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

+ upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0

I am not python expert. Above statement might be interpreted as:
1. (upld_info.hdr.Attribute |= 1) if BuildTarget == "DEBUG" else 0 2. upld_info_hdr.Attribute |= (1 if BuildTarget ==
"DEBUG" else 0)

Are we sure that the #2 is chosen in by the python interpreter?


gua.guo@...
 

From: Gua Guo <gua.guo@...>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3963

Based on UPL spec 2.12.2. Universal Payload Information Section,
it defines item "Attribute" on UPLD_INFO_HEADER for Debug build
should be "1", and Release build should be "0".

Currently, The value of item "Attribute" is always "0"

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: James Lu <james.lu@...>
Signed-off-by: Gua Guo <gua.guo@...>
---
UefiPayloadPkg/UniversalPayloadBuild.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py b/UefiPayloadPkg/Unive=
rsalPayloadBuild.py
index ab4c977ba5..6003de36d1 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -111,6 +111,7 @@ def BuildUniversalPayload(Args, MacroList):
#=0D
upld_info_hdr =3D UPLD_INFO_HEADER()=0D
upld_info_hdr.ImageId =3D Args.ImageId.encode()[:16]=0D
+ upld_info_hdr.Attribute |=3D 1 if BuildTarget =3D=3D "DEBUG" else 0=0D
fp =3D open(UpldInfoFile, 'wb')=0D
fp.write(bytearray(upld_info_hdr))=0D
fp.close()=0D
--=20
2.31.1.windows.1


Guo, Gua <gua.guo@...>
 

The python logic will like for below

upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0
=========>
if BuildTarget == "DEBUG":
upld_info_hdr.Attribute |= 1
else:
upld_info_hdr.Attribute |= 0
Thanks,
Gua

-----Original Message-----
From: Ni, Ray <ray.ni@...>
Sent: Monday, June 27, 2022 11:44 AM
To: Guo, Gua <gua.guo@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

+ upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0

I am not python expert. Above statement might be interpreted as:
1. (upld_info.hdr.Attribute |= 1) if BuildTarget == "DEBUG" else 0 2. upld_info_hdr.Attribute |= (1 if BuildTarget == "DEBUG" else 0)

Are we sure that the #2 is chosen in by the python interpreter?


Guo, Gua <gua.guo@...>
 

Yes, #2 is chosen in by the python interpreter.

-----Original Message-----
From: Guo, Gua
Sent: Monday, June 27, 2022 12:07 PM
To: Ni, Ray <ray.ni@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

The python logic will like for below

upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0
=========>
if BuildTarget == "DEBUG":
upld_info_hdr.Attribute |= 1
else:
upld_info_hdr.Attribute |= 0
Thanks,
Gua

-----Original Message-----
From: Ni, Ray <ray.ni@...>
Sent: Monday, June 27, 2022 11:44 AM
To: Guo, Gua <gua.guo@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

+ upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0

I am not python expert. Above statement might be interpreted as:
1. (upld_info.hdr.Attribute |= 1) if BuildTarget == "DEBUG" else 0 2. upld_info_hdr.Attribute |= (1 if BuildTarget == "DEBUG" else 0)

Are we sure that the #2 is chosen in by the python interpreter?


Guo, Gua <gua.guo@...>
 

@Ni, Ray

Below url is pull request link.  May I get your help to add push label ? Have any concern, please also share for me.

URL: https://github.com/tianocore/edk2/pull/3015

Thanks,
Gua

 

-----Original Message-----
From: Ni, Ray <ray.ni@...>
Sent: Monday, June 27, 2022 2:53 PM
To: Guo, Gua <gua.guo@...>; devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>
Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL spec

 

Reviewed-by: Ray Ni <ray.ni@...>

 

> -----Original Message-----

> From: Guo, Gua <gua.guo@...>

> Sent: Monday, June 27, 2022 1:03 PM

> To: Ni, Ray <ray.ni@...>; devel@edk2.groups.io

> Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>

> Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL

> spec

>

> Yes, #2 is chosen in by the python interpreter.

>

> -----Original Message-----

> From: Guo, Gua

> Sent: Monday, June 27, 2022 12:07 PM

> To: Ni, Ray <ray.ni@...>; devel@edk2.groups.io

> Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>

> Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL

> spec

>

> The python logic will like for below

>

> > upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0

> =========>

> > if BuildTarget == "DEBUG":

> >   upld_info_hdr.Attribute |= 1

> > else:

> >   upld_info_hdr.Attribute |= 0

>

> Thanks,

> Gua

>

> -----Original Message-----

> From: Ni, Ray <ray.ni@...>

> Sent: Monday, June 27, 2022 11:44 AM

> To: Guo, Gua <gua.guo@...>; devel@edk2.groups.io

> Cc: Dong, Guo <guo.dong@...>; Lu, James <james.lu@...>

> Subject: RE: [PATCH] UefiPayloadPkg: Align Attribute value with UPL

> spec

>

> > +    upld_info_hdr.Attribute |= 1 if BuildTarget == "DEBUG" else 0

>

>

> I am not python expert. Above statement might be interpreted as:

> 1. (upld_info.hdr.Attribute |= 1) if BuildTarget == "DEBUG" else 0 2.

> upld_info_hdr.Attribute |= (1 if BuildTarget == "DEBUG" else 0)

>

> Are we sure that the #2 is chosen in by the python interpreter?