From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 9465781F1F for ; Thu, 1 Dec 2016 13:51:28 -0800 (PST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C0BB3D95A; Thu, 1 Dec 2016 21:51:28 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-138.phx2.redhat.com [10.3.116.138]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB1LpQVr017274; Thu, 1 Dec 2016 16:51:26 -0500 To: Jiewen Yao , edk2-devel@ml01.01.org References: <1480593847-3880-1-git-send-email-jiewen.yao@intel.com> Cc: Michael D Kinney , Jeff Fan From: Laszlo Ersek Message-ID: <8cc4658d-6324-128b-66d8-072a2b10f822@redhat.com> Date: Thu, 1 Dec 2016 22:51:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480593847-3880-1-git-send-email-jiewen.yao@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 01 Dec 2016 21:51:28 +0000 (UTC) Subject: Re: [PATCH V2] UefiCpuPkg/PiSmmCpu: Fixed #double fault on #page fault. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 21:51:28 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 12/01/16 13:04, Jiewen Yao wrote: > This patch fixes https://bugzilla.tianocore.org/show_bug.cgi?id=246 > > Previously, when SMM exception happens after EndOfDxe, > with StackGuard enabled on IA32, the #double fault exception > is reported instead of #page fault. > > Root cause is below: > > Current EDKII SMM page protection will lock GDT. > If IA32 stack guard is enabled, the page fault handler will do task switch. > This task switch need write busy flag in GDT, and write TSS. > > However, the GDT and TSS is locked at that time, so the > double fault happens. > > We decide to not lock GDT for IA32 StackGuard enabled. > > This issue does not exist on X64, or IA32 without StackGuard. > > Cc: Laszlo Ersek > Cc: Jeff Fan > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao > --- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c | 55 ++++++++++++++++ > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 68 ++++++++++++++++++++ > UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 48 -------------- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c | 49 +++++++++++++- > 4 files changed, 171 insertions(+), 49 deletions(-) Regression-tested-by: Laszlo Ersek