From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (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 9596E210F48D4 for ; Tue, 21 Aug 2018 07:28:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E9A88068B0B; Tue, 21 Aug 2018 14:28:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-71.rdu2.redhat.com [10.10.121.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F41F94656; Tue, 21 Aug 2018 14:28:09 +0000 (UTC) To: Jian J Wang , edk2-devel@lists.01.org References: <20180821030515.10156-1-jian.j.wang@intel.com> From: Laszlo Ersek Message-ID: Date: Tue, 21 Aug 2018 16:28:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180821030515.10156-1-jian.j.wang@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 21 Aug 2018 14:28:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 21 Aug 2018 14:28:10 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: Re: [PATCH v2 0/4] Support non-stop mode in heap guard and null detection 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, 21 Aug 2018 14:28:11 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/21/18 05:05, Jian J Wang wrote: >> v2 changes: >> fix GCC build error > > Background: > Heap Guard and NULL Pointer Detection are very useful features to detect > code flaw in EDK II. If an issue is detected, #PF exception will be > triggered and the BIOS will enter into dead loop, which is the default > behavior of exception handling. From QA perspective, this default behavior > will block them to collect all tests result in reasonable time. > > Solution: > This patch series update CpuDxe, PiSmmCpuDxeSmm and CpuExceptionHandlerLib > to allow the code to continue execution after #PF. The mechanism behind it > is the same as SMM Profile feature, in which a special #PF handler is > registered to set the page causing #PF to be 'present' and setup single > steop trap, then return the control back to the instruction accessing that > page. Once the instruction is re-executed, a #DB is triggered and a special > handler for it will be called to reset the page back to 'not-present'. > > Usage: > The non-stop mode is enabled/disabled by BIT6 of following PCDs > > gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask > gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask > > The default setting is 'disable'. > > BZ Tracker: > https://bugzilla.tianocore.org/show_bug.cgi?id=1095 > > OS Boot Validation: > Platform: OVMF > OS (x64): Fedora 26, Ubuntu 18.04, Windows 10, Windows 7 > > Jian J Wang (4): > MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs > UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler > UefiCpuPkg/CpuDxe: implement non-stop mode for uefi > UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM > > MdeModulePkg/MdeModulePkg.dec | 4 +- > UefiCpuPkg/CpuDxe/CpuDxe.h | 39 +++ > UefiCpuPkg/CpuDxe/CpuDxe.inf | 3 + > UefiCpuPkg/CpuDxe/CpuMp.c | 34 ++- > UefiCpuPkg/CpuDxe/CpuPageTable.c | 271 +++++++++++++++++++++ > .../Ia32/ExceptionHandlerAsm.nasm | 7 + > .../Ia32/ExceptionTssEntryAsm.nasm | 4 +- > .../X64/ExceptionHandlerAsm.nasm | 4 + > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c | 43 ++-- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiException.nasm | 3 +- > UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 58 ++++- > UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h | 15 ++ > UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h | 6 + > UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 43 ++-- > 14 files changed, 493 insertions(+), 41 deletions(-) > (1) This looks like a feature addition, so please include the BZ reference (1095) on the following wiki page: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning (under "Proposed Features") (2) The general description should be moved (or copied) from this email (v2 0/4) to patch #1 (v2 1/4). The cover letter is not captured in the commit log, and I think there isn't going to be any other documentation for the feature than the DEC file. (Note that I'm not suggesting that you add the documentation to the DEC file in patch #1 -- instead, the commit message on patch #1 should contain it. Then people can find the commit from the DEC file with "git blame", and read the description.) Thanks Laszlo