From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6D46F211CF36A for ; Tue, 5 Mar 2019 09:25:32 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2019 09:25:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,444,1544515200"; d="scan'208";a="149486125" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 05 Mar 2019 09:25:31 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 5 Mar 2019 09:25:28 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 5 Mar 2019 09:25:28 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.163]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.74]) with mapi id 14.03.0415.000; Wed, 6 Mar 2019 01:25:27 +0800 From: "Yao, Jiewen" To: "Vanguput, Narendra K" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] UefiCpuPkg\PiSmmCpuDxeSmm: Save and restore CR2 only on-demand paging in SMM BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1593 For every SMI occurrence, save and restore CR2 register only when SMM on-demand paging support is enabl Thread-Index: AQHU03dTWnvxmqlGvEa2vvBAzAKLN6X9SMFg Date: Tue, 5 Mar 2019 17:25:26 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F550FCE@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzc1MGU2ZDktNjIyOS00ZjA5LTlkYTgtMzg3OGI2MGIwOWM1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibTNnWFpjZUZ2U2g4VDg4QStUZWVYa0d2M08zQWZETnZPSHQzTTY5NCtFbDFHcHREdkdMalBtTytnd0FPUEgySiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] UefiCpuPkg\PiSmmCpuDxeSmm: Save and restore CR2 only on-demand paging in SMM BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1593 For every SMI occurrence, save and restore CR2 register only when SMM on-demand paging support is enabl X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2019 17:25:32 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hey Thanks for the patch. Would you please follow the EDKII patch format? Please refer to https://github.com/tianocore/tianocore.github.io/wiki/EDK-I= I-Development-Process And https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Fo= rmat Thank you Yao Jiewen > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > nkvangup > Sent: Tuesday, March 5, 2019 9:17 AM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH] UefiCpuPkg\PiSmmCpuDxeSmm: Save and restore > CR2 only on-demand paging in SMM BZ: > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1593 For every SMI > occurrence, save and restore CR2 register only when SMM on-demand > paging support is enable... >=20 > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) >=20 > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > index 3b0b3b52ac..5be4a2b020 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -1111,10 +1111,12 @@ SmiRendezvous ( >=20 > ASSERT(CpuIndex < mMaxNumberOfCpus); >=20 > - // > - // Save Cr2 because Page Fault exception in SMM may override its value > - // > - Cr2 =3D AsmReadCr2 (); > + if ((sizeof (UINTN) =3D=3D sizeof (UINT64)) && (!PcdGetBool > (PcdCpuSmmStaticPageTable))) { > + // > + // Save Cr2 because Page Fault exception in SMM may override its > value > + // > + Cr2 =3D AsmReadCr2 (); > + } >=20 > // > // Perform CPU specific entry hooks > @@ -1253,10 +1255,12 @@ SmiRendezvous ( >=20 > Exit: > SmmCpuFeaturesRendezvousExit (CpuIndex); > - // > - // Restore Cr2 > - // > - AsmWriteCr2 (Cr2); > + if ((sizeof (UINTN) =3D=3D sizeof (UINT64)) && (!PcdGetBool > (PcdCpuSmmStaticPageTable))) { > + // > + // Restore Cr2 > + // > + AsmWriteCr2 (Cr2); > + } > } >=20 > /** > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel