From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id T9oDB/5eB2ZQkxsAWB0awg (envelope-from ) for ; Fri, 29 Mar 2024 20:38:22 -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=mjftZX+D; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 088A81E0C0; Fri, 29 Mar 2024 20:38:22 -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 C26591E08C for ; Fri, 29 Mar 2024 20:38:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 001733858D39 for ; Sat, 30 Mar 2024 00:38:18 +0000 (GMT) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 9F7833858D33 for ; Sat, 30 Mar 2024 00:37:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F7833858D33 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 9F7833858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::634 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711759078; cv=none; b=S2iNCWiGVvQtR3O28Z4jQgZb4EEtXUSP5IA0Zq6j+2qvn/G4WBeQvDIHqDCffEkExOtjOgl7xKY9lItldw6QkAxP9z5xvBtnuyX8Reb+9TBztK1LZvUfgHBWA9Xh18/J1wFFQuEmnH7tk0NJOnFxq+wlEfmyeK72JsdqPIeVMSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711759078; c=relaxed/simple; bh=Mgo21qqpu4yXMUm6EsvIhc/pNiZh2N6/hyUIMTp9Oz0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DEo5rTx+NL6ZHC6aKp90HnTsyLanLCunmjCQ5Fwam3nAMGOHoUQaIVnJVQVYDZdsxQMELNs0BlAn42BUrAy2MELZoXiRVfDU7wXnvZXJ8FNqLI4b9BPg9mgfR3BjEPhdYi3gewZrKVWZz0SCjeRI0RHdTNlgccAEVBvg7LnraOU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1e23c210accso5408715ad.1 for ; Fri, 29 Mar 2024 17:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711759075; x=1712363875; 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=Mgo21qqpu4yXMUm6EsvIhc/pNiZh2N6/hyUIMTp9Oz0=; b=mjftZX+Dukl1TP1lD7fFDVfZYvz9sA1vu1vECwHN4g/8DpjMdokJKdx/mU4RsB67WK Xv8SiUnp6NkuqBVh1uB8l6wCdat52DZGS09L4NkUH34nCZFL3oYsdfLD9Lta4X4NBwJF Xt/9zisEjDZaFJ2Qahn3CpNIRpvFBtZEnvtTkHOJjf+vxXaclfUxGDqSt4GG8tlEjZsi vJM3rhzateaya0wmpU1Zm/xXqqf3g/wu24VzK7t97iMJirYg4Zdybq9VQJ/HX/L9aHQ3 rh0xKfMhckSx8EVBTtU0MItjBvUchSSJXmFz124glJumOJzRYWfZCT9y7XYC6qZS++CA 5O5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711759075; x=1712363875; 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=Mgo21qqpu4yXMUm6EsvIhc/pNiZh2N6/hyUIMTp9Oz0=; b=HixxXhf72iFodzmaAnMKhkPz0yBtXmfpGCEP8399XV38/SdDLB91z6egDgq8HeRIRk JhA7whlnZdseM3VACYosJciNLE40Gi7xg3H+cD4jG+mC7wIwoE8V2FVGwgO2WB5hnon8 OexKfOmu4BzGA6Y7/k0vxnlJwXJy6taTiMDzdHGycMAcJyq15ApggHb1Ktt6AW+hQgPo 6pIO+gtYUZhOk7j08pGig+9oKQ/mu2U47gvM09cpnQkbyqBq09LA/Vd8NJdNHTMlG/oC vvuj5qFqyKsO3mCVjPx96tISfAEtRxIbO0wpHRJ0JMCti5/jI+NI1JEGwdcbWpsMrllk zZgA== X-Gm-Message-State: AOJu0YwfNftisbdfNxHkm7HSWpmduBOfJbrRsPNnr1iX5cPMvKTy4tp+ Mz6puWIJa8MUhADx+AmClzYMnDV3MompflZqZg/DFwb5RwDcDpPhNDHnl9XK8Iu24l0Tih1/IsQ J X-Google-Smtp-Source: AGHT+IFlrrxzA96ZZvGHgUfyLcudZKZ4nM3qfyJ992UYyV0XzQCtYL13UrBAVffFXZckyc/hW8atCw== X-Received: by 2002:a17:902:d489:b0:1e0:119e:f935 with SMTP id c9-20020a170902d48900b001e0119ef935mr4342869plg.15.1711759075674; Fri, 29 Mar 2024 17:37:55 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:2981:86:c711:2bee]) by smtp.gmail.com with ESMTPSA id n4-20020a170903110400b001dcc7795524sm4040890plh.24.2024.03.29.17.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 17:37:55 -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: <20240328224850.2785280-2-gustavo.romero@linaro.org> (Gustavo Romero's message of "Thu, 28 Mar 2024 22:48:47 +0000") References: <20240328224850.2785280-1-gustavo.romero@linaro.org> <20240328224850.2785280-2-gustavo.romero@linaro.org> User-Agent: mu4e 1.12.2; emacs 29.1 Date: Fri, 29 Mar 2024 21:37:52 -0300 Message-ID: <87sf088sgv.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 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. -- Thiago