From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by mx.groups.io with SMTP id smtpd.web10.56431.1600074005584672183 for ; Mon, 14 Sep 2020 02:00:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@9elements.com header.s=google header.b=CwEkwTs/; spf=pass (domain: 9elements.com, ip: 209.85.217.67, mailfrom: marcello.bauer@9elements.com) Received: by mail-vs1-f67.google.com with SMTP id j6so8248769vsg.8 for ; Mon, 14 Sep 2020 02:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fz9y9MZJ5VstGlDMrhW4Of7aH/BYTccGij1AJH4ciTU=; b=CwEkwTs/AzR0Xtm7+3ieyrcUx98giIvfaI/Ng1aeqveKCU6j7kqLaH7aZFM84ruL+g 6mJt6GpT7GFeYC7zxGL8jcr/rWfhDfaLHeg7MB53y9Er7E1wJLasVX+pw1yKfiA8ifWx LOt77E8So9gx2FYXGGR7pYwN3/Q+bNpGler8AkMPnSnhFZ4Iyh0iVoj7s8ZHjkljgjdY vvGBwLfzH9IjWj7eHLFismiXhl6NwYgiDiBZfEAYohr6RGo1by6g/5erlDm28Y90Rv6/ jqCtr/+S42c4jN4MC4+h8pg4P41xQt3UAuzfrRgHFX4HodfkWWdg2p8PWKqghpgkgoOw OzgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fz9y9MZJ5VstGlDMrhW4Of7aH/BYTccGij1AJH4ciTU=; b=UfCyuztR4ASjgQB8iJ5rqsyT18s1rC2v+XJRzgIhWviDSN0fAmVbDyYCuCModcrSH0 lToeZHeIWRkT0jbMoUPIn91NeQgEDRnVIrHScYS1J09vwdcBurzWiM9sLS8HirzCkGuV JMK/5+flbdzjYIFXPptx2Co0zZyXmX7ErPtUCZV35ZyiTz8MIilhPE2vM3W3IbuRjpNp zVezGdHeHiPtWp7wwRbt1bMy2LCrcB+Mww7UKCXV01gtQGpDT2/I4vaDyq3mISDR4+wY tYvVX3Yb3tUIqYjQi/26ld1JLZ1/K2rr03om1nGzTprFRC7BNvK+TAHl1tis5mYtx4VS 0LiA== X-Gm-Message-State: AOAM5315WrawVcMk/fhjRAJKG/lCtYRCip6Kx4Ia1zLgK/ujYG00OnNl Z8dVt44xj39uSoTqCm4tBUYzl9JaG0QZU7+UeE1uUg== X-Google-Smtp-Source: ABdhPJzI7T5DOVGHTWbX+XZYpE+OMkiqPOaIO07C6uZ1ekW8Mpr7phLAkZsXTyRDdcNmVMgF59qjeEKMVVmpEcXzTSg= X-Received: by 2002:a05:6102:2:: with SMTP id j2mr6788393vsp.32.1600074004656; Mon, 14 Sep 2020 02:00:04 -0700 (PDT) MIME-Version: 1.0 References: <20200708120125.24344-1-marcello.bauer@9elements.com> <20200708120125.24344-2-marcello.bauer@9elements.com> In-Reply-To: From: "Marcello Sylvester Bauer" Date: Mon, 14 Sep 2020 10:59:53 +0200 Message-ID: Subject: Re: [edk2-devel] [PATCH v1 1/1] UefipayloadPkg: Protect coreboot tables To: "Dong, Guo" Cc: "devel@edk2.groups.io" , "Ma, Maurice" , "Desimone, Nathaniel L" , "Zeng, Star" Content-Type: multipart/alternative; boundary="000000000000a98c6405af42427e" --000000000000a98c6405af42427e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Guo, Sounds like a good proposal, but it would be great to merge this change temporarily. In some cases of the current implementation edk2 does override the memory area, where the coreboot table pointer is located. Therefore the kernel and cbmem tool is not able to locate the tables anymore. Thanks, Marcello On Tue, Sep 8, 2020 at 11:40 PM Dong, Guo wrote: > > Hi Marcello, > > In the UEFI payload, we should not hardcoded any memory usage. It means > UEFI payload should use the memory map whatever reported from the > bootloader. I plan to remove this hardcoded memory usage soon. > Before that, it is OK for me to merge this change if you want. > BTW, did you see any issue with current implement? > > Thanks, > Guo > > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Marcello > > Sylvester Bauer > > Sent: Wednesday, July 8, 2020 5:01 AM > > To: devel@edk2.groups.io > > Cc: Ma, Maurice ; Desimone, Nathaniel L > > ; Zeng, Star > > Subject: [edk2-devel] [PATCH v1 1/1] UefipayloadPkg: Protect coreboot > tables > > > > From: Patrick Rudolph > > > > Signed-off-by: Patrick Rudolph > > Signed-off-by: Marcello Sylvester Bauer > > Cc: Maurice Ma > > Cc: Nate DeSimone > > Cc: Star Zeng > > --- > > UefiPayloadPkg/BlSupportPei/BlSupportPei.c | 26 ++++++++++++++------ > > 1 file changed, 19 insertions(+), 7 deletions(-) > > > > diff --git a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c > > b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c > > index 22972453117a..b3ff065a537e 100644 > > --- a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c > > +++ b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c > > @@ -390,24 +390,36 @@ BlPeiEntryPoint ( > > EFI_PEI_GRAPHICS_DEVICE_INFO_HOB GfxDeviceInfo; > > > > EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *NewGfxDeviceInfo; > > > > > > > > - > > > > - // > > > > - // Report lower 640KB of RAM. Attribute EFI_RESOURCE_ATTRIBUTE_TESTE= D > > > > - // is intentionally omitted to prevent erasing of the coreboot heade= r > > > > - // record before it is processed by ParseMemoryInfo. > > > > + // Report lower 640KB of RAM. > > > > + // Mark memory as reserved to keep coreboot header in place. > > > > // > > > > BuildResourceDescriptorHob ( > > > > - EFI_RESOURCE_SYSTEM_MEMORY, > > > > + EFI_RESOURCE_MEMORY_RESERVED, > > > > ( > > > > EFI_RESOURCE_ATTRIBUTE_PRESENT | > > > > EFI_RESOURCE_ATTRIBUTE_INITIALIZED | > > > > + EFI_RESOURCE_ATTRIBUTE_TESTED | > > > > EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | > > > > EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | > > > > EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | > > > > EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE > > > > ), > > > > (EFI_PHYSICAL_ADDRESS)(0), > > > > - (UINT64)(0xA0000) > > > > + (UINT64)(0x1000) > > > > + ); > > > > + > > > > + BuildResourceDescriptorHob ( > > > > + EFI_RESOURCE_SYSTEM_MEMORY, > > > > + ( > > > > + EFI_RESOURCE_ATTRIBUTE_PRESENT | > > > > + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | > > > > + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | > > > > + EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | > > > > + EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | > > > > + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE > > > > + ), > > > > + (EFI_PHYSICAL_ADDRESS)(0x1000), > > > > + (UINT64)(0x9F000) > > > > ); > > > > > > > > BuildResourceDescriptorHob ( > > > > -- > > 2.27.0 > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > Groups.io Links: You receive all messages sent to this group. > > > > View/Reply Online (#62229): https://edk2.groups.io/g/devel/message/6222= 9 > > Mute This Topic: https://groups.io/mt/75374752/1781375 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com] > > -=3D-=3D-=3D-=3D-=3D-=3D > > --=20 *[Marcello Sylvester Bauer]* 9elements Agency GmbH, Kortumstra=C3=9Fe 19-21, 44787 Bochum, Germany Email: [DEINE EMAIL ADDRESSE] Phone: *+49 234 68 94 188 <+492346894188>* Mobile: *+49 1722847618 <+491722847618>* Sitz der Gesellschaft: Bochum Handelsregister: Amtsgericht Bochum, HRB 17519 Gesch=C3=A4ftsf=C3=BChrung: Sebastian Deutsch, Eray Basar Datenschutzhinweise nach Art. 13 DSGVO --000000000000a98c6405af42427e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Guo,

Sounds like a good proposal, but it would b= e great to merge this change temporarily.
In some cases of the current = implementation edk2 does override the memory area, where the coreboot table= pointer is located.
Therefore the kernel and cbmem tool is not able to = locate the tables anymore.

Thanks,
Marcello

On Tue, Sep 8, 2= 020 at 11:40 PM Dong, Guo <guo.don= g@intel.com> wrote:

Hi Marcello,

In the UEFI payload, we should not hardcoded any memory usage. It means UEF= I payload should use the memory map whatever reported from the bootloader. = I plan to remove this hardcoded memory usage soon.
Before that, it is OK for me to merge this change if you want.
BTW, did you see any issue with current implement?

Thanks,
Guo

> -----Original Message-----
> From: devel@= edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marcello
> Sylvester Bauer
> Sent: Wednesday, July 8, 2020 5:01 AM
> To: devel@ed= k2.groups.io
> Cc: Ma, Maurice <maurice.ma@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [edk2-devel] [PATCH v1 1/1] UefipayloadPkg: Protect coreboot = tables
>
> From: Patrick Rudolph <patrick.rudolph@9elements.com>
>
> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
> Signed-off-by: Marcello Sylvester Bauer <marcello.bauer@9elements.com>= ;
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> ---
>=C2=A0 UefiPayloadPkg/BlSupportPei/BlSupportPei.c | 26 ++++++++++++++--= ----
>=C2=A0 1 file changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> index 22972453117a..b3ff065a537e 100644
> --- a/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> +++ b/UefiPayloadPkg/BlSupportPei/BlSupportPei.c
> @@ -390,24 +390,36 @@ BlPeiEntryPoint (
>=C2=A0 =C2=A0 EFI_PEI_GRAPHICS_DEVICE_INFO_HOB GfxDeviceInfo;
>
>=C2=A0 =C2=A0 EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *NewGfxDeviceInfo;
>
>
>
> -
>
> -=C2=A0 //
>
> -=C2=A0 // Report lower 640KB of RAM. Attribute EFI_RESOURCE_ATTRIBUTE= _TESTED
>
> -=C2=A0 // is intentionally omitted to prevent erasing of the coreboot= header
>
> -=C2=A0 // record before it is processed by ParseMemoryInfo.
>
> +=C2=A0 // Report lower 640KB of RAM.
>
> +=C2=A0 // Mark memory as reserved to keep coreboot header in place. >
>=C2=A0 =C2=A0 //
>
>=C2=A0 =C2=A0 BuildResourceDescriptorHob (
>
> -=C2=A0 =C2=A0 EFI_RESOURCE_SYSTEM_MEMORY,
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_MEMORY_RESERVED,
>
>=C2=A0 =C2=A0 =C2=A0 (
>
>=C2=A0 =C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_PRESENT |
>
>=C2=A0 =C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_TESTED |
>
>=C2=A0 =C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
>
>=C2=A0 =C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
>
>=C2=A0 =C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | >
>=C2=A0 =C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
>
>=C2=A0 =C2=A0 =C2=A0 ),
>
>=C2=A0 =C2=A0 =C2=A0 (EFI_PHYSICAL_ADDRESS)(0),
>
> -=C2=A0 =C2=A0 (UINT64)(0xA0000)
>
> +=C2=A0 =C2=A0 (UINT64)(0x1000)
>
> +=C2=A0 =C2=A0 );
>
> +
>
> +=C2=A0 BuildResourceDescriptorHob (
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_SYSTEM_MEMORY,
>
> +=C2=A0 =C2=A0 (
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_PRESENT |
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
>
> +=C2=A0 =C2=A0 EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
>
> +=C2=A0 =C2=A0 ),
>
> +=C2=A0 =C2=A0 (EFI_PHYSICAL_ADDRESS)(0x1000),
>
> +=C2=A0 =C2=A0 (UINT64)(0x9F000)
>
>=C2=A0 =C2=A0 =C2=A0 );
>
>
>
>=C2=A0 =C2=A0 BuildResourceDescriptorHob (
>
> --
> 2.27.0
>
>
> -=3D-=3D-=3D-=3D-=3D-=3D
> Groups.io Links: You receive all messages sent to this group.
>
> View/Reply Online (#62229): https://edk2.groups.io/= g/devel/message/62229
> Mute This Topic: https://groups.io/mt/75374752/1781375=
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub=C2=A0= [guo.dong@intel.co= m]
> -=3D-=3D-=3D-=3D-=3D-=3D



--
=
[= Marcello Sylvester Bauer]=C2=A0



9elements= Agency GmbH, Kortumstra=C3=9Fe 19-21, 44787 Bochum, Germany<= /div>
Email:=C2=A0=C2=A0[DEINE EMAIL ADDRESSE]
= Phone:=C2=A0=C2=A0+49 234 68 94 188
Mobile:=C2=A0=C2=A0+49 1722847618

Sitz= der Gesellschaft: Bochum
Handelsregister: Amtsgericht Bochum, HRB 17519
Gesch=C3=A4ftsf=C3=BChrung: Sebastian Deutsch, E= ray Basar
--000000000000a98c6405af42427e--