From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uqawLW2vkGiVtQMAWB0awg (envelope-from ) for ; Mon, 04 Aug 2025 09:02:37 -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=iRRuQmIF; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A80611E102; Mon, 4 Aug 2025 09:02:37 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.1 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_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham 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 B14FA1E091 for ; Mon, 4 Aug 2025 09:02:35 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04C223858412 for ; Mon, 4 Aug 2025 13:02:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04C223858412 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=iRRuQmIF Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by sourceware.org (Postfix) with ESMTPS id 354CD385840E for ; Mon, 4 Aug 2025 13:01:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 354CD385840E 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 354CD385840E Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=192.198.163.18 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1754312495; cv=fail; b=Ox4oTkI1W30Ed0QV3W99YlGFuHED8IY2rI2Lm+jjPxS8qNujJiC15rpWa/mIarFMZ4FdsRHCaidmueTzTxGBNP/QTpz3OuduKPOy00dMyYaMU3EyXWjnyyZYes0d7LzE5t2gV1oSCtf51TWVJVDYQqlBV43TckTLsfVOO5B49MQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1754312495; c=relaxed/simple; bh=WT4Y3o2UzgJ38uhZngHZLCfy6mE3GSz5q2clxL9t79w=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KWev27OFGGDH1Czdo32zFG9T+4N/vrDfo+Kpa8cAWgSJoEVucNCo748SVkb0vEULS5RDU5EwkLemTEGZr98UCu2ZTlYbR4E+UWmYVBXCNY0hPgwn0NyDSQ14yUSYK6MMFO/cQoCuWZMnbfcPLn38ogDqoemjritA/j3bfeV1NRI= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 354CD385840E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1754312495; x=1785848495; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=WT4Y3o2UzgJ38uhZngHZLCfy6mE3GSz5q2clxL9t79w=; b=iRRuQmIFuHLCaTGDg9/BSb+TlWcvIPphcvq3XrSqvn0AJ9gyQpjHQVMV 8JbuTuqGWI2hKnc1J77LTlr9tos6GPtS5jRqojBx7idO3pLkw8vO87YCc d/AqE7CpcJphfCi4lhHWAKzEYtdo63EX1i24Q1+FlqfSl7BrfpTr0PLl7 ru7NU9YAq1/EyT1zkafcAoq07QTGzaxDLx5nIijm8Zui0ucpRQWAJxjLO EMddzYn9D6XSXB/+lf4i9E1ynZfKI8CP0jXlbmGqf+hVOPVOAzaDhxT+0 dThWL+bMOV9TuxfgrYKruLrlzZvnCKnOoQgGj0ilx1xDgs4J/iv8pHojG Q==; X-CSE-ConnectionGUID: JAZzz9GHTgSl4GCUWLlAJg== X-CSE-MsgGUID: vNDq0aIASEuBA0Tz9lY3kg== X-IronPort-AV: E=McAfee;i="6800,10657,11511"; a="55776475" X-IronPort-AV: E=Sophos;i="6.17,258,1747724400"; d="scan'208";a="55776475" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2025 06:01:32 -0700 X-CSE-ConnectionGUID: 7ICFKDEmQPKSHkaBZuXY9Q== X-CSE-MsgGUID: 9vLXz2tOQ6Ocayz5Izs3NQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.17,258,1747724400"; d="scan'208";a="164077848" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2025 06:01:30 -0700 Received: from ORSMSX903.amr.corp.intel.com (10.22.229.25) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.26; Mon, 4 Aug 2025 06:01:29 -0700 Received: from ORSEDG903.ED.cps.intel.com (10.7.248.13) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.26 via Frontend Transport; Mon, 4 Aug 2025 06:01:29 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (40.107.102.65) by edgegateway.intel.com (134.134.137.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.26; Mon, 4 Aug 2025 06:01:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YEbk0JxQUUgrYJSp/Cq429MQIG8d7mcVNI4nNYJaTBCCcHHhr1FgNvZFk78Du0rIB3dtAGckGZOSp8kaLizyKWE4mjJyUqt1rYtklcmM7I6t4mFHx5m7JY4lN/mK6p6Zmp++4YoJSiQWBf3b2ZR5pUspHYdu2XEdgzSlypChDoHHK0P1edEprx8QwJcXC87Yp4mYSZ7qbD+ytuF9AqMI4QNGzKLGbq70knZ1k6zR6INiCfhtLx0NWw67j8g3PF6enPT6wyF3Lb+kc+rfXXpVQvybWxGe1Lbkx63hpbLcWpY8yy9EjHJ1npQlwIiRf0juioaxBM99Ho8xVMK3NMWv5A== 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=okRNxZ8jlHwsdt7pjyP5b5Blg38NZCEqgCMFv8DGFEA=; b=hUULR2pX29Xl6nasfSMQEd9/S9zA2nZwbJtjOYQo8nDOS69KwHfoCOK8cyjZV9Ipn5rA6B1ZvfYoEz/n/JzYl/ebxPMgugjf/CUdJz2dcmUhRI6xomFyHZBBLDktWvm8vB0C9xO+azTpf9MHLGgA6U0FAkXJ0E/X0/LC0mkl7slX/CDHP8EtFik2oy46JgfqX9IynwjZQyfGVkwN5FSuEE0grfFGkndvHO3qfsZZL0M8JvSh2PNbrbqsIV7NsnoH8NC9uOE4A4qPcxlGHyxn+4nwQdP/Hm2kAbCs9IrcU6PhAwPBF0ocG/2IZsRKvXeGIGPz6JnwP0taQfgH2+AVeQ== 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 SJ5PPF0D019E8BF.namprd11.prod.outlook.com (2603:10b6:a0f:fc02::809) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.20; Mon, 4 Aug 2025 13:01:21 +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.8989.013; Mon, 4 Aug 2025 13:01:21 +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/A= Date: Mon, 4 Aug 2025 13:01:21 +0000 Message-ID: References: <20250628082810.332526-1-christina.schimpe@intel.com> <20250628082810.332526-12-christina.schimpe@intel.com> <87cy9hdg1y.fsf@redhat.com> In-Reply-To: <87cy9hdg1y.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_|SJ5PPF0D019E8BF:EE_ x-ms-office365-filtering-correlation-id: a9f0eabf-7506-4933-b964-08ddd3570261 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?TeH+7UB5BoarUB063OB/nBMgtX7aFuwlSPv9xzUnB9XbMqokd5iYqAM9x2UA?= =?us-ascii?Q?0Ds2hpRT+qzaiyK+JKgiISfrw9Oi2mSHk3IFD39JSEX4VaGn5ozGydvyG0u9?= =?us-ascii?Q?a4yq88zIVwb35k31DbWHqCIUT4I0bkXxFeAfB7pucX5HQB9VmWGAZ22E/VbM?= =?us-ascii?Q?G1A0Gf7HmsqkhRKWzc1dhRBwlwfxvom+ZW5V4IvkWiQ+O2B+5Jqc9EQopYgU?= =?us-ascii?Q?TvgjuPiK87GOnzR6MACfnJW1Spkh4JsuuBvJT0qX6OOFTZBzXY229+D75Q3S?= =?us-ascii?Q?mFhCiCSs+byNhCF7RDPPCVONzlgYX31YeTe0ZSCZR4oGn5taLRIPZuLraS9b?= =?us-ascii?Q?UqEjGvcMGmja9yl6XU6vZOFJyETf+XFPkuMIYYFiAZ3/jHP+sB5n4lYFzOnc?= =?us-ascii?Q?VwUs6ZXSehgK9goeISoTXFjGUL4PF+rmnGNVFml9VpOKoDrFzDMms6WR3Ms/?= =?us-ascii?Q?D+zT3r7O3xziFpZK+nkowSXT3JDhRS5Qi9Gce+1eZxevOH3wFrSRniwC6WEl?= =?us-ascii?Q?gBA0lQ0nuvqLX3cfl3/1zf/1Cn51r/JvMMwrHevLwJ7+94SUdmavi6qqAvIz?= =?us-ascii?Q?GGuv6QVUzI5EonLxlr6EP+zUfQr5EyIf8GO/PzIYD51J2OSvnwgaGOFj7LgR?= =?us-ascii?Q?SRpLAcQ/MaGP+Hdee+C0CrGoc/6aXNeePcMmPqli38kd31ugV7vcOgteN3mV?= =?us-ascii?Q?1VyCoVWo5GN4QeJ87nwg2tdAUpW7+kAjjhk3HJBmFStUaefBRE5eJga1XBkj?= =?us-ascii?Q?ht0xZH+bSRXoJhEoEY0/N/PmXyhR/pkBkxexpqW4CE9Z+r1byozfj1FCtYt+?= =?us-ascii?Q?SAS20txJghaNYGBq04hnBk0wCNY3uUFE3FS1gpp52hkxCGS/EVccGft2I310?= =?us-ascii?Q?yqZObqrw3Pf0/yfi+2WJ/d78wBLbzwqsQZiK5nny8om6NBzfodOlgutQKwyc?= =?us-ascii?Q?uL+JKCnB0MvBjt9vFzZTEvpSQkG+eTf3ykuislp0PQb0I7Yl/M8c5bRH+7iI?= =?us-ascii?Q?4RVCK+EhH6sJyt6Rn6zgIKwM2us+7iC5uqeR3k7sJHXepnYIYBQiry92IGNo?= =?us-ascii?Q?0xsLHiNcBtd6R/4SHzfomO9jHOxFbKyO1GNUSqCNm06y2JbOw107Qt9WsZBn?= =?us-ascii?Q?PhJo24E1Iv/YZjGR5pXyUe0L7qiZm5KBXUcNu+NO5uT2hBnpS6tYH/cCxlus?= =?us-ascii?Q?F9XVaX2VqBfXNa6ZNMOe9vZsMcRIIeM8gtLDsq9rifiMkQ7Dga9I19LMujGI?= =?us-ascii?Q?K6rU/qsV5mGB+A7YPWSc8oli1Q35HJjaIWJNvWNOTYPD2d6AT8i/bNsIJpJU?= =?us-ascii?Q?MmV316k0v1apc0vT12kwskLaS/DN01S0g4+vmC5oD07/oM10QnfAZVhW0z2w?= =?us-ascii?Q?Xr8N7rrxvgyLXB0Mml0t/I/HKbFF9XTG3vpk4a2NLUIUyVTMdWbQZAZTity5?= =?us-ascii?Q?29coEVIc1I6XNTh58Lvy6SMenE/9tjb4OCgXAB2hZ5Dva3M/T/Wk9Q=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)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Xl++JNaRmdkmKo8k85cQAXcpSxPEW7bi4+2xGMz1y/mjfzqVN7S22zarHAxB?= =?us-ascii?Q?XZjp5uql+rVMpG2VoZ5GPSqPd8sYsC1u/IP85cmEl10XRexqkHYWRRnSKsWb?= =?us-ascii?Q?HkUuL6+1J9anUKbFg0Rk+9KUdk5/sdC2IXRBQfyWQ9tarhhZTjj53KSTetEF?= =?us-ascii?Q?Etpf/rzX8laXUBxfV3jJQ/OvT8mlF2iSp23HJvXdSa3ttmn88UaMe6mEpiQz?= =?us-ascii?Q?waBhoa2gc640P8aIoice6xnKJ5NFeC8aEeIL2UwlFR08Y+/JPEyo3N1eiQU3?= =?us-ascii?Q?wga0nHA0mJ+FGoUfEL7lvMfGDeXlvMJaXrxAaRp0IBCrbIt5Qtq4Oq4aPNtr?= =?us-ascii?Q?GaWTSHtzjKLwtkRSUFVgh9NqoHU+so59u0sQEdbZhua6HLTqv5VjC8M1XDko?= =?us-ascii?Q?5AeteOpJA81U3KbT0cvJdGtpHqI/lhoEH7YRIyQzTlIrWWrwbop+J6gkpaT4?= =?us-ascii?Q?b38VkFdFb5VQjgaDbwM4NrxSfBIkOFY2zEMQlPB1dLeOBhYN14V1KMgiLuzh?= =?us-ascii?Q?hubPS8FetcyayQWarseAlJXi2TxhTuVs5mZfRhsLs4WBmi9/TQmMwll1TMVp?= =?us-ascii?Q?RggqI9xefB+IBAUoA6IPn7gQxiABgWFL8WaN7LfyKVjV0Gjc9Plt0gQyDPPX?= =?us-ascii?Q?mcjSiAFEHqnI7wn9CD2jP4mbgyszAXfhxs9dsL5LIMuSc+o/uu80AaGxJVKy?= =?us-ascii?Q?+MKdBkaW2yLpquEFOFKS1awuHycMcia2hyFkGLsfi2YsfQVQ7GmO5es4ipjs?= =?us-ascii?Q?CmU9/yav6YAii1O9QMz/bowda3bmNs5DhluKaj3jMODC+MkuFUjuKxBIlHIc?= =?us-ascii?Q?6FIxhT5EOOmPNWa9W50CL5SOdrhUWGeeKH2G5mWAfdVshmNjW6CYPRx8HrvK?= =?us-ascii?Q?T8ZQdwuuG2bda0oPHTpoNr63cYnhZk9rlCBxB/UfOOoa7pNJGkqhavx3h/pk?= =?us-ascii?Q?/NnxLuumHyxmrOu0WwxuWQnZDpvmSdZWGIjibMfGDH6/k2JaVNxUIVdUuxRu?= =?us-ascii?Q?gHV+FKhSWkCwCJBzq9ieiVmXOr3fPIUz3fZUd7JQerGIfk5EDtK0Irp2RgBq?= =?us-ascii?Q?oBcAnCcBam4gWx69zVXSx1lBVN820YMGkKH2wy5VYEx4Odse7gtUwTiFMC/i?= =?us-ascii?Q?qP7Xq5zGIZCTmIFWctqL/2L4/BqyQPwIFId8Fzh4wLKeV8XRrGEp3NcXv5tO?= =?us-ascii?Q?qcL8WR3QhubBs0CuF53iW+334Z8FHQW3CzdbykxmmsebZF4qA+m3HXrVxtwA?= =?us-ascii?Q?ZxotJ8XsJDEafmmucp06lEDmJYUFI/hV87949qNdjdcfsZnL4YqUBUlQlhUT?= =?us-ascii?Q?s8CeHyJpThcZXYkJCe+WW1++AVqlqG6dwn/M6jx2A1e3DZi89YB8cOz3aoAK?= =?us-ascii?Q?TtGuR+9ZLMDlo4msJkfRogjzF09EkxSVh+p84q46vb8tsRr81ynJGGc8uu1v?= =?us-ascii?Q?lVVWBIor03TIj73Xdv1JtyVYFTqcGKgYc/nTozr5FR/PYgb+PDKDMDaE79UP?= =?us-ascii?Q?8tvuRCrXTyIVrXUXuDw4EmskmH15m1HzYQeDWPzQuDbb3hrgr6e3wSsDZo4g?= =?us-ascii?Q?HUagPPdoR2GRPco08H1JmXDvUf4mkFnu5Zlg0v6QrErcCjxHQ7gaCQmIcQ72?= =?us-ascii?Q?oA=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: a9f0eabf-7506-4933-b964-08ddd3570261 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2025 13:01:21.1796 (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: 2GivCt/Kx2KbwFkyyUWzsGxlWoYQocTzrIoNswA8XEr7iu6wiOxUhwECc7K9h2iECLWLTAYuS2PeXYoZ1kwkd8/IClsMLmSLGIqXwqcHFF0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPF0D019E8BF 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 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_pointer > > + 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, invali= d_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 trac= king. > > 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 architecture= s, > 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. */ > > + > > +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 i= t'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 okay t= o 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 cover. > 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 disabled. > 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 the fe= ature 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. = > = > > +""", > > + type=3D"std::optional", > > + name=3D"get_shadow_stack_pointer", > > + params=3D[("regcache *", "regcache"), ("bool &", > "shadow_stack_enabled")], > > + predefault=3D"default_get_shadow_stack_pointer", > > + invalid=3DFalse, > > +) > > -- > > 2.43.0 Kind Regards 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