Bug 270472 - MS devkit hangs during boot if PAC is enabled
Summary: MS devkit hangs during boot if PAC is enabled
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-26 20:48 UTC by Mark Johnston
Modified: 2023-04-23 18:57 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2023-03-26 20:48:41 UTC
Currently one needs to set hw.pac.enable=0 to boot FreeBSD on the devkit.  Some debugging indicates that the hang occurs when ptrauth_thread0() attempts to load the APIA key, but I don't have a good way to see what's actually happening.  Maybe EL1 is configured to trap upon access to the key registers.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-04-02 00:01:32 UTC
Noticed that too a few weeks ago, but did not investigate further.  Also needs D37765 applied to boot.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-23 17:57:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4b39a12830feaf2ac49b157ed079c04114b1a3ca

commit 4b39a12830feaf2ac49b157ed079c04114b1a3ca
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-04-23 17:32:45 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-04-23 17:55:57 +0000

    arm64: Disable PAC when booting on a Windows Dev Kit 2023

    It appears that PAC registers are configured to trap upon access, but
    since the kernel starts in EL1 on this platform it has no ability to
    inspect or modify this configuration.  Simply disable PAC on this
    platform for now, since the kernel otherwise hangs during boot.

    PR:             270472
    Reviewed by:    andrew, emaste
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D39748

 sys/arm64/arm64/ptrauth.c | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)