From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 58926AC1582 for ; Fri, 29 Sep 2023 15:08:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=h3JBSJ2jdjIQrCTf69HU+1o92y1WJROmMi7IqjVzn28=; c=relaxed/simple; d=groups.io; h=Received-SPF:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Authentication-Results-Original:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:NoDisclaimer:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1696000080; v=1; b=bznYHKSuh23gAQV24moaGXbF40sN47jybsuJdClV9vPwJ6GbsDh/Y0lL9xP+FxHnFiKQKxOE OlV6IZ6kaZ3Zs0W5heZFdTGoFLho4XjhEtJP4SXwqTrJt/CgE/EEljOLlgQ0SnS2bDo8SeTzqZ4 SIc3g9p3u2KD7Tt/x4PdtzG4= X-Received: by 127.0.0.2 with SMTP id ewhLYY7687511xlJmDDKMcoR; Fri, 29 Sep 2023 08:08:00 -0700 X-Received: from EUR02-DB5-obe.outbound.protection.outlook.com (EUR02-DB5-obe.outbound.protection.outlook.com [40.107.249.51]) by mx.groups.io with SMTP id smtpd.web11.20063.1696000079634937501 for ; Fri, 29 Sep 2023 08:08:00 -0700 X-Received: from DBBPR09CA0043.eurprd09.prod.outlook.com (2603:10a6:10:d4::31) by AS8PR08MB7322.eurprd08.prod.outlook.com (2603:10a6:20b:441::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Fri, 29 Sep 2023 15:07:56 +0000 X-Received: from DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:d4:cafe::88) by DBBPR09CA0043.outlook.office365.com (2603:10a6:10:d4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.23 via Frontend Transport; Fri, 29 Sep 2023 15:07:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT007.mail.protection.outlook.com (100.127.142.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.15 via Frontend Transport; Fri, 29 Sep 2023 15:07:55 +0000 X-Received: ("Tessian outbound 6d14f3380669:v211"); Fri, 29 Sep 2023 15:07:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fffe84c9548ee1d2 X-CR-MTA-TID: 64aa7808 X-Received: from 7f697a8adf92.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A52D4492-069E-4A37-A6C3-7810BAED420D.1; Fri, 29 Sep 2023 15:07:48 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7f697a8adf92.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 29 Sep 2023 15:07:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MRFTdp2+Y2IO1it3RXDjR6F0NSt7MQTE7+OW1vAu2EHKNRDJ1nOO589e5YZ7RbaQI43cETnsvJm+uoJud56FM/g4FzQO7TQrYxqUjAhyyI7q59YF9puwP4Agt1RCV7ycjKSJjuF6+rGePh6//4s/+m4RSPGRUVBq3/DMHDP1JVaVP5v1uGGkBoYzux/Gb2diG3iUWtlhGOmc7kyAZwgADoRTO1eUfDgb72gg39EZ/hRf7sYzKf7HuanHjB260B4cWVMNhkuUphv+b3oibH0otcszr0qFxqI7B/GiBPPU3pJ869YicZyDyaeNn8l2nDEKeQEFIcFEOj0x4TI3CCaNAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2h1OSmTNoAJ0I1JrU38lXsFElN3UzWOMLm5VN9xT/gw=; b=Pzh1Ip0O2tFPktOXSGybiunov0vWe0+ZTr3mGBQKtbvL8bWFzazArhbJyAGS97wux6NOFTaF7boBc25DdiFUUMQ3XeiPxpTlz3LP0hPLbhjylTTQJYGYACBp7NGdNWE4UIg4p71QL7lfkv0rKxu+wnE65zrx5nPGowxq/r/Nd/n9ZiPGd/wOObl/7c90MuF/Agy4CZWtoz2ubEsvyslbHf8DDqfN2PFfDqZZHiZLwlpg9EzyRRDzNYuuw54iGeUSMgTLJ1FcKkMOI6wJWNLWqUPrgcMCXiYkxkU+G5XLwcSjgRiEefORYIe2sMyvdlNxiVsFf1jxTU3Nb16PIZVvWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by VI1PR08MB5310.eurprd08.prod.outlook.com (2603:10a6:803:135::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Fri, 29 Sep 2023 15:07:46 +0000 X-Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::ac37:4594:ab86:59ce]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::ac37:4594:ab86:59ce%4]) with mapi id 15.20.6838.024; Fri, 29 Sep 2023 15:07:46 +0000 Message-ID: Date: Fri, 29 Sep 2023 16:07:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [edk2-devel] [PATCH v2 4/5] MdePkg/BaseLib: correct register sizes in AArch64 SetJump/LongJump To: Leif Lindholm , devel@edk2.groups.io Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Andrei Warkentin , Ard Biesheuvel , "nd@arm.com" References: <20230926171523.368706-1-quic_llindhol@quicinc.com> <20230926171523.368706-5-quic_llindhol@quicinc.com> From: "Sami Mujawar" In-Reply-To: <20230926171523.368706-5-quic_llindhol@quicinc.com> X-ClientProxiedBy: LO4P265CA0080.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bd::10) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|VI1PR08MB5310:EE_|DBAEUR03FT007:EE_|AS8PR08MB7322:EE_ X-MS-Office365-Filtering-Correlation-Id: 2db952e7-2b59-4de5-908c-08dbc0fddc53 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zhdVDIJL3F/8z88YvZEb4vGm8cugXufZPe+8U6vVJajPy8hvEadegrbguGNC0ZrjUry2Ur0Q/h5z5Q/Jj/NebjrWUteydTFHzyLzrdNoFVDDfd4Fwn6OWZNBDFOu+39aW7Kpkx9kMJhr6/PoKWrEBQgm5s9B9mDEa3ZVGgO2LgxfFdJ++rtiVwdPmFHalvzheqEILJFMdHHFpZvzxvfAWvBk5X+PeytG6R8iuQ3r6UVufLd4lejx5CxyVw+4L3yTju7y+ExYAP8DX491ZcWCuQojVol657138sg3tZli67RtJ4B4bDLaJI3+vwlKYKcRADSPwoA5CEvkT5gAIldbvQwad/dq0ppIY6YanDt6baZJrcmmHUk4+Iz6OefW7BkYoqlLquHFPMBTM+POSc7norF9MbiZmahDJ4L1JZ8Tg8BdvDAu3gY7/GC+T1nCXj5G7jsmiAov2reZJL2n0jhDIl530UV6v+UOuIU6P/LAwHmAHE1IohLhNYrxMJd4ASRegcXxmmF0rNdOiqX29RKCVesbkebFfVQFevcpQDquxy8NmlVYP+JE+9ncpzksBnDCEaylKfCL5R/ed66TZ8Fm6rq/lfguo1dId01Qib32wNEEj+bc/zWZ8E/roQp6L1NXIJicJc7KQrPT7uNM6niVcA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39850400004)(366004)(376002)(346002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(6486002)(31686004)(6506007)(2616005)(53546011)(6512007)(38100700002)(31696002)(86362001)(36756003)(4326008)(2906002)(19627235002)(6666004)(478600001)(83380400001)(8936002)(8676002)(26005)(41300700001)(54906003)(44832011)(66476007)(316002)(66556008)(5660300002)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5310 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b42f5363-de17-439a-eb38-08dbc0fdd671 X-Microsoft-Antispam-Message-Info: 7POaMlc95UsJLkSH9Qi+huaSpw9IL1mHhJDYWAHHuCsBfkmQ1Jfipks+kYn9y9aEfoN93QYP+VmAjpwaL/O0iZb117QcZ3krEOno1pCKLrQ3/VHlBUGmG/9KhdYD0mtwNiIAT+q5PnsZ4LsMXA4lc0SA/AplcNeZjXUOxKPNdeZCa09i1W40/B1eOfssTgquY+LiDq3t69L5gL2zFoTIl1vbCKVHj8gINOxMNAC8QwQut0NIAE57XYqlSm+AIRopd5L3nSKQEH8sdZwLzhEHB0a+ugio41GDBj3ExUMDs+/PLfgM146L8Zki9V+q0MwcDZ0devWR8MLMOjx/ql4rbAn7m1Slac3rNKg6MBHznfm1zUKQjGIkF2u9f6HMv1WCEyxVWID+X1SrOqs9r3Sx5p4fsM3o7LlIcI9nFAH098MoVZaVvVvWOUMk64+C4cRJVc9r0GIKQoVd8lSCii05UBVkLe3rZoo1Ntigg8Ez8zlmsXiyvpTBWQJyBcYARkMexrkDMyQCJnDGYfWtn2evv6UqBiMoBkyFP+Zu3tDt3cO+v+pRhSXd7e1zV5lWvpNbwRBEN2xrIRn0yNY1kKqp73H17+FMjOAlj0NqedpoLy7z+9+qAyenMaJ3P1zM7LifOvDnYAeKGRWv2EyaUrPq77PPzAXAUhC2Sm5rs/mMI/9XBj5ZxQqVISL2ut+BdCELvgGjoW3D8QwvDfMVd6d4at5i+zwtIsuE4Nk/ikAUB//5aL+62Ur07dkEciFnkoXJ15gkz7UOTtfXH/xHzjKzFQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 15:07:55.8780 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2db952e7-2b59-4de5-908c-08dbc0fddc53 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7322 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,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: tyEpLEDOpMOuGwTNlWIWFviAx7686176AA= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=bznYHKSu; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Leif, Thank you for this patch. These changes look good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 26/09/2023 06:15 pm, Leif Lindholm wrote: > 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 > --- > 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/Li= brary/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/= Library/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 -=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 (#109203): https://edk2.groups.io/g/devel/message/109203 Mute This Topic: https://groups.io/mt/101600808/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-