From nobody Tue Feb 10 05:10:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65815+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65815+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1601577445; cv=none; d=zohomail.com; s=zohoarc; b=U5a4wN4dp1DxB6XnctrkWTSEF6pHMGrtJ14XZFI0ab+71O8n5NFyd2FYGzCGlRU7JrNxoSp/yisoVTXEYo4dqxaC8HLALIseEE/EVEG8CHzcuRkNDWjUBEzadd/PFbmdo7VG6Dk3hhCJYurKPeJgAG7FOAOh+EpRycTRW3GkKic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601577445; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=R/WTFigHKSRFOhVnCplb0lF0trB4ou/zhkKntcFyRRQ=; b=g3Mtoi6xMht/79/M0tZguIuMBL8scIoKCArDB3QpE9oQCdx4pwd4mtyGGzNolMrLIEN/IDQSiY3yKLyZj/hGdkZNgf68r+X5HHkITXLdWnTVgkB6F4gGVG8wMjD8ikTBBK+xZdrSbjFAGfQ9vsTrRJefHnujB5u5VS88Oswv5ec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65815+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1601577445294278.23486292513337; Thu, 1 Oct 2020 11:37:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Dy3mYY1788612x0Pn6ZB4O5X; Thu, 01 Oct 2020 11:37:24 -0700 X-Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web12.1032.1601577444218447026 for ; Thu, 01 Oct 2020 11:37:24 -0700 X-Received: by mail-wm1-f47.google.com with SMTP id t17so4203554wmi.4 for ; Thu, 01 Oct 2020 11:37:23 -0700 (PDT) X-Gm-Message-State: Zuym2uQkX1vbucZEncKQMHRIx1787277AA= X-Google-Smtp-Source: ABdhPJyb6O7rm/m5PAjywiAPsnqSd+SMptw0SOyQZm+Uq6KG/QAha/ChEm4ouYKiwKRpM4/Wq5W+bQ== X-Received: by 2002:a1c:5685:: with SMTP id k127mr1394560wmb.135.1601577442293; Thu, 01 Oct 2020 11:37:22 -0700 (PDT) X-Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id a3sm964671wmb.46.2020.10.01.11.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 11:37:21 -0700 (PDT) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH 4/5] MdePkg/BaseLib: correct register sizes in AArch64 SetJump/LongJump Date: Thu, 1 Oct 2020 19:37:11 +0100 Message-Id: <20201001183712.1738-5-leif@nuviainc.com> In-Reply-To: <20201001183712.1738-1-leif@nuviainc.com> References: <20201001183712.1738-1-leif@nuviainc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1601577444; bh=7rjn2Dps9mC0031ZeBlRdyJnUmUKAonPLKGXGnp8ORM=; h=Cc:Date:From:Reply-To:Subject:To; b=sc4bkuXB04IHTCBLGpUodLB2d4ywNcpnt0tF2xyu16Pm2D1mBn7dJ+P8EEfTO/Wog6+ g0M95OSSxWKoko7xx6uQXrAXhdFgKTOjNVMhan3gABjRGi+U3sntB/jvb12nX4tXaZ7Ad uER3tRq4IWW4MpH6KldvGoZIKlhw9Z/11vc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Both in SetJump and in InternalLongJump, 32-bit w register views were used for the UINTN return value. In SetJump, this did not cause errors; it was only counterintuitive. But in InternalLongJump, it meant the top 32 bits of Value were stripped off. Change all of these to use the 64-bit x register views. Signed-off-by: Leif Lindholm Reviewed-by: Philippe Mathieu-Daude --- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S | 8 ++++---- MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Libr= ary/BaseLib/AArch64/SetJumpLongJump.S index 34765a676430..b3d37b216542 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -55,7 +55,7 @@ ASM_PFX(SetJump): FPR_LAYOUT #undef REG_PAIR #undef REG_ONE - mov w0, #0 + mov x0, #0 ret =20 #/** @@ -84,9 +84,9 @@ ASM_PFX(InternalLongJump): #undef REG_PAIR #undef REG_ONE mov sp, x16 - cmp w1, #0 - mov w0, #1 - csel w0, w1, w0, ne + cmp x1, #0 + mov x0, #1 + csel x0, x1, x0, ne // use br not ret, as ret is guaranteed to mispredict br x30 =20 diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/Li= brary/BaseLib/AArch64/SetJumpLongJump.asm index f2729a8bb03e..ba4d2389c0cb 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -54,7 +54,7 @@ SetJump FPR_LAYOUT #undef REG_PAIR #undef REG_ONE - mov w0, #0 + mov x0, #0 ret =20 ;/** @@ -83,10 +83,10 @@ InternalLongJump #undef REG_PAIR #undef REG_ONE mov sp, x16 - cmp w1, #0 - mov w0, #1 + cmp x1, #0 + mov x0, #1 beq exit - mov w0, w1 + mov x0, x1 exit // use br not ret, as ret is guaranteed to mispredict br x30 --=20 2.20.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#65815): https://edk2.groups.io/g/devel/message/65815 Mute This Topic: https://groups.io/mt/77247142/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-