[Bug 292195] arm64: panic on coredump with sve instructions

[email protected]
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292195

            Bug ID: 292195
           Summary: arm64: panic on coredump with sve instructions
           Product: Base System
           Version: 16.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: arm
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 266838
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=266838&action=edit
vfp.c.patch

When trying to reproduce bug 292177 on 16-CURRENT I unexpectedly encountered a
kernel panic. It looks like the panic was unique to coredumping in SVE code.

The coredump logic calls get_arm64_sve twice: once to get the note size, and
once to get the data. The note size calculation depended on the volatile
PCB_FP_SVEVALID flag. If this flag was cleared between the two calls (e.g., due
to a context switch clearing the flag to comply with the ABI), the second call
would expect a smaller buffer size than the first, triggering the KASSERT panic
("invalid size").

Fix this by:
1. Using pcb->pcb_svesaved != NULL (a stable indicator of SVE usage) to
determine the note size.
2. Calling vfp_to_sve_sync() if SVE is not currently valid but SVE state is
saved, ensuring the SVE buffer in the core dump contains the most up-to-date
register values.

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.