From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wHA1CBEupGe31iUAWB0awg (envelope-from ) for ; Wed, 05 Feb 2025 22:35:45 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=R8qh8+QE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1D6991E105; Wed, 5 Feb 2025 22:35:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 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 B44391E05C for ; Wed, 5 Feb 2025 22:35:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 61BB93858431 for ; Thu, 6 Feb 2025 03:35:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61BB93858431 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=R8qh8+QE Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id D91583858C51 for ; Thu, 6 Feb 2025 03:35:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D91583858C51 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D91583858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738812918; cv=none; b=A9+N5qKLOX4KSkRiQnfojQ1g+9t4ADNzOA0cFj1gJSYexuLf8/8EIUw7Nl0nY3KIJu1a6frrlmoOBkY7y0OXyKQvR1haJnTdFfOq9lhrvRyg5w1DyBk1dVSHjx02QswnUa4iV+9NvyypTTtQ0cU4WxVwyxTPCrcemKLauyVJVoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1738812918; c=relaxed/simple; bh=tOqmp3r4WtBXn95Z6O23+W0p3Uc35sN8zFDT6jN0x8A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cpurU4F5pDI5aQpQmHwsuy2HTu3N9iZs8mkFL4xeLQedD8974n6oKgzqcFB4uYdFRuTzHgvqwxC6PVSD/UlF0bpae2n9wxkB/i/UgChvH6kIPSq9DORtk5ZA0KGOg9QlqiYNtBJAjfVl3BKJTYFjeWG+x8KMoyr7tyytZJgVQRQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D91583858C51 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-2164b662090so9312025ad.1 for ; Wed, 05 Feb 2025 19:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738812917; x=1739417717; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ha6yCJQnkeY0DERo8yUMUQ3amTAznMgJtzzrbAx0uAs=; b=R8qh8+QEETT0C+E4BZBEHAVaymEDbMw72YPGYy2UXYyAv/291oltP6EB3EKaHBVhVv a2XChn1Q4IXRLqOkBY7p7NvNndBPBUFOME7ur8fR8A77rpv8BQlcpjQUzXFK7EtH9q8Q jp/BM1sJu9MRRFiEK/BFDgkM6mGgbI3IOJq3Fg0zkca78GoMD1W75acL8cTyvwwrRfNK VTeysG2fJfO12h/LB1cCD97s1neav8YQsi8z3C2Sp8vUoCiCzXtHOzoZyqlGu8NW/yOX 0lN9MMxl54bF1iJQB7/1hcqatm46u7Z/btBglCQWAkKcilpSVLIGlDWJzTt9SdqGfuq/ DyOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738812917; x=1739417717; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ha6yCJQnkeY0DERo8yUMUQ3amTAznMgJtzzrbAx0uAs=; b=S01Gyi2h6mM6rW/hgyijUP/BjA1NLBQek7D64FcIjeHh3dSvrjF8TmIP89ZgUfoUWS 6fghPDVoIukZCtQwSnI1ZqUjGR4DKFoCpLH/0y6ON/XLRNyDtQjlcdfCHFbPQoweqQq8 9fBVZD2LCcL9E10qOFKeOKkB2uKVyHCGHq9csirQ+mXl9QCb/aGiooOFCP0QZDv9xtSv qD1egiC1D6N83rfot5IagwLKra+nXsJynFwa4EKIjURa8yIVI7h5GqzcZYvi8aWwwGiq q1Mm0PsBO+kPA4teMDVLkM9sely+kl1lvb/+l3QJPst69G/8Qlf2XSCjRiA0YxFPGU9N 1ofw== X-Gm-Message-State: AOJu0YxbPvn2tHSorw2fNu9vsvXWj2emJIpuQdTbMGlKDNVe4pcewMBD pVRfx5MkLfyhJSXGXqWaYnrgaz4KigUziuMf6zgTarooK28P9TyNoVESjfao46s= X-Gm-Gg: ASbGnculQ/ymKRjGvh+P2As55LtLrKotwxgxQSGwGDSWggwE/uj8h1e3Pvpzvf6HuFM NE9GW0toAbCLZg/dSDCLsJ1b7KvAkJJeQY9rixYbi4c/09ZhWKAD76FfqNqlTxk0fAiDj8mjJ9g 7EN6wWivyLQ2/X9NqVyoBuOiQqveinXP6pV42DqhHqEXTsDOhyQW8nBdU2YLCbTq6d0BH6iVIYg 5AvqLsvHOq8aUdE57GtGYyOGa3U+7bvapMMOaqOJi9xgcFVUOc1zZwXspCcqmYcYLAcZ1Y70GeI d2mz6BcYS9+Bpeu3uiHR6Ko= X-Google-Smtp-Source: AGHT+IEXBpwhQ4nPgBuaPgLL0mTDFA53hkS3NiGGSx9fqQkRepnwN57T6aiImsg3kEFUvuiZVeQdHg== X-Received: by 2002:a05:6a00:4a03:b0:730:4598:ddb5 with SMTP id d2e1a72fcca58-7304598e42amr1437135b3a.2.1738812916962; Wed, 05 Feb 2025 19:35:16 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:7e5:16be:a0c6:ff7]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048bf14ebsm229417b3a.104.2025.02.05.19.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 19:35:16 -0800 (PST) From: Thiago Jung Bauermann To: "Schimpe, Christina" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to get the shadow stack pointer. In-Reply-To: <20241220200501.324191-12-christina.schimpe@intel.com> (Christina Schimpe's message of "Fri, 20 Dec 2024 20:05:00 +0000") References: <20241220200501.324191-1-christina.schimpe@intel.com> <20241220200501.324191-12-christina.schimpe@intel.com> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Thu, 06 Feb 2025 00:35:14 -0300 Message-ID: <87ldujhhjh.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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 "Schimpe, Christina" writes: > diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py > index 52f265e8e0e..df70cb082a4 100644 > --- a/gdb/gdbarch_components.py > +++ b/gdb/gdbarch_components.py > @@ -2822,6 +2822,8 @@ Some targets support special hardware-assisted control-flow protection > technologies. For example, Intel's Control-flow Enforcement Technology (CET) > provides a shadow stack and indirect branch tracking. > To enable inferior calls the function shadow_stack_push has to be provided. > +The method get_shadow_stack_pointer has to be provided to enable displaced > +stepping. > > Push the address NEW_ADDR on the shadow stack and update the shadow stack > pointer. > @@ -2831,3 +2833,11 @@ pointer. > params=[("CORE_ADDR", "new_addr")], > predicate=True, > ) > + > +Method( > + type="std::optional", > + name="get_shadow_stack_pointer", > + params=[], > + predefault="default_get_shadow_stack_pointer", > + invalid=False, > +) Ideally, there should be a comment on this method entry. This method is only used in amd64-tdep.c and i386-tdep.c. IMHO it would be better to put it in i386_gdbarch_tdep instead. -- Thiago