From nobody Tue Jan 6 12:04:31 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dlqbW05Nkz6NY6x; Tue, 06 Jan 2026 12:04:39 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dlqbV4nHkz3Hjf; Tue, 06 Jan 2026 12:04:38 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Authentication-Results: mx1.freebsd.org; none Received: from smtp-relay-int-backup.realworks.nl (crmpreview1.colo2.realworks.nl [10.2.52.31]) by mailrelayint1.colo2.realworks.nl (Postfix) with ESMTP id 4dlqbM2W96z1PW; Tue, 6 Jan 2026 13:04:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1767701071; 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: in-reply-to:in-reply-to:references:references; bh=BqvwAh55g7mHUWbivVWNn2lRC58mfrANMqDkNV2oE/8=; b=ZsNeRWEn2mxqnXjC2XTDtJOG1MdlA0YRSJpSY+jzfwEx6InKlszJZM5Scku/FufDHTlLyg 0gzzkGq2s9TsdCpwAg3LOxf7uM8bFKay13a7XDsIQSUJCuzIIftso+9wKKVcWKesYOTFij xCZPsL4ySkzeLJ4PzMdk+6E8mMdu2AQSvo0Qiyk/2/y+XKsT879M72+5dyTW9fgJB35W5O BHDtZTqllgWBtbyZP+oIYFAZQHIoqnXGs7Oab5XyZup8KyHA6sapkn+OmNAMrDY3JsTUyQ wKsFxkKbkgUVqW4HBxj6Km4L739vUFtU0frBN9Kfo5D9uOzsNJKCTvt//xP9xA== Received: from crmpreview1.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview1.colo2.realworks.nl (Postfix) with ESMTP id 43AC0402D1; Tue, 6 Jan 2026 13:04:31 +0100 (CET) Date: Tue, 6 Jan 2026 13:04:31 +0100 (CET) From: Ronald Klop To: Andrew Turner Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <64525372.1244.1767701071189@localhost> In-Reply-To: <695cec3f.31a54.43e19fd1@gitrepo.freebsd.org> References: <695cec3f.31a54.43e19fd1@gitrepo.freebsd.org> Subject: Re: git: a9e77eb7016d - main - arm64: Correctly align the SVE signal context List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1243_575415837.1767701070865" X-Mailer: Realworks (778.34) X-Originating-Host: from (83-81-212-149.cable.dynamic.v4.ziggo.nl [83.81.212.149]) by crmpreview1.colo2.realworks.nl [10.2.52.31] with HTTP; Tue, 06 Jan 2026 13:04:31 +0100 Importance: Normal X-Priority: 3 (Normal) X-Originating-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:146.0) Gecko/20100101 Firefox/146.0 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:38930, ipnet:87.255.32.0/19, country:NL] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dlqbV4nHkz3Hjf ------=_Part_1243_575415837.1767701070865 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi. Can this be related to this issue? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292195 "arm64: panic on coredump with sve instructions" Regards, Ronald. Van: Andrew Turner Datum: dinsdag, 6 januari 2026 12:04 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: a9e77eb7016d - main - arm64: Correctly align the SVE signal context > > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a9e77eb7016df70723c208fc09fbd01ec23a732d > > commit a9e77eb7016df70723c208fc09fbd01ec23a732d > Author: Andrew Turner > AuthorDate: 2026-01-06 10:35:55 +0000 > Commit: Andrew Turner > CommitDate: 2026-01-06 10:36:37 +0000 > > arm64: Correctly align the SVE signal context > > The SVE signal context needs to be correctly aligned. Fix this by > creating a new macro to calculate the needed size to provide this > alignment, and use it when setting and checking the saved SVE signal > context. > > Reported by: cperciva > Reviewed by: cperciva, markj > Sponsored by: Arm Ltd > Differential Revision: https://reviews.freebsd.org/D54396 > --- > sys/arm64/arm64/exec_machdep.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > > diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c > index 7c50dc93fdb4..207e10ede96c 100644 > --- a/sys/arm64/arm64/exec_machdep.c > +++ b/sys/arm64/arm64/exec_machdep.c > @@ -60,6 +60,10 @@ > #include > #endif > > +#define CTX_SIZE_SVE(buf_size) \ > + roundup2(sizeof(struct sve_context) + (buf_size), \ > + _Alignof(struct sve_context)) > + > _Static_assert(sizeof(mcontext_t) == 880, "mcontext_t size incorrect"); > _Static_assert(sizeof(ucontext_t) == 960, "ucontext_t size incorrect"); > _Static_assert(sizeof(siginfo_t) == 80, "siginfo_t size incorrect"); > @@ -585,8 +589,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp) > > buf_size = sve_buf_size(td); > /* Check the size is valid */ > - if (ctx.ctx_size != > - (sizeof(sve_ctx) + buf_size)) > + if (ctx.ctx_size != CTX_SIZE_SVE(buf_size)) > return (EINVAL); > > memset(pcb->pcb_svesaved, 0, > @@ -729,7 +732,7 @@ sendsig_ctx_sve(struct thread *td, vm_offset_t *addrp) > { > struct sve_context ctx; > struct pcb *pcb; > - size_t buf_size; > + size_t buf_size, ctx_size; > vm_offset_t ctx_addr; > > pcb = td->td_pcb; > @@ -740,14 +743,15 @@ sendsig_ctx_sve(struct thread *td, vm_offset_t *addrp) > MPASS(pcb->pcb_svesaved != NULL); > > buf_size = sve_buf_size(td); > + ctx_size = CTX_SIZE_SVE(buf_size); > > /* Address for the full context */ > - *addrp -= sizeof(ctx) + buf_size; > + *addrp -= ctx_size; > ctx_addr = *addrp; > > memset(&ctx, 0, sizeof(ctx)); > ctx.sve_ctx.ctx_id = ARM64_CTX_SVE; > - ctx.sve_ctx.ctx_size = sizeof(ctx) + buf_size; > + ctx.sve_ctx.ctx_size = ctx_size; > ctx.sve_vector_len = pcb->pcb_sve_len; > ctx.sve_flags = 0; > > > > > ------=_Part_1243_575415837.1767701070865 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi.

