From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id bkcPHNh+B2ZpqxsAWB0awg (envelope-from ) for ; Fri, 29 Mar 2024 22:54:16 -0400 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=f8kuxc8r; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6159B1E0C0; Fri, 29 Mar 2024 22:54:16 -0400 (EDT) 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 323A91E08C for ; Fri, 29 Mar 2024 22:54:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D7B9D3858C62 for ; Sat, 30 Mar 2024 02:54:12 +0000 (GMT) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 88BFF3858D35 for ; Sat, 30 Mar 2024 02:53:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 88BFF3858D35 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 88BFF3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711767236; cv=none; b=CyUUe15gPqU9ndlO2Dcn8kSlvcoIcmaY6SiDukZTyuHmrR9n8r/ZeD9u7j6BO0wgziGYOoXgjA6mRimqSZzgQgRimCDIeAQC5YH9DGr4ZKiplJPFRE7qO/a+2XRlss6N/GFZixBMU7hVSYmY1o6qd1yHiMnq9tWlMHMUynCALwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711767236; c=relaxed/simple; bh=5Un11Ovdu2F9hQpIGD7O6EsESZe1z+J78Yc4OW2LBhk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cffW4DWr9Ig3XJIljHTMLmdof2Z6uDDH8WJqfbK8IfduCZqCBg/xPFW8MiFnh7BXndDB1ARG9PDjZu8o7Mpoed44lLzbqT9ldzm9hxfy+UIApQ1k9jGw0TGfAoTeNG4oGIWgkhRkoNTSn/FPeSPoJbHgkKhMh2JldSQuI2wTs5k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5c229dabbb6so1468636a12.0 for ; Fri, 29 Mar 2024 19:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711767233; x=1712372033; 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=/1KP4aVH7uBahaA49LpboZrDYIt+4d86KeZbehIQx+M=; b=f8kuxc8rpS02LjiacKxQmKJeMGmHkvrD3MlLUa9fCcwETg78FWXlaPMYwBXmUx6q5A Vb3jcqtu1pKlPVf88tYTqEjVK5LTB0VhA4/no7BOuJjSjlAADcSjnodTLZ3kBBKh/x4K wlyl9xeo0I8kDsdjmV0EsMQl7+UR4mescTIhj3QAG9bJ4MiigTYAgQZUs909iEtSBOtN 5xex+HNDeMmPvHBxiOnjVAXFbAFvAF41wVWdPuA+235ZRygxI210fvQnJU+t/309cH0s /Kl0ZqCaWeESMV2BZ6GTL0lJ+b20/dRm8CfD5vhfpJcQWc2OlRbaTNLlXud+7A78qQJv zZOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711767233; x=1712372033; 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=/1KP4aVH7uBahaA49LpboZrDYIt+4d86KeZbehIQx+M=; b=AOUwuYP0rCGjEqupu5J3cVsDft4HBDIqzG4NGtCmLZWRjDq2HiWwHZhbvYpaNsslNd ObsvKfhRQh1ooYcpSlaNLRGOWWICj5uj31LqY3TrZaOIbl0Jg77MCZoh7tBgTCW/S0rI p+WgZ1i8ojP17FmWdbQVLkQuddUeNnlC/FOCbhdzkwC4maDaEaq9gV4KfHbCsqZ4X4+o yuwAdtFOo7pZSZm6SLJSc8uSbdaX+CAd++ZYeBhRnV4NYDaOd+pdl+d1szrJ668LT6tq 4IqcSGRKhKkhbFbrc36tI2WbZGSJu8jkT/BgTy3+fSTmYZ9ZvWgqnPrUdYuvWOLS5tT0 3yFA== X-Gm-Message-State: AOJu0Yw36pBEzwHFESD/IN9uwUhnRCDwbs4qomr9b4p1oUm+kn+NDpjH QKYO6M+FNOhZUMEmPuDFS+YcUk9no1AD/+oP+QidVahQwvK45Qk7LV9hQhcFXzc= X-Google-Smtp-Source: AGHT+IFyTBoyMA8lo2r91jTdEeplJStpgb4qNPuj3iuhMhGmJG6iFZYi7X535kgKS3Boyu4uCtg0sg== X-Received: by 2002:a05:6a21:2d0b:b0:1a3:c43b:b7e2 with SMTP id tw11-20020a056a212d0b00b001a3c43bb7e2mr4361007pzb.47.1711767233396; Fri, 29 Mar 2024 19:53:53 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:2981:86:c711:2bee]) by smtp.gmail.com with ESMTPSA id q6-20020a17090311c600b001e0a61cb886sm4152268plh.120.2024.03.29.19.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 19:53:52 -0700 (PDT) From: Thiago Jung Bauermann To: Gustavo Romero Cc: gdb-patches@sourceware.org, luis.machado@arm.com Subject: Re: [PATCH v2 3/4] gdb: aarch64: Remove MTE address checking from memtag_matches_p In-Reply-To: <20240328224850.2785280-4-gustavo.romero@linaro.org> (Gustavo Romero's message of "Thu, 28 Mar 2024 22:48:49 +0000") References: <20240328224850.2785280-1-gustavo.romero@linaro.org> <20240328224850.2785280-4-gustavo.romero@linaro.org> User-Agent: mu4e 1.12.2; emacs 29.1 Date: Fri, 29 Mar 2024 23:53:50 -0300 Message-ID: <875xx48m69.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 Gustavo Romero writes: > This commit removes aarch64_linux_tagged_address_p from > aarch64_linux_memtag_matches_p. aarch64_linux_tagged_address_p checks if > an address is tagged (MTE) or not. > > The check is redundant because aarch64_linux_memtag_matches_p is always > called from the upper layers (i.e. from printcmd.c via gdbarch hook > gdbarch_memtag_matches_p) after either gdbarch_tagged_address_p (that > already points to aarch64_linux_tagged_address_p) has been called or > after should_validate_memtags (that calls gdbarch_tagged_address_p at > the end) has been called, so the address is already checked. Hence: > > a) in print_command_1, gdbarch_memtag_matches_p is called only after > should_validate_memtags is called, which checks the address at its end; > > b) in memory_tag_check_command, gdbarch_memtag_matches_p is called only > after gdbarch_tagged_address_p is called directly. > > Also, because after this change the address checking only happens at the > upper layer it now allows the address checking to be specialized easily > per target, via a target hook. > > Signed-off-by: Gustavo Romero > --- > gdb/aarch64-linux-tdep.c | 4 ---- > 1 file changed, 4 deletions(-) Looks good to me. Thanks! Reviewed-by: Thiago Jung Bauermann -- Thiago