From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8ZRZLJA3DmYIqSIAWB0awg (envelope-from ) for ; Thu, 04 Apr 2024 01:16:00 -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=qemVRYmK; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A0A131E0C0; Thu, 4 Apr 2024 01:16:00 -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 4ED731E08C for ; Thu, 4 Apr 2024 01:15:58 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6945B385B532 for ; Thu, 4 Apr 2024 05:15:57 +0000 (GMT) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 636E33858C24 for ; Thu, 4 Apr 2024 05:15:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 636E33858C24 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 636E33858C24 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712207735; cv=none; b=LSvEhUXYHpym6QC8dvXtg2P10utA/wgkiVpYezpuE+6vhLAsdepYIUfMA2KAP1okQYAjwHO3xq6eBXjI8too/PWwM6ZBQXdoLFyIDX4bnjGEcxo3M321z6obAy8h/UmGsTQi1gYyQ0OIl2SguUX4h/sTDhMRRkk+pKMOmG7jE6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712207735; c=relaxed/simple; bh=G8AHatLWiqRHXyF9bFh7rX4o8H7IYM1fakDacbtblNQ=; h=DKIM-Signature:Subject:To:From:Message-ID:Date:MIME-Version; b=gb4SKetmCYOWgO04K+fg4y6/X+DGkHRx0qG6Q7hfpGdUj1G4uoNGS61tbM+W0PNjc6qtL3BLs/yLI7Vr7HrbDQZqSw5NrD+jICQxkt9Y1WH3/9SV96SY6UPPAHKHa2Zlkm+sbLUJVTshX6Gl1KHN8aidiku9KU0KoKmbTizvJ2U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6e6fb9a494aso532156b3a.0 for ; Wed, 03 Apr 2024 22:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712207731; x=1712812531; darn=sourceware.org; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=OYOyY641xlttq3+AQ1XmeWvVROp+0BvJ6CyKxQP7c7g=; b=qemVRYmKccDP1vJK9NwN6JO1kWGERdcq8kkCpw6qDV4EzlHoBGBdPupPteXAYKlh6Q sIkhQiaPE5PoILSmdc0upril9GDqL1sqkM9/UaSJOz3Dr4OXFoLF0jae3DvPSZxIj/e8 5895qDzR6y2RJZEq9Sy2INE3wO4Vxrun2P+AUIr7i7l4U6pxvtevLphsJBjWINPMcAUh honlEAWagp+VX1SYmSUWCm70qG/iYrAHTJ2MTcYfZiAbf51rumc8+UaLYlDIsbLrDtCu pZxPU2uzNIQrNgcLubULnSqoaB+huTBYPUAwyfl2xPJpw3mPcA1fIyurHcNKHJg67GCl LfhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712207731; x=1712812531; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OYOyY641xlttq3+AQ1XmeWvVROp+0BvJ6CyKxQP7c7g=; b=Bslrbicv2+2QwjTwS30vOrGg/OdUMG/4+PoxGsV4LJ5WqsuHayJx0Fv+YPMRtZujCj Qo3bfwV/Z3SMIZIGYVTVPcex8jq9vkVU4rINFjgcW2kRoYQ+I6GDrFPgxzdrYSG1CTdE WU3fmU2yfwOJOua4K189etq7wyGGuywnLIDR69ybjclNluphqryDqAb72K4+YQ8YYu3g O2UZE22Th3lqDF+0nTM8nCh/mJ0Ai765H1T4KIQma2v4tzq+mkzaCi2GOVsZb3V45PD2 Sfnnw3IR0ze7nuCWVYGlOYqmKkWnFiy7g0v7RT4um8oSkVN2cMPxzOm4ry8sXgwz7PUp zZjg== X-Gm-Message-State: AOJu0YyZQvtd5QDgyJ3P4DrFnn0QS9Ox0HuhyWofgfi6cXU0oUMvL2tU tIyQTat4cRfsijf1UuudYFz+4kEu7JVYQ1/nFExJheOtCYBZyqo378KQKIH3/Lo= X-Google-Smtp-Source: AGHT+IHOlwaISl7NV3lWVvKQYPdy7VVTLCXiPx9/freJTtncIdF49Nzmum2Ml1K2/5Nit0R28au+kQ== X-Received: by 2002:a05:6a00:1881:b0:6ea:ab45:6532 with SMTP id x1-20020a056a00188100b006eaab456532mr1633264pfh.1.1712207731264; Wed, 03 Apr 2024 22:15:31 -0700 (PDT) Received: from ?IPv6:2804:7f0:b402:d0dc:4f31:e30e:9a7a:2717? ([2804:7f0:b402:d0dc:4f31:e30e:9a7a:2717]) by smtp.gmail.com with ESMTPSA id h127-20020a625385000000b006ecc6c1c67asm4335012pfb.215.2024.04.03.22.15.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Apr 2024 22:15:30 -0700 (PDT) Subject: Re: [PATCH v2 1/4] gdb: aarch64: Remove MTE address checking from get_memtag To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org, luis.machado@arm.com References: <20240328224850.2785280-1-gustavo.romero@linaro.org> <20240328224850.2785280-2-gustavo.romero@linaro.org> <87sf088sgv.fsf@linaro.org> <87h6go8rn7.fsf@linaro.org> From: Gustavo Romero Message-ID: Date: Thu, 4 Apr 2024 02:15:27 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <87h6go8rn7.fsf@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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 Hi Thiago, On 3/29/24 9:55 PM, Thiago Jung Bauermann wrote: > 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. Yeah. No worries, I also missed that show_addr_not_tagged throws an error the first time I read this part, it looked like just printing function :) > Reviewed-by: Thiago Jung Bauermann Thanks for the review. Cheers, Gustavo