From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.92.41.95]) by mx.groups.io with SMTP id smtpd.web11.34300.1599209037102219386 for ; Fri, 04 Sep 2020 01:43:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=QHP8/C8s; spf=pass (domain: hotmail.com, ip: 40.92.41.95, mailfrom: vanjeff_919@hotmail.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SUpv4jFxdQKvUhw/skRK+MgaPKSY4Xed1wfjvyOSpebhNfkkHAh4FWpDWHW9w3Tzq9Td/G1bM7fEKOkxgsferY9L3svUuCRaNMXf3Dbmojb0Rb2rSU5g9N/YbUp+e+XLgTmTmF6pnyMk9lwU39C1v2LXJ2PI+v2YYLe1jtisr4qSaiIKqtugSmkGP11bpBL7WjwiDPQFZkOSmHwDzWex0lGDfgFF1tYa/wZzX7biNkDKSFm6StMQPyTIf2Rgf39yyKIphouwM2wnKmF0h9p313K4e/kadoYjSel3p3kR/12rDu4IjKJXIK5EKATCdSgvKJKkS7AQxva6Z1ZDLLYq7g== 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=sYN5NYu0l8HUI9aiO3dKPta7pFdSeDHqWJpKoFBsySY=; b=diqGjAw7OKD8kNc2fPI82x5XbCj1WNFg852rYcBrcibsqzoTYG/uLCAaKZV8JKJD9G+qbnjZOcimvqzN2ZvqppGzQreanvcIQ7JFOUeIyFRrg/hfA6m4T+iuXMfNztjlio6mEROU+E59elVh8qdu/2MtJGtIhYgRqjinOVt3e3eZEc3VozH+hhf9S32RDTL14SDDHO8RsgJQ0cjonjwZTAKWYHsPkuGnA38dIi1YNpgNaEk7rygXT6t6EsWKyY4WAKuGnHeYAGOmC2U1s9NCNOvg9xPqXybuJEy8GBwzmhYLjmGiySsjR6xW+y538Hxp3Ohu7k58XJtQzTSc3lI6RQ== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sYN5NYu0l8HUI9aiO3dKPta7pFdSeDHqWJpKoFBsySY=; b=QHP8/C8sqU0/FmrOsUw8kEeJUVwr3hofTe7psvyDHnZ6u2plqNSSpLWBqkZ8I76csbGG9b2Ikjg0XZrFH4guWIAeFbzM2D38RYbHmzO/4P/hhhXUwnvgd82w0xwnxc//jE0895FrjeO0Jn7Sd2m0WbWRn82clo95vBer+QXLCqtX8VnYHEhOwUNTmhgWQh3aXY9XNMRZqUKQV2DvnzfmyRUqSUv1omn6q/vsx6AP3xjJVuUS8mKu620mBgLuee16I4MGgtIfflZ5DVe3XSA2EpUQ0i2JFA/DjZpk4SJRe31unbiPzC+6vPsZePuNix4vJ/Ri2XAsmeR/HSVstrsKTQ== Received: from DM6PR02CA0094.namprd02.prod.outlook.com (2603:10b6:5:1f4::35) by BYAPR21MB1239.namprd21.prod.outlook.com (2603:10b6:a03:102::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.0; Fri, 4 Sep 2020 08:43:54 +0000 Received: from DM6NAM10FT051.eop-nam10.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::b0) by DM6PR02CA0094.outlook.office365.com (2603:10b6:5:1f4::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16 via Frontend Transport; Fri, 4 Sep 2020 08:43:41 +0000 Received: from MWHPR19MB0030.namprd19.prod.outlook.com (2a01:111:e400:7e86::44) by DM6NAM10FT051.mail.protection.outlook.com (2a01:111:e400:7e86::88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16 via Frontend Transport; Fri, 4 Sep 2020 08:43:41 +0000 Received: from MWHPR19MB0030.namprd19.prod.outlook.com ([fe80::293e:af2:19ca:8470]) by MWHPR19MB0030.namprd19.prod.outlook.com ([fe80::293e:af2:19ca:8470%4]) with mapi id 15.20.3348.017; Fri, 4 Sep 2020 08:43:41 +0000 From: "Fan Jeff" To: "Yao, Jiewen" , "devel@edk2.groups.io" , Laszlo Ersek , "Dong, Eric" , "Ni, Ray" CC: "Lou, Yun" Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0ggdjJdIFVlZmlDcHVQa2cvTXBJbml0TGliOiBBZGQgY2hlY2sgZm9yIENSMy9HRFQvSURULg==?= Thread-Topic: =?gb2312?B?u9i4tDogW2VkazItZGV2ZWxdIFtQQVRDSCB2Ml0gVWVmaUNwdVBrZy9NcElu?= =?gb2312?Q?itLib:_Add_check_for_CR3/GDT/IDT.?= Thread-Index: AQHWggSPsVD1Ufr/O0iBw4kxtzfAtalXRPGAgAAPdICAAF6HgIAAB16AgAADd8+AAE+1AIAAAWOrgAARzwCAAAYRIg== Date: Fri, 4 Sep 2020 08:43:41 +0000 Message-ID: References: <20200903151147.1196-1-eric.dong@intel.com> <9c9d8289-4f8e-75d8-2816-750195a54842@redhat.com> , , In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:C46CD376622E9F17467B269039A44707C72CB3EFC9288C15499FCF7AECF69352;UpperCasedChecksum:4C0BDAEF15F0940536C7EAB6EC5615C1DFCBE90C6AAC5480FE58489E3050814A;SizeAsReceived:7841;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [1peGq8M0wvtNkkKUxnJonrt+fzMGh/ef] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 776ccb9f-21fb-46ab-08b1-08d850aea037 x-ms-traffictypediagnostic: BYAPR21MB1239: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: svgeAav2tW+QMMQY1rCYXoIJIvLcyEoYl0EEG6rpdFJB9XL5UT/+nqfT1xxMQACq6x29TaNqwRmxgeIv+sgPqin3ek2UcEqXAVdW10AZmszIkMnc7v4tUn65N2WLhw+BsQ/nUC4Jjpi0HgbnMYGgNd9DofvLgUkFv+jraaW//OWkV0dXLhydtA2lSy5Ib6VtmmDTthNmPL+TyMrWHimKoiKZXET5/JyTW9Ok4t3xk4JX/ihlRx7JI+o1pVbdP2xE x-ms-exchange-antispam-messagedata: o1niFgu0IqAFySSzJuT/yb7ukg7otJGOnv2f+q52lZN3Mu+xJ5Baw1oA+GecTbbn0dBy4EiCdVK+IIVueh82/NsiCjx8BzrWPs5vxXU8l915QY5bFm4vaTVYan++T895l8RK8ENVtXBbSowx0upayg== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-0-msonline-outlook-fb0b2.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT051.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 776ccb9f-21fb-46ab-08b1-08d850aea037 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2020 08:43:41.4548 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR21MB1239 X-Groupsio-MsgNum: 65047 Content-Language: zh-CN Content-Type: multipart/related; boundary="_004_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_"; type="multipart/alternative" --_004_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_ Content-Type: multipart/alternative; boundary="_000_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_" --_000_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 Smlld2VuLA0KDQpJIGRvbqGvdCB0aGluayBBUCBuZWVkIHRvIHZhbGlkYXRlIGV2ZXJ5dGluZy4g QlNQIHNob3VsZCBtYWtlIHN1cmUgQ1IzL0dEVC9JRFQgY29ycmVudGx5IGZpcnN0bHkuICBPdGhl cnNpemUsIGV2ZXJ5dGhpbmcgZG9lcyBub3QgbWFrZSBzZW5zZS4NCg0KRm9yIENSMyBjYXNlLCBp ZiB3ZSBhc3N1bWUgQ1IzIGFib3ZlIDRHQiBzcGFjZSBpcyBsZWdhbCBmb3IgQlNQIChJZiB0aGVy ZSBhcmUgYW55IGxpbWl0YXRpb24gb24gaXQsIHBsZWFzZSBjb3JyZW50IG1lKSBidXQgdGhlIGN1 cnJlbnQgQ1BVIEFQIHdha2V1cCBtZXRob2QgZG9lcyBub3QgYWxsb3cgQ1IzIGFib3ZlIDRHQiBz cGFjZSwgdGhpcyBtYXliZSB0aGUgQ1BVIGRyaXZlcqGvcyBidWcgb3IgaW1wbGVtZW50YXRpb24g bGltaXRhdGlvbi4NCg0KVGhlIGtleSBpcyB0aGF0IENSMyBhYm92ZSA0R0IgaXMgbGVnYWwgb3Ig bm90Lg0KSWYgd2UgdGhpbmsgdGhpcyBpcyBidWcsIHdlIG5lZWQgdG8gZW5oYW5jZSBDUFUgZHJp dmVyIHRvIGZpeCBpdC4NCklmIHdlIHRoaW5rIHRoaXMgaXMgb25lIGxpbWlhdGlvbiwgd2UgbmVl ZCB0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QmVjYXVzZSBvZiB0aGlzLCBpdCBpcyBPSyB0byBjYWxsIFZhbGlkQ1IzR2R0SWR0Q2hl Y2soKSBhcyB0aGUgdmVyeQ0KPj4gZmlyc3QgYWN0aW9uIGluIHRoZSBhYm92ZS1saXN0ZWQgRHhl TXBMaWIgZnVuY3Rpb25zLg0KPj4NCj4+IChBc3N1bWluZyB0aGUgcHJvdG9jb2wgbWVtYmVycyBh cmUgY2FsbGVkIGZyb20gYW4gQVAsIGFuZCBjb25zZXF1ZW50bHkNCj4+IHdlIGNoZWNrIENSMyAv IEdEVFIgLyBJRFRSIG9uIHRoZSBBUCAoYW5kIG5vdCBvbiB0aGUgQlNQKSwgdGhhdCdzIHRoZQ0K Pj4gKmNhbGxlcidzKiBmYXVsdCwgcGVyIHNwZWMhKQ0KPg0KPiBUaGlzIG1lYW5zIHdlIGNhbiBt b3ZlIHRoZSBWYWxpZENyM0dkdElkdENoZWNrKCkgZnVuY3Rpb24gdG8NCj4gIkR4ZU1wTGliLmMi LCBhbmQgaXQgaXMgbm90IG5lY2Vzc2FyeSB0byBtb2RpZnkgIk1wTGliLmgiLg0KPg0KPiBUaGFu a3MNCj4gTGFzemxvDQo+ID4NCg0KDQoNCg== --_000_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

Jiewen,

 

I don=A1=AFt think AP need to = validate everyting. BSP should make sure CR3/GDT/IDT corrently firstly.&nbs= p; Othersize, everything does not make sense.

 

For CR3 case, if we assume CR3= above 4GB space is legal for BSP (If there are any limitation on it, pleas= e corrent me) but the current CPU AP wakeup method does not allow CR3 above= 4GB space, this maybe the CPU driver=A1=AFs bug or implementation limitation.

 

The key is that CR3 above 4GB = is legal or not.

If we think this is bug, we ne= ed to enhance CPU driver to fix it.

If we think this is one limiat= ion, we need to validate the CR3 value and tell the caller.

 

Jeff

 

=B7=A2=BC=FE= =C8=CB: Yao, Jiew= en
=B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA9=D4=C24=C8=D5 16:07
=CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; vanjeff_919@hotmail.com; Laszlo Ersek; Dong, Eric; <= a href=3D"mailto:ray.ni@intel.com"> Ni, Ray
=B3=AD=CB=CD: Lou, Yun
=D6=F7=CC=E2: RE: =BB=D8=B8=B4: [edk2-devel] [PATCH v2] Ue= fiCpuPkg/MpInitLib: Add check for CR3/GDT/IDT.

 

When we say =A1=B0validate=A1=B1, w= e need get clear on what is the contract between caller and callee, and wha= t is the expectation of the validation.

 

For example, in this case, the vali= dation is limited to 4G or not 4G. Why?

This function does not verify follo= wing, why?

  1. if the GDT table is valid.
  2. if the IDT table is valid
  3. if the exception handler is valid<= o:p>
  4. if the timer handler still work= s
  5. if the page table is valid
  6. if the page table is 1:1 mapping<= o:p>
  7. if the page table still enforce= the expected protection, such as RO, NX
  8. =A1=AD=A1=AD

 

If an application creates a crazy s= tate, CpuDxe may pass the validation with below 4G page table, but still fa= il to wake up APs.

 

If it is the app=A1=AFs responsibil= ity to ensure the system in good state, the validation is unnecessary.=

If it is the CpuDxe=A1=AFs responsi= bility to ensure the system in good state, the validation is insufficient.<= o:p>

 

I think we should wait. I am workin= g with Eric to collect the requirement on why test case is designed in this= way.

 

DebugAgentDxe is a good case. It is= for debug purpose.

I believe there must be contract be= tween CPU driver and DebugAgentDxe that which status DebugAgentDxe may modi= fy and which state DebugAgentDxe may not.

It is DebugAgentDxe=A1=AFs responsi= bility to ensure the new system state is correct and compatible with the CP= U driver.

With the contract, I don=A1=AFt thi= nk CPU driver need validate the system state changed by DebugAgentDxe.=

If DebugAgentDxe put system in a wr= ong state, CPUDriver has no chance to run.

 

 

 

 

From: devel@edk2.groups.io <devel@ed= k2.groups.io> On Behalf Of Fan Jeff
Sent: Friday, September 4, 2020 3:32 PM
To: Laszlo Ersek <lersek@redhat.com>; devel@edk2.groups.io; D= ong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
Cc: Lou, Yun <yun.lou@intel.com>
Subject:
=BB=D8=B8=B4: =BB=D8=B8=B4: [edk2-devel] [PATCH v2] UefiCpuPkg/MpInitLib: Add che= ck for CR3/GDT/IDT.

 

Laszlo,

 

Why sync the BSP=A1=AF<= span lang=3D"EN-US">s CR3/GDT/IDT values for AP when AP wakes up instead of= using old cached BSP=A1=AFs CR3/GDT/IDT values= when CPU driver initiallly dispatched is that we CANNOT assume original values are still valid during POST phase.

 

On this senario, BSP=A1= = =AFs CR3/GDT/IDT are just like input parameters for o= ne function. Validating them are necessary.

 

For example, DebugAgentDxe dri= ver may be loaded in UEFI shell to setup source level debugging enviroment = of EDKII debugger tools.  It may setup new IDT space.

 

Jeff

 

=B7=A2=BC=FE=C8=CB: = Laszlo Ersek<= /a>
=B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA9=D4=C24=C8=D5 14:58
=CA=D5=BC=FE=C8=CB:
Fan Jeff; devel@edk2.groups.io; eric.dong@intel.com; Ni, Ray =B3=AD=CB=CD: Lou, Yun
=D6=F7=CC=E2: Re: =BB=D8=B8=B4: [edk2-devel] [PATCH v2] Ue= fiCpuPkg/MpInitLib: Add check for CR3/GDT/IDT.

 

On 09/04/20 04:18, Fan Jeff wrote:
> Laszlo & Eric,
>
> Introducing one new PCD to handle such rare test case is too heavy. I= think We could do validating CR3/GDT/IDT space < 4GB address always in = MpInitLib.

I disagree.

What the UEFI application does (interfere with GDT / IDT / CR3
placement) is invalid. It changes system properties under the feet of
platform DXE drivers. UEFI applications are supposed to be written
against public protocols and services in the UEFI spec (and maybe in the PI spec).

If this application is a test application that purposely massages
low-level system properties, that's fine; but then, if we change core
edk2 components to be somewhat compatible with this application, then we should make sure that platforms that do not care about this specific use case do not suffer a performance hit or a code complexity hit.

What I could accept, under your proposal, is the following: add three
ASSERT()s to FillExchangeInfoData(), where we fetch the IDTR / GDTR /
CR3 anyway. This would be fine because it only expresses existing
assumptions / requirements.

However, my understanding is that this would not solve Eric's problem.
The system would hang -- in DEBUG / NOOPT builds -- or crash -- in a
RELEASE build -- just the same as before.

Now, *if* FillExchangeInfoData() is currently *wrong* to have these
32-bit assumptions, because edk2 modules themselves can break those
assumptions (without the custom UEFI application), then we have a more
serious problem. But for that problem, just "checking and rejecting&q= uot; is
not a sufficient solution, regardless of how and where we check and reject= .

Thanks
Laszlo




>
> Jeff
>
>
=B7=A2=BC=FE=C8=CB: Dong, Eric<mailto:eric.don= g@intel.com>
>
=B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA9=D4=C24=C8=D5 10:01
>
=CA=D5=BC=FE=C8=CB: Ni, Ray<mailto:ray.ni@intel.com>; deve= l@edk2.groups.io<mailto:devel@edk2.groups.io>; lersek@redhat.com&= lt;mailto:lersek@redhat.com>
>
=B3=AD=CB=CD: Lou, Yun<mailto:yun.lou@intel.com>
>
=D6=F7=CC=E2: Re: [edk2-devel] [PATCH v2] UefiCpuPkg/MpInitLib: Add check for CR3/G= DT/IDT.
>
> I guess Laszlo think this check is not always needed, just used for t= his special shell application case. He wants to use default FALSE to always= ignore this check and make code logic clear.
>
> Thanks,
> Eric
>
> From: Ni, Ray <ray.ni@intel.co= m>
> Sent: Friday, September 4, 2020 9:34 AM
> To: devel@edk2.groups.io;= lersek@redhat.com; Dong, Eric <eric.dong@intel.com>
> Cc: Lou, Yun <yun.lou@intel.c= om>
> Subject: Re: [edk2-devel] [PATCH v2] UefiCpuPkg/MpInitLib: Add check = for CR3/GDT/IDT.
>
> Why do we need a new PCD to control such check? Under what circumstan= ce the PCD is false?
> We may need to move such check out of MpLib.c. Because when bps runs = at 32bit mode, AP doesn
=A1=AFt need to switch t= o long mode, such check is not needed and also always passes.
>
> We should not assume PEI runs at 32 bit mode.
>
>
>
=B7=A2=BC=FE=C8=CB: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.grou= ps.io<mailto:devel@edk2.groups.io>> =B4=FA=B1=ED Laszlo Ersek <lersek@redhat.com<mailto= :lersek@redhat.com>>
>
=B7=A2=CB=CD=CA=B1=BC=E4: Friday, Septemb= er 4, 2020 3:55:47 AM
>
=CA=D5=BC=FE=C8=CB: Dong, Eric <eric.dong@int= el.com<mailto:eric.dong@intel.com>>; deve= l@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io= <mailto:devel@edk2.groups.io>>
>
=B3=AD=CB=CD: Ni, Ray <ray.ni@intel.com<mailto:r= ay.ni@intel.com>>
>
=D6=F7=CC=E2: Re: [edk2-devel] [PATCH v2]= UefiCpuPkg/MpInitLib: Add check for CR3/GDT/IDT.
>
> On 09/03/20 21:00, Laszlo Ersek wrote:
>
>> (10) More importantly, ValidCR3GdtIdtCheck() should not be called= in the
>> Worker functions for StartupAllAPs, StartupThisAP, SwitchBSP, and=
>> EnableDisableAP, in "UefiCpuPkg/Library/MpInitLib/MpLib.c&qu= ot;.
>>
>> Instead, the calls should be made in the DXE instance of the libr= ary
>> ("UefiCpuPkg/Library/MpInitLib/DxeMpLib.c"), at the ver= y top of the
>> functions:
>>
>> - MpInitLibStartupAllAPs
>> - MpInitLibStartupThisAP
>> - MpInitLibSwitchBSP
>> - MpInitLibEnableDisableAP
>>
>> Here's why:
>>
>> (a) The symptom does not affect the PEI phase -- by the time the = UEFI
>> application is executed, the PEI phase has ended; there's no need= to
>> modify the PEI instance of the library.
>>
>> (b) The currently proposed failure exits are too late. For exampl= e, in
>> the SwitchBSPWorker() function, by the time we exit, we have call= ed
>> DisableApicTimerInterrupt(), SaveAndDisableInterrupts(), and
>> DisableLvtInterrupts() -- and the error path does not restore the=
>> original environment.
>>
>> (c) According to the PI spec (v1.7), the StartupAllAPs(),
>> StartupThisAP(), SwitchBSP(), EnableDisableAP() member functions = of
>> EFI_MP_SERVICES_PROTOCOL may only be called on the (current) BSP.=
>> Because of this, it is OK to call ValidCR3GdtIdtCheck() as the ve= ry
>> first action in the above-listed DxeMpLib functions.
>>
>> (Assuming the protocol members are called from an AP, and consequ= ently
>> we check CR3 / GDTR / IDTR on the AP (and not on the BSP), that's= the
>> *caller's* fault, per spec!)
>
> This means we can move the ValidCr3GdtIdtCheck() function to
> "DxeMpLib.c", and it is not necessary to modify "MpLib= .h".
>
> Thanks
> Laszlo
> >

 

 

--_000_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_-- --_004_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_ Content-Type: image/png; name="154E6E9E578E47869D1F0A70DF84BCF0.png" Content-Description: 154E6E9E578E47869D1F0A70DF84BCF0.png Content-Disposition: inline; filename="154E6E9E578E47869D1F0A70DF84BCF0.png"; size=144; creation-date="Fri, 04 Sep 2020 08:43:40 GMT"; modification-date="Fri, 04 Sep 2020 08:43:40 GMT" Content-ID: Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAsQAAAACCAYAAABfe8oDAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAlSURBVFhH7cMBDQAACAMg+5cygQkeRoMIGwUA AK/1ZFVV9efsAW0/ZqCCeHKlAAAAAElFTkSuQmCC --_004_MWHPR19MB003023A788ADAEAE2D616D29D72D0MWHPR19MB0030namp_--