From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id F28653858D28 for ; Wed, 12 Apr 2023 09:20:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F28653858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmWe7-0005Ao-Gv; Wed, 12 Apr 2023 05:20:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FVgscbbDgou/FykvejjidUAn/LzXM/bmg6jU8FTp3yU=; b=UR4T/VwC7FpD HYhfFfr8I3xOzdR8Ete4giaJoQ2uZH1+/lyNirKzqXUYvJoexmUBdvm02DXfSe/v3BE1H24sCKDrQ Zb4p8B3yrQafol8W8ZseP9ug8t1B7htXNEptp8Kc3GEBl4tuZNfsqmA+50bFaKzlEkzSdxuC432hN 2bL3zdvrSwhb9L4hgJjfYXnGYFZVZTwGgk0xK9zS+mzAgyomHLzFwaCxsIR0vczw+geMh/g9eHsuD O03abKNNbo4BvHXQtMfaxkB5IexNcWA7SDaTJfmyrBdQtMiKklzZxVdJWRh1pOG1IP+5Ehxol3XNx czHhj14umEmFUbTAk067xA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmWe5-0002Z2-7T; Wed, 12 Apr 2023 05:20:06 -0400 Date: Wed, 12 Apr 2023 12:20:48 +0300 Message-Id: <831qkp8nin.fsf@gnu.org> From: Eli Zaretskii To: Luis Machado Cc: gdb-patches@sourceware.org, alex.bennee@linaro.org, richard.henderson@linaro.org, peter.maydell@linaro.org In-Reply-To: <63c2cf2c-692c-7737-d0ee-b8cb30439b4c@arm.com> (message from Luis Machado on Wed, 12 Apr 2023 09:46:31 +0100) Subject: Re: [PATCH] [gdb/aarch64] pauth: Create new feature string for pauth to prevent crashing older gdb's References: <20230411224327.2142994-1-luis.machado@arm.com> <83mt3d8wkf.fsf@gnu.org> <63c2cf2c-692c-7737-d0ee-b8cb30439b4c@arm.com> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Wed, 12 Apr 2023 09:46:31 +0100 > Cc: gdb-patches@sourceware.org, alex.bennee@linaro.org, > richard.henderson@linaro.org, peter.maydell@linaro.org > From: Luis Machado > > How about the following flow? > > In the future the @samp{org.gnu.gdb.aarch64.pauth} feature string might be > deprecated in favor of feature string @samp{org.gnu.gdb.aarch64.pauth_v2}. > > The @samp{org.gnu.gdb.aarch64.pauth_v2} feature has the exact same contents > as feature @samp{org.gnu.gdb.aarch64.pauth}. > > Targets reporting Pointer Authentication support via the remote protocol > should always use the newer feature string > @samp{org.gnu.gdb.aarch64.pauth_v2}. > > The reason for having feature @samp{org.gnu.gdb.aarch64.pauth_v2} is a bug in > previous versions of @value{GDBN} (versions 9, 10, 11 and 12). This bug > caused @value{GDBN} to crash whenever the target reported support for Pointer > Authentication (using feature string @samp{org.gnu.gdb.aarch64.pauth}) and also > reported additional system registers that were not accounted for by > @value{GDBN}. This is common when using emulators and on bare-metal debugging > scenarios. The flow is OK, but the last paragraph is too long. The main reason of this text is to tell people to use the v2 feature, not to explain why it exists. So the explanation of the reason should be shorter like We recommend always using the @samp{org.gnu.gdb.aarch64.pauth_v2} feature because using @samp{org.gnu.gdb.aarch64.pauth} could crash older versions of @value{GDBN} due to a known bug in those versions. Is it really important to say that the bug happens only when additional system registers are reported?