From nobody Tue Feb 10 23:55:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109077+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109077+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1695748543; cv=none; d=zohomail.com; s=zohoarc; b=AJZPD9PJQ6wBDOgx1oX2QKwu7orstDxc/X7A8MmG4hRZGQv734P+pnIM+LGwWXFtAvkjCgx6MFIq4OVcajQvbXpb5pzkImZ30BX2Os0TyVWp2ZR3xrOJgHxKVKBBygVXRBNLJLkQiuvxW5fgYfygOtEUO61PNepSHj7SeCQJhPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695748543; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=TYiQKf2NMfZZnvfvUsUrgXUAeRuQrarinAVNhWB2gZU=; b=gHwwD7SHvLNvuKjNqX24AWkcuHsk3Pdav5JnILdr/V9Sj7n2GZvYVo+I2ghJlAZwM3opK5qSNsbX1ul2f6OtwUy81N5ulYAvAst/I1EHTMja0N9YzQRAetAzh+2Yx4XoTiBNBynNxr0wxOBva0HOvcgew5/NMojxbZJgEoglPbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109077+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 169574854383811.756393031962489; Tue, 26 Sep 2023 10:15:43 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=PNe4/7Lqh7nOce7nCfaHN5Z3Dp/AYtXohVJYRklwiaA=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1695748543; v=1; b=sDaOAaM3I6X+fZw9a/EE6rdFS1VbScMxrN7SjUioWbF0AcAERkIGBzn6+iGmJRr4sYyN//3s kF6Zsd10lVH1nglaV4YdN/qH9KGj9o/uc5PnsTL5qDhulIAdzBdipUaHZS1sznK7qsUeIxIcwEj JPrG5eBwwyjgWmxfGm55q5qY= X-Received: by 127.0.0.2 with SMTP id KcVqYY1788612xgAsfpNPudf; Tue, 26 Sep 2023 10:15:43 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.25336.1695748542929930538 for ; Tue, 26 Sep 2023 10:15:42 -0700 X-Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38QD4fZL019379; Tue, 26 Sep 2023 17:15:40 GMT X-Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tbw9bh6k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:39 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38QHFdlD002292 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 17:15:39 GMT X-Received: from qc-i7.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 26 Sep 2023 10:15:37 -0700 From: "Leif Lindholm" To: CC: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrei Warkentin , Ard Biesheuvel , Sami Mujawar Subject: [edk2-devel] [PATCH v2 4/5] MdePkg/BaseLib: correct register sizes in AArch64 SetJump/LongJump Date: Tue, 26 Sep 2023 18:15:22 +0100 Message-ID: <20230926171523.368706-5-quic_llindhol@quicinc.com> In-Reply-To: <20230926171523.368706-1-quic_llindhol@quicinc.com> References: <20230926171523.368706-1-quic_llindhol@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: -1_tl99B9uxy_vBVXK2Wh-YPvE-Y8MSW X-Proofpoint-ORIG-GUID: -1_tl99B9uxy_vBVXK2Wh-YPvE-Y8MSW Precedence: Bulk List-Subscribe: List-Help: 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,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: irGXSvxdWcuel1SD5QKKC8Oyx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695748544915100005 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 Reanimated-by: Andrei Warkentin Cc: Ard Biesheuvel Cc: Sami Mujawar Reviewed-by: Andrei Warkentin Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Sami Mujawar --- 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 de79ad3a0a3e..3e58119b25d2 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S @@ -61,7 +61,7 @@ ASM_PFX(SetJump): FPR_LAYOUT #undef REG_PAIR #undef REG_ONE - mov w0, #0 + mov x0, #0 ret =20 #/** @@ -91,9 +91,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 ret =20 ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/Li= brary/BaseLib/AArch64/SetJumpLongJump.asm index c2774eece311..6ec8f35f2c9f 100644 --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm @@ -59,7 +59,7 @@ SetJump FPR_LAYOUT #undef REG_PAIR #undef REG_ONE - mov w0, #0 + mov x0, #0 ret =20 ;/** @@ -88,10 +88,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.30.2 -=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 (#109077): https://edk2.groups.io/g/devel/message/109077 Mute This Topic: https://groups.io/mt/101600808/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-