Can this be related to this issue?

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292195
"arm64: panic on coredump with sve instructions"

Regards,
Ronald.

 

Van: Andrew Turner <andrew@FreeBSD.org>
Datum: dinsdag, 6 januari 2026 12:04
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: a9e77eb7016d - main - arm64: Correctly align the SVE signal context

The branch main has been updated by andrew:

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

commit a9e77eb7016df70723c208fc09fbd01ec23a732d
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2026-01-06 10:35:55 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-01-06 10:36:37 +0000

    arm64: Correctly align the SVE signal context
    
    The SVE signal context needs to be correctly aligned. Fix this by
    creating a new macro to calculate the needed size to provide this
    alignment, and use it when setting and checking the saved SVE signal
    context.
    
    Reported by:    cperciva
    Reviewed by:    cperciva, markj
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D54396
---
 sys/arm64/arm64/exec_machdep.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/sys/arm64/arm64/exec_machdep.c b/sys/arm64/arm64/exec_machdep.c
index 7c50dc93fdb4..207e10ede96c 100644
--- a/sys/arm64/arm64/exec_machdep.c
+++ b/sys/arm64/arm64/exec_machdep.c
@@ -60,6 +60,10 @@
 #include <machine/vfp.h>
 #endif
 
+#define    CTX_SIZE_SVE(buf_size)                  \
+    roundup2(sizeof(struct sve_context) + (buf_size),      \
+      _Alignof(struct sve_context))
+
 _Static_assert(sizeof(mcontext_t) == 880, "mcontext_t size incorrect");
 _Static_assert(sizeof(ucontext_t) == 960, "ucontext_t size incorrect");
 _Static_assert(sizeof(siginfo_t) == 80, "siginfo_t size incorrect");
@@ -585,8 +589,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp)
 
                buf_size = sve_buf_size(td);
                /* Check the size is valid */
-               if (ctx.ctx_size !=
-                   (sizeof(sve_ctx) + buf_size))
+               if (ctx.ctx_size != CTX_SIZE_SVE(buf_size))
                    return (EINVAL);
 
                memset(pcb->pcb_svesaved, 0,
@@ -729,7 +732,7 @@ sendsig_ctx_sve(struct thread *td, vm_offset_t *addrp)
 {
    struct sve_context ctx;
    struct pcb *pcb;
-   size_t buf_size;
+   size_t buf_size, ctx_size;
    vm_offset_t ctx_addr;
 
    pcb = td->td_pcb;
@@ -740,14 +743,15 @@ sendsig_ctx_sve(struct thread *td, vm_offset_t *addrp)
    MPASS(pcb->pcb_svesaved != NULL);
 
    buf_size = sve_buf_size(td);
+   ctx_size = CTX_SIZE_SVE(buf_size);
 
    /* Address for the full context */
-   *addrp -= sizeof(ctx) + buf_size;
+   *addrp -= ctx_size;
    ctx_addr = *addrp;
 
    memset(&ctx, 0, sizeof(ctx));
    ctx.sve_ctx.ctx_id = ARM64_CTX_SVE;
-   ctx.sve_ctx.ctx_size = sizeof(ctx) + buf_size;
+   ctx.sve_ctx.ctx_size = ctx_size;
    ctx.sve_vector_len = pcb->pcb_sve_len;
    ctx.sve_flags = 0;
 
 


  ------=_Part_1243_575415837.1767701070865--