From nobody Tue Nov 19 17:47:02 2024 X-Original-To: dev-commits-src-all@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 4XtBlB6tZVz5fGPm; Tue, 19 Nov 2024 17:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XtBlB6Hryz4RDp; Tue, 19 Nov 2024 17:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732038422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xEA7P1xM44wYQSvVLbu/7jLuhje4aa8UHOsfa0b5l+Y=; b=guWejKB6uxaRENjPXLSB7oE1qqkzmim+2QFx1Ht7eW9XkE9csnQOzi6GhC1GzRBJYxY9nM lRc3cBWqzzClcbeqh29i7Hy95g1mzeOkZSlV5L7JOJqB+zfux0i0ygvNiVARGgAGIWKYvr dOe14W/a5CO+88TIgDhhY2Bai6DUJKGO3agKmic5j6tHZb7ML1SL93C1RlKCs4iMigqciW dm0ii8mWHPVQ/d6KI6fyakoTi+OQKyiAos/rCBTCvIHMpJ85OgNlCUTKM5dBFxQhTQ2qb1 b1RM+JIFrnn+cLhGSA5yKOBJQV6HadDLHm6PC06FESZXNJY9PxhBNmnGyNqIbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732038422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xEA7P1xM44wYQSvVLbu/7jLuhje4aa8UHOsfa0b5l+Y=; b=gutncARlKJo5aVNCdYohAOj9ewG9mm8NzZpI1tQH3QtyulRavlOsD8GnjCflEn1mFfl3Ms z/drh1khM1Dw0bx+tQ01iV9cUGGJeNTuiGf/3hQNqxRgxXi45oYuN3o+lP6HWHFK+1DkGp DCODbkdHZ677/myBJs8N+l1fnDLHpXnmWmmIbJYsmszR9TIRU5CxTjhbn46umVWv3gZrgf smiBF4YCaz67/a+MN3rTbkFaNechY0hZYaqL4rcEjxqsd9DEYoD3SkB4jN5MiyMYd6qCjO R5zTsEsMGKr5HfqUVRVKDqZ7u0XqADsCW620IO8zlONlmd1x4sDm/UYFAVYQ+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732038422; a=rsa-sha256; cv=none; b=PwS2QA88xWzPOKipyisAvx80csj4g/AYJk9HAPKRLthf5z22ulw0fR3CPnFMBKPM+1s473 fKXjqaSXRcpEWKtJp0qI4nTF6lk+DpU4jKDcooDk8QbQJPQCEpsG8Y+SMSiKs5wfHZ6bWd FV8b6o8nG5r4BbSpBsPY79FRYMPKmERgt7FCoogcc//CPiI2wYrwG275SKaK/GtMn1fxb7 OnjNqPR6tHG6dCjXs0jp41b1uTjcUSDmtpBV3LxaOAfX5kHiIeOLYtmqtrLDgzg1WX2lqB 4cn3S6upWMBYd3L4C6zR896ZmYl6N5cFNf89D/2a9zjG0Dho4rUA9z0rgG5SUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XtBlB5vKkzK3r; Tue, 19 Nov 2024 17:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AJHl250000879; Tue, 19 Nov 2024 17:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJHl2Qb000875; Tue, 19 Nov 2024 17:47:02 GMT (envelope-from git) Date: Tue, 19 Nov 2024 17:47:02 GMT Message-Id: <202411191747.4AJHl2Qb000875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 9ff643a8da47 - main - arm64: Adjust the MPASS in vfp_save_state_savectx List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ff643a8da476c38b29c071d00805d52b851ee03 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9ff643a8da476c38b29c071d00805d52b851ee03 commit 9ff643a8da476c38b29c071d00805d52b851ee03 Author: Andrew Turner AuthorDate: 2024-11-18 15:34:09 +0000 Commit: Andrew Turner CommitDate: 2024-11-19 17:31:00 +0000 arm64: Adjust the MPASS in vfp_save_state_savectx In vfp_save_state_savectx we check if the pcb has a NULL vfp state. When it's called multiple times with the same pcb then we can panic because the vfp state has been set. Weaken the requirement for the state pointer to be NULL by also allowing it to point to the pcb vfp state area we are about to use. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47237 --- sys/arm64/arm64/vfp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index a3aa77ed6180..bcddebfaf66e 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -577,10 +577,13 @@ vfp_save_state_savectx(struct pcb *pcb) { /* * savectx() will be called on panic with dumppcb as an argument, - * dumppcb doesn't have pcb_fpusaved set, so set it to save - * the VFP registers. + * dumppcb either has no pcb_fpusaved set or it was previously set + * to its own fpu state. + * + * In both cases we can set it here to the pcb fpu state. */ - MPASS(pcb->pcb_fpusaved == NULL); + MPASS(pcb->pcb_fpusaved == NULL || + pcb->pcb_fpusaved == &pcb->pcb_fpustate); pcb->pcb_fpusaved = &pcb->pcb_fpustate; vfp_save_state_common(curthread, pcb, true);