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 5797B3853D4F for ; Mon, 12 Dec 2022 18:54:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5797B3853D4F 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)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 6EDAC1E112; Mon, 12 Dec 2022 13:54:39 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1670871280; bh=3hMOI3ByxU9nyV12144q+rEIeEhd2+kiq/XVKHYHggc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GjoDKro4X8QcMREjzdJ6xLEfVrKJZtduT0okt/HUqbWA/u38r9UisywiGZq5Pvbc7 cOH/YNjWBgOUcNPghd86Tz31Gu+O+Uu9xAOay4S1GEwzT3SbeGHQs7ETWAenxu0Cjt 1M0b4lLZmgLLqpZjv9HC732FlDLsvkgU2LBtDyN4= Message-ID: Date: Mon, 12 Dec 2022 13:54:39 -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 v4] [aarch64] Fix removal of non-address bits for PAuth Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org Cc: simon.marchi@efficios.com, jhb@FreeBSD.org, lsix@lancelotsix.com, thiago.bauermann@linaro.org References: <20220705140037.135012-1-luis.machado@arm.com> <20221212171320.799445-1-luis.machado@arm.com> From: Simon Marchi In-Reply-To: <20221212171320.799445-1-luis.machado@arm.com> 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: Hi Luis, I noted some nits, but the patch LGTM in any case: Approved-By: Simon Marchi > +CORE_ADDR > +aarch64_mask_from_pac_registers (const CORE_ADDR cmask, const CORE_ADDR dmask) > +{ > + if (dmask != cmask) > + { > + /* Warn if the masks are different. */ > + aarch64_pauth_mask_warning (); We don't really need aarch64_pauth_mask_warning anymore, you can inline the warning here. > +# Cycle through the tag and pac bit ranges and check how GDB > +# behaves when trying to access these addresses. > +foreach upper_bits {"0x0" "0x1" "0x2" "0x4" "0x8" "0x10" "0x20" "0x40" "0x80"} { > + foreach lower_bits {"0x0" "0x1" "0x2" "0x4" "0x8" "0x10" "0x20" "0x40"} { I would perhaps suggest using foreach_with_prefix for these two, and then you can simplify the test names below. I like using prefixes, because it standardizes how the test names look when multiple variants are tested or iterations are executed. Simon