From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.6191.1614059067748516581 for ; Mon, 22 Feb 2021 21:44:33 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fanjianfeng@byosoft.com.cn) Received: from DESKTOP-M5NI163 ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 23 Feb 2021 13:44:15 +0800 X-WM-Sender: fanjianfeng@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: fanjianfeng@byosoft.com.cn Date: Tue, 23 Feb 2021 13:44:16 +0800 From: "Jeff Fan" To: "devel@edk2.groups.io" , =?UTF-8?B?TmksIFJheQ==?= , maurice.ma , "Patrick Rudolph" , =?UTF-8?B?RG9uZywgR3Vv?= , =?UTF-8?B?RG9uZywgRXJpYw==?= Cc: =?UTF-8?B?WW91LCBCZW5qYW1pbg==?= Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WA References: <20210215051308.11796-1-guo.dong@intel.com>, , , , , , <202102230850236136429@byosoft.com.cn>, , <2021022311423730957521@byosoft.com.cn>, X-Priority: 3 X-Has-Attach: no X-Mailer: Foxmail 7.2.20.269[cn] Mime-Version: 1.0 Message-ID: <2021022313441628039435@byosoft.com.cn> Content-Type: multipart/alternative; boundary="----=_001_NextPart127701326476_=----" ------=_001_NextPart127701326476_=---- Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 UmF5LA0KDQpCU1AncyBHRFQgdGFibGUgaXMgc2V0dXAgaW4gQ3B1RHhlIGFuZCB0aGVuIE1wSW5p dExpYiByZS11c2VzIEJTUCdzIEdEVCB0YWJsZSBmb3IgQVBzLg0KDQoxLCBVZWZpQ3B1UGtnXENw dUR4ZToNCiAgZ2R0ID0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9yeSBhYm92ZSA0R0IN Cj4gPiA+ID4gPiAtICAgIEF0dHJpYnVlICY9IH5FRklfUkVTT1VSQ0VfQVRUUklCVVRFX1RFU1RF RDsNCj4gPiA+ID4gPiAtICB9DQo+ID4gPiA+ID4gLQ0KPiA+ID4gPiA+ICAgIEJ1aWxkUmVzb3Vy Y2VEZXNjcmlwdG9ySG9iIChUeXBlLCBBdHRyaWJ1ZSwNCj4gPiA+ID4gPiAoRUZJX1BIWVNJQ0FM X0FERFJFU1MpQmFzZSwgU2l6ZSk7DQo+ID4gPiA+ID4gICAgREVCVUcgKChERUJVR19JTkZPICwg ImJ1aWxkaG9iOiBiYXNlID0gMHglbHgsIHNpemUgPSAweCVseCwNCj4gPiA+ID4gPiB0eXBlID0g MHgleFxuIiwgQmFzZSwgU2l6ZSwgVHlwZSkpOw0KPiA+ID4gPiA+DQo+ID4gPiA+ID4gLS0NCj4g PiA+ID4gPiAyLjE2LjIud2luZG93cy4xDQo+ID4gPiA+DQo+ID4gPiA+DQo+ID4gPiA+DQo+ID4g PiA+DQo+ID4gPiA+DQo+ID4gPiA+DQo+ID4gPg0KPiA+ID4NCj4gPiA+IA0KPiA+ID4NCj4gPg0K IA0KIA0KIA0KIA0KDQo= ------=_001_NextPart127701326476_=---- Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =20
Ray,

= BSP's GDT table is setup in CpuDxe and then MpInitLib re-uses BSP's = GDT table for APs.

1, UefiCpuPkg\CpuDxe:
  gdt =3D AllocateRuntimePoo= l (sizeof (GdtTemplate) + 8);
  ..... 
  gdtPtr.Base =3D (UINT32)(UINTN)(VOID*) gd= t;

2, UefiCpuPkg\Library\MpInitLib\MpLib.c:

  //

  // Get the BSP's data of GDT and IDT=

  //=

  AsmReadG= dtr ((IA32_DESCRIPTOR *) &ExchangeInfo->GdtrProfile);

  AsmReadIdtr= ((IA32_DESCRIPTOR *) &ExchangeInfo->IdtrProfile);

<= /div>

3, UefiCpuPkg\Library\MpInitLib\X64\MpFuncs.nasm:<= /div>
    mov        si, GdtrLocatio= n
o32 lgdt       [cs:si]

=
    mov        si, IdtrLocation
o32 lidt       [cs:si]

