From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org 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 1537721D1B2A4 for ; Wed, 31 Jan 2018 04:12:04 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E02CDC057FA0; Wed, 31 Jan 2018 12:17:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-185.rdu2.redhat.com [10.10.120.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id A15C25D729; Wed, 31 Jan 2018 12:17:38 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Ruiyu Ni , Jiewen Yao , Eric Dong , Paolo Bonzini References: <20180130153348.31992-1-lersek@redhat.com> Message-ID: Date: Wed, 31 Jan 2018 13:17:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180130153348.31992-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 31 Jan 2018 12:17:39 +0000 (UTC) Subject: Re: [PATCH 0/3] UefiCpuPkg/PiSmmCpuDxeSmm: fix IA32 SmmStartup() regression on KVM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 12:12:05 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/30/18 16:33, Laszlo Ersek wrote: > Repo: https://github.com/lersek/edk2.git > Branch: smm_startup_ia32_nocond > > This small series fixes the IA32 SMM regression on KVM that I reported > recently. The first two patches are cleanups (no functional changes), > the third patch is the fix. > > Cc: Eric Dong > Cc: Jian J Wang > Cc: Jiewen Yao > Cc: Paolo Bonzini > Cc: Ruiyu Ni > > Thanks > Laszlo > > Laszlo Ersek (3): > UefiCpuPkg/PiSmmCpuDxeSmm: update comments in IA32 SmmStartup() > UefiCpuPkg/PiSmmCpuDxeSmm: remove unneeded DBs from IA32 SmmStartup() > UefiCpuPkg/PiSmmCpuDxeSmm: eliminate conditional jump in IA32 > SmmStartup() > > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm | 28 +++++++++----------- > 1 file changed, 13 insertions(+), 15 deletions(-) > Code differences between the posted version and the pushed version, according to Ray's comments for patch #3, displayed with "git diff --word-diff" (look for [-...-] and {+...+} markers): > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm > index 102e0bdbabc8..d64fcd48d03e 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm > @@ -47,8 +47,8 @@ ASM_PFX(SmmStartup): > mov eax, 0x80000001 ; read capability > cpuid > mov ebx, edx ; rdmsr will change edx. keep it in ebx. > and ebx, BIT20 ; extract [-XD-]{+NX+} capability bit > shr ebx, 9 ; shift bit to [-IA32_EFER NXE-]{+IA32_EFER.NXE[BIT11]+} position > DB 0x66, 0xb8 ; mov eax, imm32 > ASM_PFX(gSmmCr3): DD 0 > mov cr3, eax > @@ -58,7 +58,7 @@ ASM_PFX(gSmmCr4): DD 0 > mov cr4, eax > mov ecx, 0xc0000080 ; IA32_EFER MSR > rdmsr > or eax, ebx ; set NXE bit if [-XD-]{+NX+} is available > wrmsr > DB 0x66, 0xb8 ; mov eax, imm32 > ASM_PFX(gSmmCr0): DD 0 Series pushed as d5988a8ac971..8d4d55b15b58. Let's continue the PatchAssembly() discussion; once we reach an agreement on that, I'll post patches for that too. Thanks! Laszlo