From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rOXsOSljB2bvlxsAWB0awg (envelope-from ) for ; Fri, 29 Mar 2024 20:56:09 -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=Q7HnVCKk; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CD7881E0C0; Fri, 29 Mar 2024 20:56:09 -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 AD1EA1E08C for ; Fri, 29 Mar 2024 20:56:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F0DB3858CDB for ; Sat, 30 Mar 2024 00:56:07 +0000 (GMT) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 223E13858D33 for ; Sat, 30 Mar 2024 00:55:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 223E13858D33 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 223E13858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711760146; cv=none; b=OKo76+4FHgG1iXX2oyKR9xKZDXavJMclw2PulK65OLyyohNxliS/d87FFy5hM9FNAoO01XaWW1qfIQHCi8aLhbXT7GZh6htSEYem7a1LDp9pdXBqRNYjOc+IN8JKxhGD2iTGGSBCdSNtZw1srA88MLKFQyRkjBIDkCfdX9oR3xE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711760146; c=relaxed/simple; bh=E54KyEFaIe767FqW4FMiuoyD3fnYkhrXG3Q8Lktcbq8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dHQn0ErvEjybcKEh2mMGvNRnnHxzqKyxvEyjKLkhAQSw3rL7Z6Il50Ae9e5//i4INNtjb61qmCcMb3OdQghBQAkI5mEpOQiDUvETRORUJ2xhXK1HMFiSox6Wrml50VvGfbpdepNTHzr7z47W62vZJjPQvfPy/UQxBty4/su1+Ak= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1e034607879so20159245ad.0 for ; Fri, 29 Mar 2024 17:55:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711760143; x=1712364943; 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=E54KyEFaIe767FqW4FMiuoyD3fnYkhrXG3Q8Lktcbq8=; b=Q7HnVCKkQy+3B0C0ACBrMdEPCsf9Gz4qIX6yVFSgNMZ9pcG46e0J1Z0RNxtj4ShRtf tzwiqycxETVaC+3Lz0O79244gEn99gaBtSD4QyHnr6Ly4keAcLXCrBpLlUMS5Ty3ZIBh OBiS3NzARI/HvgRiKrUoptniev0uDcATrpBFJIsnUnP+QUmydW+pK0f2lMq2oMNLRrIi YOiQLamiqB5I0Gtoi2RTvlNz3zwVnLz4vHeHEk9VfKLo9ilVI/KIaG5x42p711IGsUP8 seGTE0MhNxk/QiQxg6y/r9HivdKd2tUcet76Bl7ldlFSq8275ieoN6+ENJrYbIiLNKpE Ho7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711760143; x=1712364943; 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=E54KyEFaIe767FqW4FMiuoyD3fnYkhrXG3Q8Lktcbq8=; b=jSVDI14Dgywar4ijq05B6d2RFFqhmfWo1900fdsICMXKY7GcoNugZRdkKpYGRgWha2 rB+Gr+hRlOizr6qC8RLApl2XGxFcOIxDfh9cEv94fQ/9fommHpjS+/fzgbDITU5roYTA VDtuYWCIXuveARCSvTGcBv63ELSaSQwQQ1Ot9r8aTo3AeuZmCk866O2wz1zyTaEku77w s8kMnJkSdvONnUoTdXHs+iiRdaQD7qb1hpbiy0av2Y1oa9IIC+w4T2GR14LUBhmTn2aQ a/t1zRliyYUdke3RAMuZJ2b3Y+MqBz2qvoVxYex2VtwVymagv1XRu/W0jCMFdRGWg+/D 86RQ== X-Gm-Message-State: AOJu0Yxs3c1sXOZph04u+MvtLflaMCkc7KuVrPyGoX2+ycBl89qdOuCp 6dTSD0IfGTVsSxMxe0E+FWwWqQiTlxJopgqdphyFJrgHWIrpW32/1euocyu8uSw= X-Google-Smtp-Source: AGHT+IH6rTDWfn1Yk++1I7/uGnat6TwnI9zXsL6jm64YbrxToR73Vs8glEgPg4vfi3Aq02Li4a7VfA== X-Received: by 2002:a17:902:e808:b0:1e0:b12:a1d with SMTP id u8-20020a170902e80800b001e00b120a1dmr4972590plg.42.1711760143079; Fri, 29 Mar 2024 17:55:43 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:2981:86:c711:2bee]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f54d00b001e223b9eb25sm2995783plf.153.2024.03.29.17.55.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 17:55:42 -0700 (PDT) From: Thiago Jung Bauermann To: Gustavo Romero Cc: gdb-patches@sourceware.org, luis.machado@arm.com Subject: Re: [PATCH v2 1/4] gdb: aarch64: Remove MTE address checking from get_memtag In-Reply-To: <87sf088sgv.fsf@linaro.org> (Thiago Jung Bauermann's message of "Fri, 29 Mar 2024 21:37:52 -0300") References: <20240328224850.2785280-1-gustavo.romero@linaro.org> <20240328224850.2785280-2-gustavo.romero@linaro.org> <87sf088sgv.fsf@linaro.org> User-Agent: mu4e 1.12.2; emacs 29.1 Date: Fri, 29 Mar 2024 21:55:40 -0300 Message-ID: <87h6go8rn7.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.9 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 Thiago Jung Bauermann writes: > Gustavo Romero writes: > >> This commit removes aarch64_linux_tagged_address_p from >> aarch64_linux_get_memtag. aarch64_linux_tagged_address_p checks if an >> address is tagged (MTE) or not. >> >> The check is redundant because aarch64_linux_get_memtag is always called >> from the upper layers (i.e. from printcmd.c via gdbarch hook >> gdbarch_get_memtag) 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, aarch64_linux_get_memtag (via gdbarch_get_memtag >> hook) is called but only after should_validate_memtags, which calls >> gdbarch_tagged_address_p; >> >> b) in do_examine, aarch64_linux_get_memtag is also called only after >> gdbarch_tagged_address_p is directly called; >> >> c) in memory_tag_check_command, gdbarch_get_memtag is called -- tags >> matching or not -- after the initial check via direct call to >> gdbarch_tagged_address_p; >> >> d) in memory_tag_print_tag_command, address is checked directly via >> gdbarch_tagged_address_p before gdbarch_get_memtag is called. > > In cases c) and d), gdbarch_get_memtag gets called even if > gdbarch_tagged_address_p returns false, so won't this commit change the > behaviour of those functions in that case? I don't know enough about MTE > to be sure. I just realised that in cases c) and d) an error will be thrown by show_addr_not_tagged if gdbarch_tagged_address_p returns false, so gdbarch_get_memtag doesn't get called in that case and my concern isn't valid. Sorry about that. Reviewed-by: Thiago Jung Bauermann -- Thiago