From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E1FBF3858D39 for ; Mon, 12 Dec 2022 15:07:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1FBF3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id EF53C1E0CB; Mon, 12 Dec 2022 10:07:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1670857651; bh=AKGt4s5vG8auFjeGTQuWPw7+VbkW7s3awiOl0JboY/w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dXZF7aVAS10tX7OanNFInUOvLZ6ZGeMv2nBec/ldiwuCVQBdb4hJELlLS7R4QycYp XIOSqCM8325pCuPd8+qkWN/EklmJvM4XDbR9MAJNmkWO7H3OhguEH1mj48GMTPwxLZ FKDqoFVHw+73I+M9p4Ug4LJO/nzorxKwibQwH9vc= Message-ID: <6f1c7059-efd6-cd2a-f0c6-de8f182df468@simark.ca> Date: Mon, 12 Dec 2022 10:07:30 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH,v3] [aarch64] Fix removal of non-address bits for PAuth Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org Cc: lsix@lancelotsix.com, thiago.bauermann@linaro.org References: <20220705140037.135012-1-luis.machado@arm.com> <20220823202936.1561526-1-luis.machado@arm.com> From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,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 List-Id: On 12/12/22 09:21, Luis Machado wrote: > Hi Simon, > > On 12/9/22 19:14, Simon Marchi wrote: >>> @@ -1961,6 +1962,47 @@ aarch64_linux_decode_memtag_section (struct gdbarch *gdbarch, >>> return tags; >>> } >>> +/* AArch64 implementation of the remove_non_address_bits gdbarch hook. Remove >>> + non address bits from a pointer value. */ >>> + >>> +static CORE_ADDR >>> +aarch64_remove_non_address_bits (struct gdbarch *gdbarch, CORE_ADDR pointer) >>> +{ >>> + aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); >>> + >>> + /* By default, we assume TBI and discard the top 8 bits plus the VA range >>> + select bit (55). */ >>> + CORE_ADDR mask = AARCH64_TOP_BITS_MASK; >> Declare mask in the context where it's needed. >> > > I decided to declare it here in case we skip the if block, then we return the default value. > > Did you have something else in mind? I missed that it was used in the return value, sorry. Simon