From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id B374A3858C52 for ; Thu, 19 Jan 2023 18:35:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B374A3858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4NyWXQ2FCzz3ccV; Thu, 19 Jan 2023 18:35:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NyWXQ1PBWz44Cx; Thu, 19 Jan 2023 18:35:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674153334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OGkl6bfJs3ZdPSmGVmYpWvUrrKeUiVmlYXvvuCLfQ5M=; b=OUFWvTYudHYD+N/ZH0LkbTEYOtFjFH8eRPyLcyTm9CgarFvLha5EiURuSI3cAQyTELcwdV ZilgocZiOeFvRJOzp1QKWXffJ+/ZcyR7Z9c3pw7Bgw2r+69aImK9vFmUivS/rSggwlmfCg wKL0lLrcRKkDFLS2ZKi1f0h7pLDvUc/rh6uZ7gKe3r0h0l40xP+12SiJ8/SLKQXdi3b0nP ITSvouMgMP9MmxAwESlAKrAW73wyGcow5Ip6Wsi82q4iwvozbtDXUM2deR0Go0eQb9Y71W R07SkDjGAhMLzvcZ54bal/Nt3Cj5e6AcxeT7JZS8O/PGyy5n0OvH4ZLc1jGBmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674153334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OGkl6bfJs3ZdPSmGVmYpWvUrrKeUiVmlYXvvuCLfQ5M=; b=vA+SV28zyfs7LOfzlKyKo9FNQBLLXK/ytORwkUSAxUNQey7CSFMQ1YAjjNVmn5Q0jefLBe z4JDPcsqgZxPcl0JO2nQYm/D9sqpmY/He19mAvX6FLCcI0mxgQpCc35FDB9pxEoudmhQRR imeSbGc80BJYLiCT6WJ5a6i9iSWICjUL3loh3miW0ilrfhf5Jf+/hyf+w4LO6cS5+VlyMl 509v6vEmsI4cCDJewEm6mKRf9fByKWozgY9PWNIaY+FqNElcodqvLEeq6V/fAyfPi/zcLK EksTI3nKG2kNUYJqy3ecygJCIvjQWiVfSRLMNmiNQlcpZtFWtK/iIve5NbTuOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674153334; a=rsa-sha256; cv=none; b=NAUQRRm+oR/dZRZvL9c/FRTzWwpoxM7LXtUI7WA3QLhF/7ubjsDyC7WTLoVKGAdZ+tOGNb OJVrM0TuLqWeV3t3pNHUC40Bgt016NOG/QPmSKZtOu64ivIr/RAgfqDzMqKDxq9R2RtbNU NCD9aAfnhmkT041LePTy4pMLmWowxlRZiMX9Q6j1jfPPXeDey5yU9rhTp+4cZ70hXbbgo4 kKCFz8sdJ7fVe/AKrbCUJSR1TXV2nrTeZzvgZRQqOd+0j9PKHs9OJ2j1KBRtHFj2+NAPDU 5X2IKwz4KApWNF0FrWyqK7/ckTguLxmiS7qwUbIWg9ce/HEpwQQxyfFxy0XlGQ== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NyWXP4tJqzpQc; Thu, 19 Jan 2023 18:35:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <2084cc2c-877f-36f2-e4a8-ec97eeddf411@FreeBSD.org> Date: Thu, 19 Jan 2023 10:35:32 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] [AArch64] Enable pointer authentication support for aarch64 bare metal/kernel mode addresses Content-Language: en-US To: Luis Machado , gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org References: <20221216105722.1413765-1-luis.machado@arm.com> <19302961-c418-a266-567c-d52b87f112f8@arm.com> <2fbe4596-17fa-1962-66ae-8b4b9f4edd22@arm.com> From: John Baldwin In-Reply-To: <2fbe4596-17fa-1962-66ae-8b4b9f4edd22@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 List-Id: On 1/19/23 1:34 AM, Luis Machado wrote: > Hi, > > On 1/18/23 18:39, John Baldwin wrote: >> On 1/5/23 5:16 AM, Luis Machado wrote: >>> Hi John, >>> >>> Any thoughts on this patch from BSD's side? >> >> Sorry, I missed the cc earlier.  FreeBSD does have support for the userland >> registers that I haven't yet added for userland PAC and this seems to make >> that easier as I will just need to add the registers to the tdesc when >> present/supported.  However, one question I have is what does this do if the >> registers aren't available and kernel addresses are used?  I have this use >> case for existing FreeBSD/aarch64 kernel debugging.  The default version of >> the gdbarch hook seems to always assume TBI and strip the upper bits, but >> for kernel addresses what I kind of need is to sign-extend addresses based >> on bit 55.  I do have a separate gdbarch for kernels vs userland programs >> so it might just be I need a custom version of this gdbarch hook for the kernel >> gdbarch?> > > The default behavior in the absence of the PAC registers for the kernel addresses is to > assume TBI, remove the top bits and sign-extend based on bit 55. > > This is done by aarch64_remove_top_bits. > > I suppose that would work for you then. That sounds perfect then, thanks! -- John Baldwin