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.web11.9168.1608216025403678568 for ; Thu, 17 Dec 2020 06:40:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ShGFBuY0; 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=1608216024; 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=GHuNuKJjjPPPuVM8myYF7ryrLkgWEHHv97JT7KR6w0c=; b=ShGFBuY09Nc9/vVdRn2SrXBr5024Y8X1Nvhnk1jrVzsMiUojyicajnOE0W1cDmgAMzdhT8 VQ8V1CzjjwNI3Ix3+Drko4jwzi6hismfC8MSMXcdC1H1u+r+fsRZA5HWEZCxNMpcuIMSDv boojdaDzYCUlFBYxqGld5Fs2lCyxKFw= 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-21-Op7I1n0pPEaAXW2F4U2bAg-1; Thu, 17 Dec 2020 09:40:18 -0500 X-MC-Unique: Op7I1n0pPEaAXW2F4U2bAg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB169801A9D; Thu, 17 Dec 2020 14:40:15 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-40.ams2.redhat.com [10.36.115.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC28060BE5; Thu, 17 Dec 2020 14:40:13 +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: <38d8c849-2965-5699-3c53-9b6321a3c985@redhat.com> Date: Thu, 17 Dec 2020 15:40:12 +0100 MIME-Version: 1.0 In-Reply-To: <20201217085055.15131-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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 Ticket: https://bugzilla.tianocore.org/show_bug.cgi?id=3121 Thanks Laszlo > --- > > 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 >