In CpuDxe, Typecasting gdt to UINT32 is one assumption= that GDT table is under 4G space.  Thus, we cannot use AllocateRuntimePool (), instead we should use&= nbsp;AllocatePages() to make sure GDT table under 4GB space.
  gdt =3D 0xFFF= FFFFF;
  Status =3D gBS->AllocatePages (
 =                 AllocateMaxAddress= ,
                  = EfiRuntimeServicesData,
           =       EFI_SIZE_TO_PAGES (sizeof (GdtTemplate) + 8),
                  &gdt&= nbsp;
                &nb= sp; );

Thanks,
Jeff
 
=
From: = ;Ni, Ray
Date: 2021-02-23 13:21<= /div>
Subject: Re: [edk2-devel] [PAT= CH] UefiPayloadPkg/UefiPayloadEntry: Remove 4GB memory WA
=

=E2=80=9CBut we could alloca= te room under 4G for GDT table directly in CpuDxe.=E2=80=9D

The GDT pre-allocated is re-= used by AP. Why do you suggest CpuDxe allocate GDT?

 

Thanks,

Ray

 

From: devel@edk2.groups.io <devel@edk2.gro= ups.io> On Behalf Of Jeff Fan
Sent: Tuesday, February 23, 2021 11:43 AM
To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Ma, Mau= rice <maurice.ma@intel.com>; Patrick Rudolph <patrick.rudolph@9ele= ments.com>; Dong, Guo <guo.dong@intel.com>; Dong, Eric <eric.do= ng@intel.com>
Cc: devel@edk2.groups.io; You, Benjamin <benjamin.you@intel.com&= gt;
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry: = Remove 4GB memory WA

 

Ray,

 

Yes. You are right. Acutally= , x64 IDT table cannot work correctly on protected mode. :-)

 

But for GDT location, I agre= e it should be located under 4G space to support AP mode changing.  Bu= t we could allocate room under 4G for GDT table directly in CpuDxe.

 

Thanks,

Jeff

 

 

From:<= /span> Ni, Ray

Date:<= /span> 2021-02-23 10:52

Subjec= t: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiP= ayloadEntry: Remove 4GB memory WA

Jeff,<= /p>

You are right that BSP= =E2=80=99s GDT and IDT tables are under 4G memory.

 =

It=E2=80=99s because whe= n AP wakes up, it needs the GDT for entering protected mode. AP cannot acce= ss above 4G memory without entering to long mode.

 =

I do agree that the 64bi= t IDT is not proper for AP when entering protected mode. As long as there i= s no exception in the short time frame (load 64bit IDT, before entering lon= g mode), it=E2=80=99s still ok.

 =

Thanks,

Ray

 =

From: fanjianfeng@byosoft.com.cn <fanjianfeng@byosoft.com.cn>
Sent: Tuesday, February 23, 2021 8:50 AM
To: devel <devel@edk2.groups.io>; Ma, Mau= rice <maurice.ma@intel.com>; Patrick Rudolph <= patrick.rudolph@9elements.com>; Dong, Guo <guo.dong@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@in= tel.com>
Cc: devel@edk2.groups.io; You, Benjamin <benjamin.you@intel.com>
Subject: Re: Re: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEnt= ry: Remove 4GB memory WA

 =

we will save the current BSP= 's GDT and IDT for APs at first time APs are waken by BSP as below. APs wil= l start from real mode to protected mode and then to long mode. During protected mode, BSP's GDT/IDT table are working on A= Ps.

 

In UefiCpuPkg\Library\MpInit= Lib\MpLib.c, 

  //

  // Get the BSP's data= of GDT and IDT

  //

  AsmReadGdtr ((IA32_DE= SCRIPTOR *) &ExchangeInfo->GdtrProfile);

  AsmReadIdtr ((IA32_DE= SCRIPTOR *) &ExchangeInfo->IdtrProfile);

 

It seems to be one bug we ha= ve assumption on GDT table and IDT table located under 4G memory space.

 

Could Ray&Eric help me t= o confirm it?

 

Jeff

 

Hi, Ray and Eric,

 

Is there any reason why the = GDT base was typecast to UINT32 in CpuDxe driver ? 

In x64 long mode, the GDT ba= se is actually 64bit.   Typecasting will zero out the high 32bit = address.

To me the correct code seems= to be something like:

gdtPtr.Base =3D (UINTN)(VOID= *) gdt;

 

Thanks

Maurice

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

> Sent: Monday, February = 22, 2021 7:43

> Cc: devel@edk2.= groups.io; Ma, Maurice <maurice.ma@intel.com>; You,

> Subject: Re: [edk2-deve= l] [PATCH] UefiPayloadPkg/UefiPayloadEntry:

> Remove 4GB memory WA

>

> Hi Guo,

