From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web09.173.1610040783205864263 for ; Thu, 07 Jan 2021 09:33:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CRAjG3TU; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610040782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ehgtq0Y1MWm/Gzin+YvpRw1JIVDlX4ZQ7V0OBWl+ExE=; b=CRAjG3TU5sirO0tuTqeHdBQvUK79i0fXdwNjQk8cx1qRQy4o8U6u4fEWBTx0uFjXsApRYX VF5+Zj+/X4Avt3sKePySfmsKBpUOqQbON15bv7uHQA1s08gnvqVRWUCMCkFl0LwPkDoo/5 OOh5JgU/dtK5f3rCMU9aBCQGJMwswHM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-520-hY70OcZxNriKlp3-3N-Jeg-1; Thu, 07 Jan 2021 12:32:58 -0500 X-MC-Unique: hY70OcZxNriKlp3-3N-Jeg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A825C190A7A0; Thu, 7 Jan 2021 17:32:56 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-164.ams2.redhat.com [10.36.112.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DEBF60861; Thu, 7 Jan 2021 17:32:54 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH V2] UefiCpuPkg/CpuDxe: Fix boot error To: "Dong, Guo" , "devel@edk2.groups.io" , "thomas.lendacky@amd.com" Cc: "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul1" References: <20210107031045.6760-1-guo.dong@intel.com> <3bf2b64d-0125-beea-9c68-51deafc54d6a@amd.com> From: "Laszlo Ersek" Message-ID: Date: Thu, 7 Jan 2021 18:32:54 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/07/21 17:14, Dong, Guo wrote: > > Thanks Tom to help verify this change and point out an extra comma after rcx. > I will remove that extra comma when pushing this patch. > I could send V3 patch if required to remove this extra comma. I think a v3 is unneeded just for that. Thanks Laszlo > > Thanks, > Guo > >> -----Original Message----- >> From: devel@edk2.groups.io On Behalf Of Lendacky, >> Thomas >> Sent: Thursday, January 7, 2021 8:02 AM >> To: devel@edk2.groups.io; Dong, Guo >> Cc: Dong, Eric ; Ni, Ray ; >> lersek@redhat.com; Kumar, Rahul1 >> Subject: Re: [edk2-devel] [PATCH V2] UefiCpuPkg/CpuDxe: Fix boot error >> >> On 1/6/21 9:10 PM, Guo Dong via groups.io wrote: >>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3084 >>> >>> When DXE drivers are dispatched above 4GB memory in 64bit >>> mode, the address setCodeSelectorLongJump in stack will >>> be override by parameter. Jump to Qword is not supported >>> by some processors. So use "o64 retf" instead. >>> >>> Signed-off-by: Guo Dong >> >> With one little comment below, I verified this method allows my system to >> boot. >> >> Tested-by: Tom Lendacky >> >>> --- >>> UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm | 8 +++----- >>> 1 file changed, 3 insertions(+), 5 deletions(-) >>> >>> diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm >> b/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm >>> index c3489bcc3e..a8216cd56f 100644 >>> --- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm >>> +++ b/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm >>> @@ -20,13 +20,11 @@ >>> ;------------------------------------------------------------------------------ >>> global ASM_PFX(SetCodeSelector) >>> ASM_PFX(SetCodeSelector): >>> - sub rsp, 0x10 >>> + push rcx, >> >> Extraneous comma after rcx. >> >> Thanks, >> Tom >> >>> lea rax, [setCodeSelectorLongJump] >>> - mov [rsp], rax >>> - mov [rsp+4], cx >>> - jmp dword far [rsp] >>> + push rax >>> + o64 retf >>> setCodeSelectorLongJump: >>> - add rsp, 0x10 >>> ret >>> >>> ;------------------------------------------------------------------------------ >>> >> >> >> >> >