From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web08.8602.1609943144375431884 for ; Wed, 06 Jan 2021 06:25:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O9KYxgYU; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609943143; 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=sfIoDEPDfvYwMnczM+B2eecogvLJI4iwm/cEJW43rTQ=; b=O9KYxgYUahwcyJU48xyDS9kCAHzAyeeQ7oM3kVySados7W1+73KOr43mHpzMyeRtednwhK FT3dBmCjaHGkTrKND7HrnsFKk/7ASBIchFDXQfnl9G5DHB5/qrGqWgklXmIER32bTy/SoF ZbeFJaByOGxTfI/ElH7Wzv+T3i4cwDA= 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-199-833EzPPqN1e-WulqCKxkNQ-1; Wed, 06 Jan 2021 09:25:38 -0500 X-MC-Unique: 833EzPPqN1e-WulqCKxkNQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65355800D62; Wed, 6 Jan 2021 14:25:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3EF81002393; Wed, 6 Jan 2021 14:25:35 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuDxe: Fix boot error To: devel@edk2.groups.io, michael.d.kinney@intel.com, "Dong, Guo" Cc: "Dong, Eric" , "Ni, Ray" , "Kumar, Rahul1" References: <20201224200420.15692-1-guo.dong@intel.com> From: "Laszlo Ersek" Message-ID: <92164abd-cab0-0d8f-1121-e8af8f01a3f9@redhat.com> Date: Wed, 6 Jan 2021 15:25:34 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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/05/21 05:31, Michael D Kinney wrote: > Hi Guo, > > NASM has good support for instructions. Can the DB be removed and replaced with the equivalent instruction? Indeed. Thanks! Laszlo > > Thanks, > > Mike > >> -----Original Message----- >> From: devel@edk2.groups.io On Behalf Of Guo Dong >> Sent: Thursday, December 24, 2020 12:04 PM >> To: devel@edk2.groups.io >> Cc: Dong, Eric ; Ni, Ray ; lersek@redhat.com; Kumar, Rahul1 >> >> Subject: [edk2-devel] [PATCH] UefiCpuPkg/CpuDxe: Fix boot error >> >> 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 retfq instead. >> >> Signed-off-by: Guo Dong >> --- >> 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..e33ddb2784 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, >> lea rax, [setCodeSelectorLongJump] >> - mov [rsp], rax >> - mov [rsp+4], cx >> - jmp dword far [rsp] >> + push rax >> + DB 0x48, 0xcb ; retfq >> setCodeSelectorLongJump: >> - add rsp, 0x10 >> ret >> >> ;------------------------------------------------------------------------------ >> -- >> 2.16.2.windows.1 >> >> >> >> >> > > > > > >