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.web08.8947.1608293423095835842 for ; Fri, 18 Dec 2020 04:10:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fiNKiiu3; 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=1608293422; h=from:from:reply-to: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=Z/qgY7qqQgAPHj1tUHd6l18HEWxziiFjPJIOKqDpkQQ=; b=fiNKiiu3wEVFWrtATZ1FDt/1bQbDcmc/Yu0vLowlZv1sU1j2C+YJ/BY2xbSAmxDwu0sV57 +IqgwM+qAzL7uvy+7A5SIZ4PrnddiCWKO/IKxIdaS8eD8fRGWaiCAOtoXpasgZRezDPyy8 RTUE05OwURy/4k7cAxOFfLIcDWcIlK4= 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-456-huTlVW5DOPSn54ctw97-5w-1; Fri, 18 Dec 2020 07:10:19 -0500 X-MC-Unique: huTlVW5DOPSn54ctw97-5w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E4F51934100; Fri, 18 Dec 2020 12:10:18 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-229.ams2.redhat.com [10.36.114.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FF782BFED; Fri, 18 Dec 2020 12:10:15 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] Revert "UefiCpuPkg/CpuDxe: Fix boot error" From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Eric Dong , Guo Dong , James Bottomley , Rahul Kumar , Ray Ni , Thomas Lendacky Reply-To: devel@edk2.groups.io, lersek@redhat.com References: <20201217085055.15131-1-lersek@redhat.com> Message-ID: <65b302bb-9019-2843-8400-b1304584ad75@redhat.com> Date: Fri, 18 Dec 2020 13:10:14 +0100 MIME-Version: 1.0 In-Reply-To: <20201217085055.15131-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 12/17/20 09:50, Laszlo Ersek wrote: > This reverts commit cee5b0441af39dd6f76cc4e0447a1c7f788cbb00. > > Commit cee5b0441af3 ("UefiCpuPkg/CpuDxe: Fix boot error", 2020-12-08) > breaks CpuDxe (and with it, OVMF boot) on AMD processors. AMD processors > cannot do far jumps to 64-bit targets, as documented in the AMD64 > Architecture Programmer's Manual. > > Revert the patch until a RETFQ-based substitute is posted. > > Cc: Eric Dong > Cc: Guo Dong > Cc: James Bottomley > Cc: Rahul Kumar > Cc: Ray Ni > Cc: Thomas Lendacky > Ref: https://edk2.groups.io/g/devel/message/68597 > Ref: https://www.redhat.com/archives/edk2-devel-archive/2020-December/msg00493.html > Reported-by: Thomas Lendacky > Ref: https://edk2.groups.io/g/devel/message/68832 > Ref: https://www.redhat.com/archives/edk2-devel-archive/2020-December/msg00737.html > Reported-by: James Bottomley > Signed-off-by: Laszlo Ersek > --- > > Notes: > The broken patch was committed on December 8th; Tom reported the > regression the next day, and James reported it independently on Dec > 14th/15th (dependent on one's time zone). > > Nine days after merging the broken patch, I've only seen "pondering" of > how we should fix the issue. I'll tell you how: I'm going to merge this > revert later today unless I see a patch that implements the RETFQ-based > replacement. > > Regressing code and not working diligently to address the problem is > unacceptable. > > UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm b/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm > index 6ad32b49f4ef..c3489bcc3e89 100644 > --- a/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm > +++ b/UefiCpuPkg/CpuDxe/X64/CpuAsm.nasm > @@ -23,8 +23,8 @@ ASM_PFX(SetCodeSelector): > sub rsp, 0x10 > lea rax, [setCodeSelectorLongJump] > mov [rsp], rax > - mov [rsp+8], cx > - jmp qword far [rsp] > + mov [rsp+4], cx > + jmp dword far [rsp] > setCodeSelectorLongJump: > add rsp, 0x10 > ret > Merged as commit 089285b42c69, via . Laszlo