From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rdgYOYCapGikIgcAWB0awg (envelope-from ) for ; Tue, 19 Aug 2025 11:38:40 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=O0UmK3n/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D4E4C1E0B3; Tue, 19 Aug 2025 11:38:40 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 309471E047 for ; Tue, 19 Aug 2025 11:38:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A16DD385B516 for ; Tue, 19 Aug 2025 15:38:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A16DD385B516 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=O0UmK3n/ Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by sourceware.org (Postfix) with ESMTPS id 8C63D3857B84 for ; Tue, 19 Aug 2025 15:38:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C63D3857B84 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C63D3857B84 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=198.175.65.16 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1755617882; cv=fail; b=SaEgH9xDHM7/5flAjKGqh2jjDvmu72+cUxV/2FRXDnCftQpnvwvvsrfnTUSuIKkj55L+LLZagA4seGI4UCaR1cxj9nQTLZqECYey/rvkWipDNnarb5AlWj08MFbWHO7pY6zzW8Kx7qAXaEgjHrxRLNK2Ddjk49ozyY2gYnkf3HY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1755617882; c=relaxed/simple; bh=ZAu9uuf2HrNICZk0gshQ24cLhVQMaxHIXAJdpODPYIs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=NJGy+oPq4eJSqxQu/Lokv5fJdRcESSbf8JzsEWRu1fGAA77uJ8zL2d+fH4W+XE8fgqjc1OHgY0PegiD0kHf2M5VyvVvD+bT9u1d/c59S60Re4AiO3bKj0C2plNqtgKGkXEJsT4pKrj5ZsQtjInqXSR1Y9wLsfBx2H9oPJG2Qid0= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C63D3857B84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1755617882; x=1787153882; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=ZAu9uuf2HrNICZk0gshQ24cLhVQMaxHIXAJdpODPYIs=; b=O0UmK3n/PM5577Mzj8tv2HMUXKPgy+1J4TAs5C7skvw3DW/OQI5eEvVS t0E9de6xt3aZksxtj/tptW5qxHXNiIBacgvKmZ+4gTxy1MtvuDNgMKbVM meDt0N8y3a2uIySXF0vFSCc/YRyj4sinSwEk7HgZKEKST6XS07/lfH5E2 CDaf/Tah1uhoFgEs0dwbj9hqVVofRs9GC2c2raCRIIV+FZGiTYCnl3Or4 xX8wB4YqfNEc2UaDrFq0W1JKWTa8jBVNhI7w7M62Us5vsno8fIPRwKiZp 06oExu0bs2aYg+OpQqJRmLeefmMfk3zhorPX3z6qoCy2tJi7qOJcCSsop g==; X-CSE-ConnectionGUID: 89aVR/oTSqSH4zDSGAMdTg== X-CSE-MsgGUID: U9cdmGnuQlm2nmDSisbB0g== X-IronPort-AV: E=McAfee;i="6800,10657,11527"; a="58014066" X-IronPort-AV: E=Sophos;i="6.17,302,1747724400"; d="scan'208";a="58014066" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2025 08:38:01 -0700 X-CSE-ConnectionGUID: T8DA7mkgRZCQ8CI/OSNwDQ== X-CSE-MsgGUID: K+gtnnMqQ4qRiMMEsWHmQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.17,302,1747724400"; d="scan'208";a="198885023" Received: from fmsmsx902.amr.corp.intel.com ([10.18.126.91]) by orviesa002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2025 08:38:01 -0700 Received: from FMSMSX902.amr.corp.intel.com (10.18.126.91) by fmsmsx902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 19 Aug 2025 08:38:00 -0700 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17 via Frontend Transport; Tue, 19 Aug 2025 08:38:00 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (40.107.92.86) by edgegateway.intel.com (192.55.55.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Tue, 19 Aug 2025 08:38:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SHA7WuduA4RGTWSk2C3mcTuBPhLVB8q0hoIuhCesJJ3APZ2ob1O/GgjxDTzBjzRseMAQd6q3HVm3K8aN+CMOL+MrV/woGV2sYYillp2wkrH+F8lOhtqAl7XiDeroepVkQet49kuKnBI0gS0SEiEOlGDLkoCAicEYzsUpK8UhHVQJ69xGThLMiJQpoq6BDDHg5mf/qqGhfUUIhA8soDL7qv8sLmecO8oGkWWg9YfGJABg+c20QOad5/qQwym1i5eKWMrxY/QNHc3FbEd3+cKXW/fNkBeJpBskPgesxgF8POqsJi/9TEPFOLndDIhawUj6ykD1/CVVofQra04xsBdlIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CmcaRR10vd9+raDqOgpVlriQcnIEzt960HDfNjf08+M=; b=NHCmhiqgTRIKts0E/RNXJRg0OEM6C9SeZNLsRvoVdki34qnDvlzQldkxwuPA0wg9PeB8PjFcyi1AGq2fcieMi8qcfzy+5LSwRFyuv5NQT0MRsxn7ZJHfqReYzklJniKiZE3gaKgXiaDMvbAcFdSwfaZtbb+cmMuS+X7NhehytLarybc1BWCiThnADdPorn++9/m1UpjUTJwoERpvdmhLKRtshT7ZoR+nink3YkLS168c0zJ2Dt926tCicbdQAQ1Ih8uVlz6OBb8GNUYSzTDvi/4c7w4JE7PyknQj1pLjbIWOCgXp/tkfYM2kRhrDfI62Qn3c3lLg5oqTJxbYLH/lZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN7PR11MB7638.namprd11.prod.outlook.com (2603:10b6:806:34b::22) by SA0PR11MB4752.namprd11.prod.outlook.com (2603:10b6:806:99::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9031.24; Tue, 19 Aug 2025 15:37:57 +0000 Received: from SN7PR11MB7638.namprd11.prod.outlook.com ([fe80::25b8:16dc:755e:34d1]) by SN7PR11MB7638.namprd11.prod.outlook.com ([fe80::25b8:16dc:755e:34d1%5]) with mapi id 15.20.9031.023; Tue, 19 Aug 2025 15:37:57 +0000 From: "Schimpe, Christina" To: Andrew Burgess , "gdb-patches@sourceware.org" CC: "thiago.bauermann@linaro.org" , "luis.machado@arm.com" Subject: RE: [PATCH v5 11/12] gdb, gdbarch: Introduce gdbarch method to get the shadow stack pointer. Thread-Topic: [PATCH v5 11/12] gdb, gdbarch: Introduce gdbarch method to get the shadow stack pointer. Thread-Index: AQHb6AfILO5oBq+lUESTpazkN9p6nbRKyR2AgACW7/CAFzZGgIAH1w1Q Date: Tue, 19 Aug 2025 15:37:57 +0000 Message-ID: References: <20250628082810.332526-1-christina.schimpe@intel.com> <20250628082810.332526-12-christina.schimpe@intel.com> <87cy9hdg1y.fsf@redhat.com> <87ikip9a24.fsf@redhat.com> In-Reply-To: <87ikip9a24.fsf@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN7PR11MB7638:EE_|SA0PR11MB4752:EE_ x-ms-office365-filtering-correlation-id: f1dd2763-82ab-4450-5258-08dddf365f28 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?lefHnQVL8EXaZUXupmuSm61qY4zp9jkqk0PyoolZF+qEuPOOC/SHvEUKtGaa?= =?us-ascii?Q?TB54u2rl/MU5Bvu8V+vg2V2mqLt58nxMFywh9ClGu0UEUmJvE3ZQKVhalAxE?= =?us-ascii?Q?NtLrzlU8T3qe5CUKmM2+Hi2MJa7TfE6Dc+m8bvSpkB3AIMT4FHZ7rvhhvESg?= =?us-ascii?Q?cgyfEJJKXp7TZnmF0zUJ3sEkSgeh9FRkHlNyAbMSfYFhmBbMFeysxEAElYJd?= =?us-ascii?Q?21fGZMQ/X3Xquw4xXhhpZE34QtVOgkQ6zUqOvag2skChqZij8cjXt9NX6kG1?= =?us-ascii?Q?VcLdneqj9IfG17+9saB4I0Kq/MUA5h5ZPdbgRD1ovqWmqmtVHPV4OR0H38FT?= =?us-ascii?Q?MYWvVyq59SSEbQXKbDEXbXqi6a/hP8Z+8rZYyx8fnMde3z2gDBdLFd70Seua?= =?us-ascii?Q?qdW5TSikd2F5qlTsAkWdplo//SpMtmwaSBi+HJQC4sfoPDL9dAk/FI4oYBui?= =?us-ascii?Q?caYUx3AWsJ/TuHGL/xpPexrOyrYWX3EMtzM4zcdHu4P2sSudZYGhD475oz/i?= =?us-ascii?Q?rGHYtTyG/+Oldlr6pzZrStlqaj9ve4bKkUcBEjfLY/hIx91s8R/nrnjzy35R?= =?us-ascii?Q?WUXS2cUGNErkSpPDuIMmOVBa/8IA/SyiGBTqZXkmro5H8b0GiiknG4Jmdd3L?= =?us-ascii?Q?Cmzn0njPJCTjKAkVQU3ctAOsjNn7lIQNYtO1fdXhcYEOBDGjTUDnz1dRRub8?= =?us-ascii?Q?Pgp8tOu1FGzLTKajWwwdFf4Q5vo73jo0L7IWyiQKuJbomx97CsDXoMl211nz?= =?us-ascii?Q?7Sa6eoOQluFhyQDgcguryBgUu6ztcyqv9xDtZSoxdPamWD55GOwCMrnROhK8?= =?us-ascii?Q?lgbP2uZUu1U5hXqbFYAlc/OUBCegH2OtSn+VJJ9QFUlnpJYPMvztAuKvb8Ek?= =?us-ascii?Q?Dv4kM33HIMfDA8Ha2M3UsSOqnWAdqiyYIp942XMpKS26AnQfY/NWS5vEOyuY?= =?us-ascii?Q?yOO1BSpEjCLX0WMT8Sp987G6h5ibgdhP+wFzSniTrE7XX9du9iTQoaHVUsqw?= =?us-ascii?Q?Y6sC9ZkUAR8P6z0gNaUCo5nUSnMkF0dfHMDltR7F0xhI3WtPBIPdHrD8lx05?= =?us-ascii?Q?blFygeRw2Ta2XqIR5i6q2YM1jvcsfmthgJ2TM7Ke4fwIJJhMTPZm01IA2pMN?= =?us-ascii?Q?V+1nxPL4AT/XVw9uiWO4rUPBAgxueykMQoL007HN4cx0FlgQaSxmBtA2rzQl?= =?us-ascii?Q?Q/QdlAx7pZHM9T5MVl29yY0fG5Lwy1Z9qri6tDOVMDhRUIKztHqj0ofD46l3?= =?us-ascii?Q?t+s1KZUF1qpDPRXQ49R+mePaM1XwildJgIoTNkKs8aAcHSN5v451KmczWVSx?= =?us-ascii?Q?I8fzfMFaH/1jXXUyWV4Y5VsfSeXngg3wRturBoYPKOgiMS25E+QiFVdnGSDK?= =?us-ascii?Q?zieZLzQXGfvKE1zGBKnDYLSSNSK2P6v0aWGI4FR0iE0VwAOlmMdjOa0PytfG?= =?us-ascii?Q?O6fQ00FEYvVIVfCM5VXDIJyY9ZZwt8xRRz5W3iDRyvu/surUfs5GFg=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7638.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4B/+UM4LYLpokirlANz+zNfrenTcV0kCdLhXrkQoWoCRkhyx9k5sP5wC+q79?= =?us-ascii?Q?9oFSInZQZYtgPqN4Urwaq8H+Tq3qJi0Aceh/cKpZUNKkq9ARnYlGBZafMLUA?= =?us-ascii?Q?Ukz6Ry0pG1UPvVgzOf1fGYdjN9HHWmHPGWSXqtYRMgKs53AT+Sl+g3yUMH1A?= =?us-ascii?Q?0zTLW4jbXevcULkoekx8lUw39A1HvJiYdn/y0YULWG5jyUhVDxyXFhQ7OkWm?= =?us-ascii?Q?qwAfaXCRmIT2g6sh1iGCV/OlrA37mxbUjI+NolnB2dwtlFIMDo38UwBqY1oj?= =?us-ascii?Q?ZiamvG04/NNiE6yaPisb5KLEBJ8Jy/AlNf+KbBtaeObseMvv/HGgOWtfWgn3?= =?us-ascii?Q?SwAPXHnbiTpoqR1FlI9b+qSlsvueOI0JNrtk+2A+Ll0/AILibUnMb/1e5Mq0?= =?us-ascii?Q?Bq+tzYRzfHWoXpUwjl7jqH26Dalk1bn3h687jE+DeUFg03xL5OLE14+hs4w5?= =?us-ascii?Q?stwoWcwMs37Vd2jzCZC0wO6nFseYfw287Q3dMnfhWCHWrAIx99CSMJAzRztF?= =?us-ascii?Q?7k65+/bNeRUJPJl4jVV5QLIh4agYbM1hqa4Ql1VyOD4V0jvOAVKCOFk3/4Xz?= =?us-ascii?Q?XPkbCcmdUVgpcTM/ms3ztQ2jV+myQvnYdEh1Zbw+OHTotBT/8MApCRCwSIJK?= =?us-ascii?Q?iKO5IgeyOGPHixvlgVdDNJYlhugTqSh5n0BLpClg1GBhmN89S2yH1txHzz0b?= =?us-ascii?Q?COYUjvb7yX9NiJzuy08ZekNHpEicBEOI//zGrUf3mhqdrJIlZFH5fC1UIA/1?= =?us-ascii?Q?UgD7hDMws+sWt+Nuc7OYiZST7NC2A5jIhi9bhajGdkXNymrzXTwWq8J1pC+l?= =?us-ascii?Q?4PMo9pPH7P7RowvZwEnqF0lJa7Dkb+f/VOfPA/aeoRCux/S/10UE3d6O+9ij?= =?us-ascii?Q?zAigjpLdw5pz8Lp002XlG3RNJCz74sPgIRI4MV+QD8633cuffCgkn5cxFnEL?= =?us-ascii?Q?YYOfz/RH3ul2gz4iSf+rfWr1Lc/5m1z1Mryyy/iMeeZYmvY2zZgxeujLelpn?= =?us-ascii?Q?FEsyOARfTR0mu0jfaOijr5+7oMCgW4QPpOJvbTqVh4XMvgfqdcfYjS95ZLr7?= =?us-ascii?Q?oOqmK9RGpeeezVTaEBVry1qgRJ1ia8eEqxKLKy++KtP9V9MjXy+dsxV4pA0J?= =?us-ascii?Q?FDVHVqW8D/ioOKsW9jlg3UmHKTAtCRfz3SFq0QZIgBxI8I4xZh/vwY/aGd89?= =?us-ascii?Q?q867PbjEwSvZfhA6ICu+yr4BGfjgVq7rtPymaQhVC4waPoBE593MKYynvmjR?= =?us-ascii?Q?lEaOoxt+/zZjix4YynBNza2Cjk/KVC0OX2iOD6ddpAXfov1IzMm9gIgyMn1a?= =?us-ascii?Q?okiX1gCyZyQVsoIjAkU1EFEpzar9fXwjpil4/3a+8WOuih2erYdP/nU34vG/?= =?us-ascii?Q?lNXhpzSxxBSwwt5D1z5hw0H2x2ltcjU9vnLoW06x52I4kFnZRcxF2ZGHYKyw?= =?us-ascii?Q?XcLDekItZgijX1OZXCpXOpWh53VqrnvCtUyXMWUK7HBq/ljhK7RN+QFMhQeM?= =?us-ascii?Q?6bDDdqvm6bRMP00iB9Rl564fywhZdMUql8OXHI3SzmInEPHfIIfsydz3ERN0?= =?us-ascii?Q?gJlhsid1785v9POJlN1uZ7XcL77EXC6P4qdPSPUKTVU0c/5dEPmrfns47Fic?= =?us-ascii?Q?rg=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7638.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1dd2763-82ab-4450-5258-08dddf365f28 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2025 15:37:57.3855 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cR8sxvzusWWoDzuw0AJrrNqDJay9/4IXqBqWgSakT1Ke4JzWS98Z/dsgS5gu2925fJwNim1zY41yZCy1qwSnTsxQJ+6IF+FA9GwdEMYf00g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4752 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi Andrew, Thanks a lot for the feedback. > -----Original Message----- > From: Andrew Burgess > Sent: Thursday, August 14, 2025 5:51 PM > To: Schimpe, Christina ; gdb- > patches@sourceware.org > Cc: thiago.bauermann@linaro.org; luis.machado@arm.com > Subject: RE: [PATCH v5 11/12] gdb, gdbarch: Introduce gdbarch method to g= et > the shadow stack pointer. > = > "Schimpe, Christina" writes: > = > > Hi Andrew, > > > > Thanks for the feedback. Please find my comments to your feedback below. > > > >> -----Original Message----- > >> From: Andrew Burgess > >> Sent: Wednesday, July 30, 2025 2:22 PM > >> To: Schimpe, Christina ; gdb- > >> patches@sourceware.org > >> Cc: thiago.bauermann@linaro.org; luis.machado@arm.com > >> Subject: Re: [PATCH v5 11/12] gdb, gdbarch: Introduce gdbarch method > >> to get the shadow stack pointer. > >> > >> Christina Schimpe writes: > >> > >> > This patch is required by the following commit > >> > "gdb: Enable displaced stepping with shadow stack on amd64 linux." > >> > > >> > Reviewed-by: Thiago Jung Bauermann > >> > Reviewed-By: Luis Machado > >> > --- > >> > gdb/arch-utils.c | 10 ++++++++++ > >> > gdb/arch-utils.h | 5 +++++ > >> > gdb/gdbarch-gen.c | 22 ++++++++++++++++++++++ > >> > gdb/gdbarch-gen.h | 12 +++++++++++- > >> > gdb/gdbarch_components.py | 17 ++++++++++++++++- > >> > 5 files changed, 64 insertions(+), 2 deletions(-) > >> > > >> > diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index > >> > f320d3d7365..c396e9e3840 100644 > >> > --- a/gdb/arch-utils.c > >> > +++ b/gdb/arch-utils.c > >> > @@ -1218,6 +1218,16 @@ default_gdbarch_return_value > >> > readbuf, writebuf); > >> > } > >> > > >> > +/* See arch-utils.h. */ > >> > + > >> > +std::optional > >> > +default_get_shadow_stack_pointer (gdbarch *gdbarch, regcache > >> *regcache, > >> > + bool &shadow_stack_enabled) > >> > +{ > >> > + shadow_stack_enabled =3D false; > >> > + return {}; > >> > +} > >> > + > >> > obstack *gdbarch_obstack (gdbarch *arch) { > >> > return &arch->obstack; > >> > diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index > >> > 1509cb7441e..14a84b74733 100644 > >> > --- a/gdb/arch-utils.h > >> > +++ b/gdb/arch-utils.h > >> > @@ -414,4 +414,9 @@ extern enum return_value_convention > >> default_gdbarch_return_value > >> > struct regcache *regcache, struct value **read_value, > >> > const gdb_byte *writebuf); > >> > > >> > +/* Default implementation of gdbarch default_get_shadow_stack_point= er > >> > + method. */ > >> > +extern std::optional default_get_shadow_stack_pointer > >> > + (gdbarch *gdbarch, regcache *regcache, bool > >> > +&shadow_stack_enabled); > >> > + > >> > #endif /* GDB_ARCH_UTILS_H */ > >> > diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c index > >> > a4b72793fd8..caeda3cefae 100644 > >> > --- a/gdb/gdbarch-gen.c > >> > +++ b/gdb/gdbarch-gen.c > >> > @@ -263,6 +263,7 @@ struct gdbarch > >> > gdbarch_use_target_description_from_corefile_notes_ftype > >> *use_target_description_from_corefile_notes =3D > >> default_use_target_description_from_corefile_notes; > >> > gdbarch_core_parse_exec_context_ftype *core_parse_exec_context = =3D > >> default_core_parse_exec_context; > >> > gdbarch_shadow_stack_push_ftype *shadow_stack_push =3D nullptr; > >> > + gdbarch_get_shadow_stack_pointer_ftype *get_shadow_stack_pointer > >> > + =3D default_get_shadow_stack_pointer; > >> > }; > >> > > >> > /* Create a new ``struct gdbarch'' based on information provided > >> > by @@ -537,6 +538,7 @@ verify_gdbarch (struct gdbarch *gdbarch) > >> > /* Skip verify of use_target_description_from_corefile_notes, > >> > invalid_p > >> =3D=3D 0. */ > >> > /* Skip verify of core_parse_exec_context, invalid_p =3D=3D 0. */ > >> > /* Skip verify of shadow_stack_push, has predicate. */ > >> > + /* Skip verify of get_shadow_stack_pointer, invalid_p =3D=3D 0. = */ > >> > if (!log.empty ()) > >> > internal_error (_("verify_gdbarch: the following are invalid ..= .%s"), > >> > log.c_str ()); > >> > @@ -1414,6 +1416,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct > >> ui_file *file) > >> > gdb_printf (file, > >> > "gdbarch_dump: shadow_stack_push =3D <%s>\n", > >> > host_address_to_string (gdbarch->shadow_stack_push)); > >> > + gdb_printf (file, > >> > + "gdbarch_dump: get_shadow_stack_pointer =3D <%s>\n", > >> > + host_address_to_string > >> > +(gdbarch->get_shadow_stack_pointer)); > >> > if (gdbarch->dump_tdep !=3D NULL) > >> > gdbarch->dump_tdep (gdbarch, file); } @@ -5583,3 +5588,20 @@ > >> > set_gdbarch_shadow_stack_push (struct gdbarch *gdbarch, { > >> > gdbarch->shadow_stack_push =3D shadow_stack_push; } > >> > + > >> > +std::optional > >> > +gdbarch_get_shadow_stack_pointer (struct gdbarch *gdbarch, > >> > +regcache *regcache, bool &shadow_stack_enabled) { > >> > + gdb_assert (gdbarch !=3D NULL); > >> > + gdb_assert (gdbarch->get_shadow_stack_pointer !=3D NULL); > >> > + if (gdbarch_debug >=3D 2) > >> > + gdb_printf (gdb_stdlog, "gdbarch_get_shadow_stack_pointer > >> > +called\n"); > >> > + return gdbarch->get_shadow_stack_pointer (gdbarch, regcache, > >> > +shadow_stack_enabled); } > >> > + > >> > +void > >> > +set_gdbarch_get_shadow_stack_pointer (struct gdbarch *gdbarch, > >> > + > >> gdbarch_get_shadow_stack_pointer_ftype > >> > +get_shadow_stack_pointer) { > >> > + gdbarch->get_shadow_stack_pointer =3D get_shadow_stack_pointer; } > >> > diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index > >> > 71142332540..c36171b089e 100644 > >> > --- a/gdb/gdbarch-gen.h > >> > +++ b/gdb/gdbarch-gen.h > >> > @@ -1807,7 +1807,8 @@ extern void > >> set_gdbarch_core_parse_exec_context (struct gdbarch *gdbarch, gdbarc > >> > technologies. For example, the Intel Control-Flow Enforcement > >> Technology > >> > (Intel CET) on x86 provides a shadow stack and indirect branch t= racking. > >> > To enable shadow stack support for inferior calls the > >> shadow_stack_push > >> > - gdbarch hook has to be provided. > >> > + gdbarch hook has to be provided. The get_shadow_stack_pointer > >> gdbarch > >> > + hook has to be provided to enable displaced stepping. > >> > > >> > Push NEW_ADDR to the shadow stack and update the shadow stack > >> > pointer. */ > >> > > >> > @@ -1816,3 +1817,12 @@ extern bool gdbarch_shadow_stack_push_p > >> (struct > >> > gdbarch *gdbarch); typedef void (gdbarch_shadow_stack_push_ftype) > >> > (struct gdbarch *gdbarch, CORE_ADDR new_addr, regcache *regcache); > >> > extern void gdbarch_shadow_stack_push (struct gdbarch *gdbarch, > >> > CORE_ADDR new_addr, regcache *regcache); extern void > >> > set_gdbarch_shadow_stack_push (struct gdbarch *gdbarch, > >> > gdbarch_shadow_stack_push_ftype *shadow_stack_push); > >> > + > >> > +/* If possible, return the shadow stack pointer. On some > >> > +architectures, > >> the > >> > + shadow stack pointer is available even if the feature is disable= d. To > >> > + return the feature's enablement state configure > >> SHADOW_STACK_ENABLED. > >> > + Set it to true in case the shadow stack is enabled. */ > >> > + > >> > +typedef std::optional > >> > +(gdbarch_get_shadow_stack_pointer_ftype) (struct gdbarch *gdbarch, > >> > +regcache *regcache, bool &shadow_stack_enabled); extern > >> > +std::optional gdbarch_get_shadow_stack_pointer (struct > >> > +gdbarch *gdbarch, regcache *regcache, bool &shadow_stack_enabled); > >> > +extern void set_gdbarch_get_shadow_stack_pointer (struct gdbarch > >> > +*gdbarch, gdbarch_get_shadow_stack_pointer_ftype > >> > +*get_shadow_stack_pointer); > >> > diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py > >> > index abc79588473..73459064170 100644 > >> > --- a/gdb/gdbarch_components.py > >> > +++ b/gdb/gdbarch_components.py > >> > @@ -2855,7 +2855,8 @@ Some targets support special hardware- > >> assisted > >> > control-flow protection technologies. For example, the Intel > >> > Control-Flow Enforcement Technology (Intel CET) on x86 provides a > >> shadow stack and indirect branch tracking. > >> > To enable shadow stack support for inferior calls the > >> > shadow_stack_push -gdbarch hook has to be provided. > >> > +gdbarch hook has to be provided. The get_shadow_stack_pointer > >> > +gdbarch hook has to be provided to enable displaced stepping. > >> > >> I find the addition of this last sentence here a little strange. > >> While it's a true statement, wouldn't this be better placed on the > >> comment for get_shadow_stack_pointer? > > > > Mh I see the initial comment section here rather as general overview > > for the shadow stack feature in GDB. It explains which features (e.g. > > infcalls and displaced > > stepping) are interacting with shadow stacks. So in my opinion it's ok= ay to > keep it as is. > > > >> > > >> > Push NEW_ADDR to the shadow stack and update the shadow stack > >> pointer. > >> > """, > >> > @@ -2864,3 +2865,17 @@ Push NEW_ADDR to the shadow stack and > >> update the shadow stack pointer. > >> > params=3D[("CORE_ADDR", "new_addr"), ("regcache *", "regcache")= ], > >> > predicate=3DTrue, > >> > ) > >> > + > >> > +Method( > >> > + comment=3D""" > >> > +If possible, return the shadow stack pointer. On some > >> > +architectures, the shadow stack pointer is available even if the > >> > +feature is disabled. To return the feature's enablement state > >> > +configure > >> SHADOW_STACK_ENABLED. > >> > +Set it to true in case the shadow stack is enabled. > >> > >> The wording "configure SHADOW_STACK_ENABLED" seems a little strange. > >> Also, there's a bunch of important detail that this comment doesn't co= ver. > >> Here's what I'd suggest, though it's possible this doesn't match the > >> implementation (I haven't checked the next patch yet), but this does > >> match default_get_shadow_stack_pointer. Feel free to take any of > >> this that is > >> useful: > >> > >> If possible, return the shadow stack pointer. On some architectures, > >> the shadow stack pointer is available even if the feature is disable= d. > >> If the shadow stack feature is enabled then set SHADOW_STACK_ENABLED > >> to true, otherwise set SHADOW_STACK_ENABLED to false. The > >> SHADOW_STACK_ENABLED will always be set if this function returns a > >> value. If the function doesn't return a value then the state of > >> SHADOW_STACK_ENABLED is undefined. > > > > Hm, I am not sure if I am missing something here. > > > > We set SHADOW_STACK_ENABLED to false in > > default_get_shadow_stack_pointer and *do not* return a value. > > ~~~ > > std::optional > > default_get_shadow_stack_pointer (gdbarch *gdbarch, regcache *regcache, > > bool &shadow_stack_enabled) > > { > > shadow_stack_enabled =3D false; > > return {}; > > } > > ~~~ > > > > What do you think about the following: > > If possible, return the shadow stack pointer. If the shadow stack > > feature is enabled then set SHADOW_STACK_ENABLED to true, otherwise > > set SHADOW_STACK_ENABLED to false. > > On some architectures, the shadow stack pointer is available even if th= e feature > is disabled. > > So dependent on the target, an implementation of this function may > > return a valid shadow stack pointer, but set SHADOW_STACK_ENABLED to > false. > = > That's great. Could you also add a sentence similar to the one added to > shadow_stack_push that get_shadow_stack_pointer must be implemented in > order for displaced stepping to work. > = > I still don't understand why you want to document that detail in the comm= ent > for shadow_stack_push, but I don't think it's going to do any harm. But = I do > think details about get_shadow_stack_pointer should be documented on > get_shadow_stack_pointer! I totally agree, otherwise there is the risk that this is overseen. I'll change it to: If possible, return the shadow stack pointer. If the shadow stack = feature is enabled then set SHADOW_STACK_ENABLED to true, otherwise = set SHADOW_STACK_ENABLED to false. This hook has to be provided to enable displaced stepping for shadow stack enabled programs. On some architectures, the shadow stack pointer is available even if the feature is disabled. So dependent on the target, an implementation of this function may return a valid shadow stack pointer, but set SHADOW_STACK_ENABLED to false. > = > With that extra sentence added: > = > Approved-By: Andrew Burgess > = > Thanks, > Andrew Christina Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928