From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dwvcGRMLuGfgRTgAWB0awg (envelope-from ) for ; Fri, 21 Feb 2025 00:11:47 -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=kw3AzvKq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 592F21E105; Fri, 21 Feb 2025 00:11:47 -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 8A7FB1E08E for ; Fri, 21 Feb 2025 00:11:46 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ED6573858427 for ; Fri, 21 Feb 2025 05:11:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED6573858427 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=kw3AzvKq Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id E7C613858C66 for ; Fri, 21 Feb 2025 05:11:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7C613858C66 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 E7C613858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740114664; cv=none; b=GsTosAOvn3eBY4lc7h9iT1cBw9oHVC329vOKw5e5N5TElh9xfi2Ud0BsKI4l2mFPHVRrh/ndH9WibtBU4dpepCEaIOJIBIRnxNIZFCGo6b3HLd3U6oOtZoDHnVjXnu6sebTyLzJ6vJBjpYyiybsxtnSGFlmpstYFDaQILNCEmgE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1740114664; c=relaxed/simple; bh=lxvlaCX039ZJtyAtuQfg2DyriI4IEzUTWHKJ5ndm7jM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZAutybOGTwo/XSX2hjC6XtXk6UaXIBSik/6Dx/3FU6Uupx+xIdp92SvC/66wjoCAIHh8skCOdNGtbbjXjcwOaDh6fW6mpl8iZhZBcbXlO1ZTZrZUSkgSHAYXKWijtEo9FNc7LZWllmxjihw5LwifpV4ECAw27DbtBgDZo4X6TT0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7C613858C66 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-220ca204d04so25024225ad.0 for ; Thu, 20 Feb 2025 21:11:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740114663; x=1740719463; 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=vnXYJLbUz9cxzvcc2ajMDi/9rlnH3pLKeW0OPGgBouo=; b=kw3AzvKqd/XCT2W7VmtK+qujL7BbsJ0Ji5L/eMV+PkVibqs7pzMLybr3QmHdo1mcN5 /9n4PG8fFaGlF4oM1wxA2okXaq13jGDFzt1lWfoSH+jJMfE3tZStVl9R7WfTnF6SA6Uv 55LybEx6/kb6E1qgQyIKVsvnsJoob5C+RXD4ajnYn7dKCD7LlsXTalzgH4bYr/BUDmC2 tItzgteRcAfDrZx9QOhjqXVSbOowCnETAX9BGMjDds5y9kZsrGV7MAZlSZn6xd+9dF++ y6nz2WCJ4GGl3YX2adeO7EVNmpevWkArjGkSI5mlB/HmN4SrBZ31e0ELnxD2h7U1ucaE 2faw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740114663; x=1740719463; 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=vnXYJLbUz9cxzvcc2ajMDi/9rlnH3pLKeW0OPGgBouo=; b=eedrMoIM3rTDucFv9IVZD+W6P6yK2p7okWioqAnwPGSAnRHCQQTSKrtZwKxp+5Zm9Q mHzILBaX+8/XYnZDJhSxwbfYwccxjnuMPVTC4fBLwKzp3AvY5aGHpg4vYLikSxQEt1Ed XqVCUHZpBlXixN8J84W0WTzxD8xvarLNbpER5LZ6/yQuHPyDK5RlR3H6aI2ABvFpzfY/ NDryJPJEb+oWMTI6fBtz8BnysbAS7KwcFIvQITVXKRpjHEqRBYoaUyP3/fuurfra49u8 nAT7Du4uWRQ+GmtWX4HCRy8Swp14Eza85Z63hMNECEQNRHom+hcThsVw3ZGQJaE8CgQj 2cKg== X-Gm-Message-State: AOJu0YyKmiYzSslbuYZ5ckpHrzibsDDNDph8raxaxlvrfP3rJBiBt7Va 7Fk1ZSpxgZuXLoA4blbZB0zAKUMTL7YUC57a7GFBMUpktOJ+1XySuCWLgaNz9SkMVW0DraZuTXr h X-Gm-Gg: ASbGncvmS6F85/dlQXLwDNGthIble77UHLXx4PmJmWDR2yCYmrlQ5CXt7xXdF0rLC0l sYMIOD7zVpPO+apfyj1X9IzKOg6qK3OyOUvHJkRmQEv51f5+i1/Re4pcxEZKGm7wXYOn/09XMVX 1YM2hB3GtUvBFMefH8sqs4WavOTczIF0sNe95HhXuP10ID0u5GvbyTlPUYi0VFVMxU0XeQX+UwX ofOR0zPFHxw9v816AVTxzq+6TLrpf5NFqcpHlErilvik5HJN1AFf5MAmP+GcWdDS/8evV7IA7mf ADVOvCw3nXp6r7ybnS3rWnNI7VK41+VLZEqO X-Google-Smtp-Source: AGHT+IFmF+E4usQq54bQK8KpPp2W/l0o97fJub2cxVHITakhNTpBmFo+OX7N1//Yg5TI1rJT7VaM7Q== X-Received: by 2002:a05:6a20:914a:b0:1ee:88f1:e840 with SMTP id adf61e73a8af0-1eef3ca3f4fmr3375392637.19.1740114662689; Thu, 20 Feb 2025 21:11:02 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:4a17:6365:9529:97fe]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7325a8236bfsm12009333b3a.31.2025.02.20.21.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 21:11:02 -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: (Christina Schimpe's message of "Thu, 20 Feb 2025 08:48:21 +0000") References: <20241220200501.324191-1-christina.schimpe@intel.com> <20241220200501.324191-12-christina.schimpe@intel.com> <87ldujhhjh.fsf@linaro.org> <87v7tlqdzw.fsf@linaro.org> <87v7ths0v8.fsf@linaro.org> <87seofhnvu.fsf@linaro.org> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Fri, 21 Feb 2025 02:10:59 -0300 Message-ID: <875xl3evbw.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 Hello Christina, "Schimpe, Christina" writes: >> -----Original Message----- >> From: Schimpe, Christina >> Sent: Sunday, February 16, 2025 11:45 AM >> To: Thiago Jung Bauermann >> Cc: gdb-patches@sourceware.org >> Subject: RE: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to get >> the shadow stack pointer. >> >> > -----Original Message----- >> > From: Thiago Jung Bauermann >> > Sent: Saturday, February 15, 2025 4:45 AM >> > To: Schimpe, Christina >> > Cc: gdb-patches@sourceware.org >> > Subject: Re: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to >> > get the shadow stack pointer. >> > >> > Hello Christina, >> > >> > Thiago Jung Bauermann writes: >> > >> > > "Schimpe, Christina" writes: >> > > >> > >> Would something like that be acceptable as well? >> > >> >> > >> Method( >> > >> comment=""" >> > >> 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 shadow stack enablement state >> > >> configure >> > SHADOW_STACK_ENABLED. >> > >> """, >> > >> type="std::optional", >> > >> name="get_shadow_stack_pointer", >> > >> params=[("bool &", "shadow_stack_enabled")], >> > >> predefault="default_get_shadow_stack_pointer", >> > >> invalid=False, >> > >> ) >> > > >> > > Yes, this looks good. >> > >> > I was rebasing my Guarded Control Stack code on top of this series, >> > and noticed that I will need to access the thread's regcache for the >> > aarch64 implementation of this gdbarch method. Then I noticed that the >> > x86_64 version also needs it, and calls "get_thread_regcache >> (inferior_thread ())". >> > It would be better to pass the regcache as an argument instead. >> >> Hi Thiago, >> >> Do you mean instead or in addition? >> I thought you also need the parameter ("bool &", "shadow_stack_enabled"). Sorry for not answering your previous email. I switched my focus to the variable-length registers thread and forgot that I hadn't answered this question yet. > Since you wrote instead I now have the regcache argument only in the v2 of this series. I wrote "instead" meaning "instead of calling get_thread_regcache inside of the method implementation". Sorry for being unclear. > https://sourceware.org/pipermail/gdb-patches/2025-February/215650.html Strange, for some reason the threading on the patch series got broken up into three parts. I thought I had missed some of the patches but now I see I received the whole series. > Please let me know if you see any problems with that. For AArch64 GCS I need the shadow_stack_enabled argument so that callers can tell whether the shadow stack is enabled or disabled. -- Thiago