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.web12.7263.1610020616273439551 for ; Thu, 07 Jan 2021 03:56:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e+AAXQ/4; 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=1610020615; 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=o3Zj/x+AJ8W/l9+GXyw3QSoVFzap/I11oUXB76tozuw=; b=e+AAXQ/4L0aG5r+zHJvmOpP3KJLqDFG9GaEP2bu4CRg+bps/tKMMIpRHkhaYW1w0yZ42ek m6FNTURNanPd5XVfiEfooXcB1StvVxy+ovo7rVGMBpt3Z2UwFLOkmeSZu5yxNn+81nmrTT nqnk5LW5a1Dx/lVsq5Lx/9/euoXbnBQ= 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-206-WqbPHiktODuH8PNr98paIQ-1; Thu, 07 Jan 2021 06:56:51 -0500 X-MC-Unique: WqbPHiktODuH8PNr98paIQ-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 0ACA1803628; Thu, 7 Jan 2021 11:56:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-119.ams2.redhat.com [10.36.114.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5536710013BD; Thu, 7 Jan 2021 11:56:48 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH V2] UefiCpuPkg/CpuDxe: Fix boot error To: Guo Dong , devel@edk2.groups.io Cc: eric.dong@intel.com, ray.ni@intel.com, rahul1.kumar@intel.com, Tom Lendacky , James Bottomley , Michael Kinney References: <20210107031045.6760-1-guo.dong@intel.com> From: "Laszlo Ersek" Message-ID: <045e12bb-f4d8-1d7a-ea3a-fa7b8d09ce12@redhat.com> Date: Thu, 7 Jan 2021 12:56:47 +0100 MIME-Version: 1.0 In-Reply-To: <20210107031045.6760-1-guo.dong@intel.com> 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 Adding James, Mike, and Tom: On 01/07/21 04:10, Guo Dong 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 > --- > 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, > lea rax, [setCodeSelectorLongJump] > - mov [rsp], rax > - mov [rsp+4], cx > - jmp dword far [rsp] > + push rax > + o64 retf > setCodeSelectorLongJump: > - add rsp, 0x10 > ret > > ;------------------------------------------------------------------------------ > I'm asking for: - a Reviewed-by or Tested-by from James please, and - an Acked-by or Reviewed-by from Mike please, and - a Reviewed-by or Tested-by from Tom please. Personally I'm not going to verify the details of the conversion of the mode switch, from the far jump to the far ret, but squinting from a distance, the patch looks plausible. Acked-by: Laszlo Ersek Thanks! Laszlo