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 788202203D618 for ; Mon, 13 Nov 2017 10:26:09 -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 C3809128B; Mon, 13 Nov 2017 18:30:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-226.rdu2.redhat.com [10.10.120.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0E117E11A; Mon, 13 Nov 2017 18:30:13 +0000 (UTC) To: Jordan Justen , edk2-devel-01 Cc: Ard Biesheuvel , Ruiyu Ni References: <20171110154908.306-1-lersek@redhat.com> <20171110154908.306-2-lersek@redhat.com> <151059653162.20614.10956585129107897594@jljusten-skl> From: Laszlo Ersek Message-ID: Date: Mon, 13 Nov 2017 19:30:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <151059653162.20614.10956585129107897594@jljusten-skl> 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.29]); Mon, 13 Nov 2017 18:30:15 +0000 (UTC) Subject: Re: [PATCH 1/4] OvmfPkg/Sec/Ia32: free up EAX for other uses while setting up the stack X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 18:26:09 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/13/17 19:08, Jordan Justen wrote: > On 2017-11-10 07:49:05, Laszlo Ersek wrote: >> Currently EAX is used as an intermediary in setting ESP to >> SEC_TOP_OF_STACK, and in passing SEC_TOP_OF_STACK to >> SecCoreStartupWithStack() as the "TopOfCurrentStack" argument. >> >> In a later patch we'll use EAX differently, so replace it with EBX under >> the current use. >> >> Cc: Ard Biesheuvel >> Cc: Jordan Justen >> Cc: Ruiyu Ni >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Laszlo Ersek >> --- >> OvmfPkg/Sec/Ia32/SecEntry.nasm | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/OvmfPkg/Sec/Ia32/SecEntry.nasm b/OvmfPkg/Sec/Ia32/SecEntry.nasm >> index 7fee1c2b2e4f..54d074e621f6 100644 >> --- a/OvmfPkg/Sec/Ia32/SecEntry.nasm >> +++ b/OvmfPkg/Sec/Ia32/SecEntry.nasm >> @@ -40,8 +40,8 @@ ASM_PFX(_ModuleEntryPoint): >> ; >> %define SEC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + \ >> FixedPcdGet32 (PcdOvmfSecPeiTempRamSize)) >> - mov eax, SEC_TOP_OF_STACK >> - mov esp, eax >> + mov ebx, SEC_TOP_OF_STACK >> + mov esp, ebx > > Can't you initialize the temp RAM before this code? Should be possible, yes. Thanks Laszlo