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 3106E780091 for ; Fri, 29 Sep 2023 15:07:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7TkqT7HtmXOYldSf7WWXrDCdW2AXgO5h4Cg5U+gWEZg=; 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=1696000032; v=1; b=wDN3W72YcoGwCy1wD+h8AHQaRgK3Hj0p0khF79g1Fbj3HxHHxBamUkaJgNjPgFjuNAPkhEbj r/2CNMSSGK2dhKDhBfBLcY/Bhvrfm1CRIBjEgZkipyJ2447Vw0awNyqKyc3fDwAE7aTIrC2kWej 8t6/dMC4xaUS3993qhRXE0vo= X-Received: by 127.0.0.2 with SMTP id VX4RYY7687511x3D08UFM4LQ; Fri, 29 Sep 2023 08:07:12 -0700 X-Received: from EUR03-VI1-obe.outbound.protection.outlook.com (EUR03-VI1-obe.outbound.protection.outlook.com [40.107.103.63]) by mx.groups.io with SMTP id smtpd.web10.20012.1696000031417824512 for ; Fri, 29 Sep 2023 08:07:11 -0700 X-Received: from AS9PR0301CA0058.eurprd03.prod.outlook.com (2603:10a6:20b:469::17) by DB9PR08MB8357.eurprd08.prod.outlook.com (2603:10a6:10:3db::20) 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:07 +0000 X-Received: from AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:469:cafe::df) by AS9PR0301CA0058.outlook.office365.com (2603:10a6:20b:469::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26 via Frontend Transport; Fri, 29 Sep 2023 15:07:07 +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 AM7EUR03FT006.mail.protection.outlook.com (100.127.141.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.25 via Frontend Transport; Fri, 29 Sep 2023 15:07:07 +0000 X-Received: ("Tessian outbound ee9c7f88acf7:v211"); Fri, 29 Sep 2023 15:07:07 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ac116a33a1b5fe88 X-CR-MTA-TID: 64aa7808 X-Received: from d0ccf50c61c1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3BA7856E-08C9-4FC6-8B38-27D9CF42E501.1; Fri, 29 Sep 2023 15:07:00 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d0ccf50c61c1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 29 Sep 2023 15:06:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bDnJFJPihkY8P0nj5Dge+XxcWbagGmIy5r9netBVmiv65XqKIYpe+W05M7eDmvqCXghbSG6iUdhDyM8Qehkjd17K0u6d15cg/s9t2jQGJxJyUQGBIRi41laeCBXgM2pa/ksoU8TzGEbMk6pmn9UvWSL0ue3kWVWKD4Kv9G/g/hAICmboo75IsOAM5e/4oG0ioAGPlAK53FWpHQSL3/3NL3uKZwRcIMTaRL6vMeztKXiDlOrxcxfZs7xqrP5VZT6k493OCq9jvHue+nV7uLS9wbxCvqihht45B8QoN2YgmaomxPg4vwaRw0sYOpaJN6lZQPWpkt1u1/lCMyXN3Xc6Ow== 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=W7WtijViS4pDGRKMiE0cpWA/U8ylgf4/TR9GK418YUU=; b=ZxNTnzq/PCU1CKT/ZB92tAfkm3XzR+/837SzNZ9Yr/fDt3ktYdYOWfsYGChFkwPMSx/NSJ1T/FqRSsYUCqyW6IHaXnT2e7deCC9ELiHJlmTR7TPPrHfQLntCPLrgiKE6vX/+iY8gLwQQSrfmVk0Sy9i9p0qlaZwCVpU516jvKIm14nxadLvymKaj+BY5lReqfH+Q9FMaMtpiU26hGcBxpOLOKivno1UR3/kfqmsbviE2jGUEAqlIQx4jZnoh/mYDNzJWwdzMpFR/cCCCORU+7Hcs7d2GBI6s5wdqF8qWQ7Hm1NxMiBp3OFC3u/o/WG1lpSB80YlUVMX5hf++w+D9kA== 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:06:55 +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:06:55 +0000 Message-ID: Date: Fri, 29 Sep 2023 16:06:54 +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 2/5] MdePkg/BaseLib: add ASSERT in ARM* SetJump implementations To: Leif Lindholm , devel@edk2.groups.io Cc: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Ard Biesheuvel , "nd@arm.com" References: <20230926171523.368706-1-quic_llindhol@quicinc.com> <20230926171523.368706-3-quic_llindhol@quicinc.com> From: "Sami Mujawar" In-Reply-To: <20230926171523.368706-3-quic_llindhol@quicinc.com> X-ClientProxiedBy: LO4P123CA0168.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::11) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|VI1PR08MB5310:EE_|AM7EUR03FT006:EE_|DB9PR08MB8357:EE_ X-MS-Office365-Filtering-Correlation-Id: 957e53c6-38bd-4a08-cddf-08dbc0fdbf86 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: t1AnjwY3EwMj/UwQ+k04wawM4IJBNoUgiHeUdGC/MW7MABSKUbusWRSI5PzY7EXtIqXveIbIoh9v5Q8Lzvz1bZboo5Xs8FfuLvyhbe6GQHWx5JfI7pBTbIItRUFx8i61H4Laa3uxBVemQAQS/gb7uXW0ILNOppKwM8CymKo2ut+rUqXLSpRyYkyfAJvBrH8vM2GzDeq9P40pTV+c05RCZQQ4GIqRrm0hUZhUY/Oa9UCOyfDaDfDedf8trRg5+NROKRsYZhNEHX4VMYHsYnQEMoXAUIS0DOB6qbCBx4uhC2zVZnr8ATQebO6dqOMMf4d9fKx4UfTvZzsrN+KFJQZEQlntxC8lgHcGHIagqGGQULFq5wPHEGKx/ZNTmEXxNXCJO/H13gYyRVWPpayP0IVVn9R+55m4qxuYPPvQEH9Wrtz9a39j5VLODObUb2hKBrOVt0sbEPHQKI0RHH1rI7QMl3++zyDh/l+Ha2Q58saP8dsJX87cNHBeikLyK1WYSOY9x2xFLOB3P/cnLENVdPN0dKqEoO7Hdf6zflw/rqFoDkHI5faPOxw7DTqzKA/BWKR/Lj2JeCGiaKcN9IpOzHp2RE1Ni6zcB5KFkWUbCT777Gtr0gD/vCDMAa0unAnbdEuvu35EOxb1VKQEZMzNl6ez+w== 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)(478600001)(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: AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9c1c25c7-2e94-4a80-4192-08dbc0fdb85f X-Microsoft-Antispam-Message-Info: 0FSyY3UTcJ2x8qAzYoU9zeXT6YSWCVXyC3hMw2epFcwM0p8znq9R0LxLx1zzhQphYN9A8aQSAtjPJO/iRi8OH07kP3dVpUzYOEPpN9wYLYtFhnnWfYzGau5YgDskHXZ65kIgeEA6MoP+Et9Fm57EvFenBIuMq2BPT7q89qVi+LWh0rQy0FOsBb4gwQQ3FtnNZoJblQzWzikai2Rl5W/TQ8krOIHdGQI+xGhH4v5Tf5TodgKmZ5wqc6RD/F9Nsl1Y7J9/pY1c7r7W1KzGiYdf843rpIKUifv1Te3nSu0w0s8vbdw9nGYtCHDMukeL/VcpLM3fiFVnowWCGv4/2JhuS2I9o7lbX8k9PyKewj5Anqg+Vfa2LGCHA+p8POtCMlqWOx0A2GNqo0ElAb3MrsXaSZilDI9buXjniFw2CLnixDnWTN3oTPWyGCwufW1vFTNNxoJt6360a+/RaLQ8axrsagTAAJBl13OwSiZRnvl+ki/wyuiY/10FvERRCCO7t8ew/MK7X4MKnD2+1FILdRg8kwC9AbRWEtv9OXvT5ZLweUXqGKjaVIKlfKrPuZA1XbFUXhyO8vsZAX/QLDw1SDAc5cbTvtAn0nTGxi0BRdHEZpWotAg8FtLVN+J8kC0E280vGKBezv1inrdjblimNPEOsIp4cdnUZRfVV+WZnIaL0SjV7bjvtmJtHdIbWt+rYDdbIzzX23ucnUx8KFnWryZa4uKIToIUCRnf8uaEt5tcVQeJP2ZigkmeXR/fde9msApRgbxPbHyj965XDR3aeWGzIg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 15:07:07.4973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 957e53c6-38bd-4a08-cddf-08dbc0fdbf86 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: AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8357 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: 14DwqqOjZ0OPxUK3bng9kgugx7686176AA= 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=wDN3W72Y; 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. This patch looks good to me. Just a question, should we also do the same for the AArch32 builds? In either case, Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 26/09/2023 06:15 pm, Leif Lindholm wrote: > The SetJump comment header states that: > If JumpBuffer is NULL, then ASSERT(). > > However, this was not currently done. > Add a call to InternalAssertJumpBuffer. > > Signed-off-by: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Sami Mujawar > --- > MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S | 8 ++++++++ > MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm | 8 ++++++++ > 2 files changed, 16 insertions(+) > > diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S b/MdePkg/Li= brary/BaseLib/AArch64/SetJumpLongJump.S > index 78db9b3d1e78..de79ad3a0a3e 100644 > --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S > +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S > @@ -46,6 +46,14 @@ GCC_ASM_EXPORT(InternalLongJump) > # > ASM_PFX(SetJump): > AARCH64_BTI(c) > +#ifndef MDEPKG_NDEBUG > + stp x29, x30, [sp, #-32]! > + mov x29, sp > + str x0, [sp, #16] > + bl InternalAssertJumpBuffer > + ldr x0, [sp, #16] > + ldp x29, x30, [sp], #32 > +#endif > mov x16, sp // use IP0 so save SP > #define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS] > #define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS] > diff --git a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm b/MdePkg/= Library/BaseLib/AArch64/SetJumpLongJump.asm > index d8b267addc1a..c2774eece311 100644 > --- a/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm > +++ b/MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.asm > @@ -44,6 +44,14 @@ > ; ); > ; > SetJump > +#ifndef MDEPKG_NDEBUG > + stp x29, x30, [sp, #-32]! > + mov x29, sp > + str x0, [sp, #16] > + bl InternalAssertJumpBuffer > + ldr x0, [sp, #16] > + ldp x29, x30, [sp], #32 > +#endif > mov x16, sp // use IP0 so save SP > #define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS] > #define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS] -=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 (#109201): https://edk2.groups.io/g/devel/message/109201 Mute This Topic: https://groups.io/mt/101600803/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-