> I tested on 078400ee15e= 7b250e4dfafd840c2e0c19835e16b and run it in

> QEMU.

> The problem seems to be= here, as gdt is allocated > 4GiB:

> gdtPtr.Base =3D (UINT32= )(UINTN)(VOID*) gdt;

>

> Regards,

> Patrick

>

> On Mon, Feb 22, 2021 at= 3:59 PM Dong, Guo <guo.dong@intel.com> wrote:

> >

> >

> > Hi Patrick,=

> > Please make sure y= ou are using latest master when testing this patch.

> > That issue should = be fix be this patch:<= /p>

> > UefiCpuPkg/CpuDxe:= Fix boot error (commit:

> > ebfe2d3eb5ac7fd92d= 74011edb31303a181920c7)

> > And there is simil= ar fix in another place as below:

> > UefiCpuPkg/MpInitL= ib: Fix a hang in above 4GB case (commit:

> > edd74ad3ad79b855f7= 6d9cf60a96c405cb3e863b)

> >

> > Thanks,

> > Guo

> >

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

> > > From: devel@edk2.= groups.io <devel@= edk2.groups.io> On Behalf Of

> > > Patrick Rudol= ph

> > > Sent: Monday,= February 22, 2021 7:04 AM

> > > To: devel@edk2.= groups.io; Ma, Maurice <maurice.ma@intel.com>

> > > Cc: Dong, Guo= <guo.dong@= intel.com>; You, Benjamin

> > > Subject: Re: = [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry:

> > > Remove 4GB me= mory WA

> > >

> > > This patch br= eaks booting on master.

> > > In CpuDxe.efi= / InitGlobalDescriptorTable as the GDT pointer is

> > > casted to 32b= its.

> > >

> > > Regards,

> > > Patrick

> > >

> > > On Fri, Feb 1= 9, 2021 at 3:12 AM Ma, Maurice <maurice.ma@intel.com>

> wrote:

> > > >

> > > > Reviewed= -by:  Maurice Ma <maurice.ma@intel.com>

> > > >

> > > > Regards<= /span>

> > > > Maurice<= /span>

> > > >

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

> > > > > Fro= m: Dong, Guo <guo.dong@intel.com><= span style=3D"color:black">

> > > > > Sen= t: Sunday, February 14, 2021 21:13<= /o:p>

> > > > > To: devel@edk2.= groups.io

> > > > > Cc:= Ma, Maurice <maurice.ma@intel.com>; You, Benjamin

> > > > > <= ;benjamin.= you@intel.com>

> > > > > Sub= ject: [edk2-devel] [PATCH] UefiPayloadPkg/UefiPayloadEntry:

> > > > > Rem= ove 4GB memory WA

> > > > >

> > > > > Pre= vious it would hang in CpuDxe if DXE drivers are dispatched above

> 4GB.

> > > > > Now= remove the work around since the fixed in CpuDxe are merged.

> > > > >

> > > > > ---=

> > > > >&nbs= p; UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 5 -----

> > > > >&nbs= p; 1 file changed, 5 deletions(-)

> > > > >

> > > > > dif= f --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c

> > > > > b/U= efiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c

> > > > > ind= ex 805f5448d9..c403b0a80a 100644

> > > > > ---= a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c

> > > > > +++= b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c

> > > > > @@ = -40,11 +40,6 @@ MemInfoCallback (

> > > > >&nbs= p;            &= nbsp; EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |

> > > > >&nbs= p;            &= nbsp; EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;

> > > > >

> > > > > -&n= bsp; if (Base >=3D BASE_4GB ) {<= /o:p>

> > > > > -&n= bsp;   // Remove tested attribute to avoid DXE core to dispatch d= river to

> > > > > mem= ory above 4GB

> > > > > -&n= bsp;   Attribue &=3D ~EFI_RESOURCE_ATTRIBUTE_TESTED;

> > > > > -&n= bsp; }

> > > > > -

> > > > >&nbs= p;   BuildResourceDescriptorHob (Type, Attribue,

> > > > > (EF= I_PHYSICAL_ADDRESS)Base, Size);

> > > > >&nbs= p;   DEBUG ((DEBUG_INFO , "buildhob: base =3D 0x%lx, size =3D 0x%= lx,

> > > > > typ= e =3D 0x%x\n", Base, Size, Type));<= /o:p>

> > > > >

> > > > > --<= /span>

> > > > > 2.1= 6.2.windows.1

> > > >

> > > >

> > > >

> > > >

> > > >

> > > >

> > >

> > >

> > >

> > >

> >

 

 

 

 

------=_001_NextPart127701326476_=------