From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 9198A3856DD7 for ; Thu, 19 May 2022 13:30:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9198A3856DD7 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6003B15DB; Thu, 19 May 2022 06:30:29 -0700 (PDT) Received: from [10.1.26.173] (e127744.cambridge.arm.com [10.1.26.173]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B95A53F66F; Thu, 19 May 2022 06:30:28 -0700 (PDT) Subject: Re: [PATCH 0/4] Add AARCH64 pointer authentication support To: Mark Wielaard Cc: elfutils-devel@sourceware.org References: <20220425140311.95231-1-german.gomez@arm.com> <20220428195649.GF23335@gnu.wildebeest.org> From: German Gomez Message-ID: <0d2e8ebc-df2a-ca51-4c82-18f0433e9f4c@arm.com> Date: Thu, 19 May 2022 14:30:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20220428195649.GF23335@gnu.wildebeest.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 13:30:30 -0000 Hi Mark, thanks for looking, and sorry for the delay On 28/04/2022 20:56, Mark Wielaard wrote: > Hi German, > > On Mon, Apr 25, 2022 at 02:03:07PM +0000, German Gomez via Elfutils-devel wrote: >> I've included a set of patches in order to demangle return addresses in >> aarch64 platforms with pointer authentication. >> >> Besides adding the implementation of the negate_ra_state opcode, there >> is a new function in the libdwfl.h header to feed the PAC masks to the >> library. >> >> Let me know if there are any concerns with the current version. > Thanks a lot for this. Last time I looked at this didn't have any > means to test this, so I skipped implementing it. How did you test? Do > distributions now enable PAC by default and is there hardware (qemu?) > support? So far I've been testing on Graviton3 cores (running linux), which seem to implement the PAC extension, and it came enabled by default. https://www.kernel.org/doc/html/latest/arm64/pointer-authentication.html > I haven't been able to look at the actual patches yet. And I am on > vacation this week. But I'll review next week after I am back. Thanks a lot for looking. > > A quick scan shows we need a aarch64 special public function, which > would be slightly ugly imho. I had hoped it could be a variant of the > func_addr_mask. But maybe this is too different to make more generic. I did consider func_addr_mask initially, but when I wrote the patch it wasn't exposed as a perf-thread value. Currently PAC masks are constant but might be different from thread to thread in the future. So I placed it in the Thread struct. I agree the arch-specific naming is not pretty. I think I can certainly rework it into a more generic feature. But I think I would need to make sure that the masks can be supplied to the Thread struct before the    unwind. Thanks, German > Cheers, > > Mark >