From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 AC67321163DFE for ; Tue, 9 Oct 2018 01:27:01 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2018 01:27:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,359,1534834800"; d="scan'208";a="264096051" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.11]) ([10.239.9.11]) by orsmga005.jf.intel.com with ESMTP; 09 Oct 2018 01:25:09 -0700 To: Laszlo Ersek , "Dong, Eric" , "edk2-devel@lists.01.org" References: <20181009015118.13856-1-eric.dong@intel.com> <06befab9-cbd6-59ab-c85e-deab4002824c@Intel.com> From: "Ni, Ruiyu" Message-ID: <062a4679-e3bf-28f1-31ba-83a124abb655@Intel.com> Date: Tue, 9 Oct 2018 16:26:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Subject: Re: [Patch] UefiCpuPkg/S3Resume2Pei: disable paging before creating new page table. 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, 09 Oct 2018 08:27:01 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 10/9/2018 4:09 PM, Laszlo Ersek wrote: >> >> Two comments: >> 1. We'd better not map the PcdCpuStackGuard to paging-enable. Maybe some >> other feature also enables the paging in PEI phase but the >> PcdCpuStackGuard is FALSE. > > I think I agree. > >> 2. When PEI is in 64bit mode, disabling paging may not work because >> paging-enable is a must in 64bit mode. > > I think this case is academic. S3Resume2Pei does not support 64-bit PEI > with SMM enabled. This is why we have commit 5133d1f1d297 ("OvmfPkg: > replace README fine print about X64 SMM S3 with PlatformPei check", > 2015-11-30) in OVMF. I found that commit. I just checked S3Resume2Pei module. It does assumes it's running in 32bit mode. And CpuS3.c also assumes S3Resume2Pei is running in 32bit mode. > > Anyway, I'm making this comment in the general sense only. I'm not > suggesting that we disable paging unconditionally. Actually, I believe, > I will suggest (under the v3 posting) restricting the write to CR0 even > more. Why? > > Thanks! > Laszlo > >> >>>>         AsmWriteCr3 ((UINTN)SmmS3ResumeState->SmmS3Cr3); >>>> >>>>         // >>>> diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf >>>> b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf >>>> index 6ce1bf944c..0f131d19df 100644 >>>> --- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf >>>> +++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf >>>> @@ -90,6 +90,7 @@ >>>>   [Pcd] >>>>     gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable  ## >>>> SOMETIMES_CONSUMES >>>> >>>> gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrM >>>> ask    ## CONSUMES >>>> + >>>> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard                       ## >>>> CONSUMES >>>> >>>>   [Depex] >>>>     TRUE >>>> -- >>>> 2.15.0.windows.1 >>>> >>>> _______________________________________________ >>>> edk2-devel mailing list >>>> edk2-devel@lists.01.org >>>> https://lists.01.org/mailman/listinfo/edk2-devel >> >> > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > -- Thanks, Ray