From nobody Mon Sep 02 08:50:43 2024 X-Original-To: dev-commits-src-branches@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 4Wy2XN3x06z5MnyS; Mon, 02 Sep 2024 08:50:44 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wy2XM4rNwz42DN; Mon, 2 Sep 2024 08:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267043; 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=+MgTWGISPQAg78jF3GPeFxZViEd3cmy2wUuvX549J5o=; b=tksKXnkD3jSg0utWvDfOGmGBJKzje6dQ7xdDvpeH7ZaYRcp+RLmL/cM+uVRMoZDgJWg8qw IYwg72t0RVcOX0mXfgZ5R+7w212Muyn/WcTLP/vdyNKGDe1iLgYyYs6C1AKaDMbp8t+Try wnyvR4tXn3R4W3WdTOuS4TbyRY+V82g2CCxmepN9S0G7lfEE/07KHvGh/FhQqtozy1Qmja jxHGit7/M650dv6uNRXogs7Z6Q3NS+uTUlJC5zk3HmOA0d6gDmAhppO7PWAmY9DPfGQt6k tBPS3aGVFrXaXdrublZ2nxamT0YmPx90qOEBtX2vxmdphKCbwC50lZGkhkazVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725267043; a=rsa-sha256; cv=none; b=b5BRulIm4NjRI8LlTDmrrA1UDpJkHyUrIxJDsq2wLz3qos3cDXQrOuJ4S3HbPCpbDxHmWi 2pfJ2JYGFuYYTEqL4SI370ly6jKtcPnICe2UeONpyRHBpUBm5Oa8gL1jKkbZXtX1eh0ukQ cxtv0k7BSg05axY6CcX0jm+vaQBit9LmROTt/AwtwkEES39YTzGE+pd1AVVBYEaBmEeIy5 oEiogJA3FKnkfjd7G19kGHuUCq3yPkUGnlgl7GBKpIlCIPxdF1+Q4tJnl75IVAZhypwD+k F/F6uCajaAOES63OWR9puvzEjWJpSFY6lrBwPGaXSt6jw+Wsh1qDJpXB/ZCWig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725267043; 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=+MgTWGISPQAg78jF3GPeFxZViEd3cmy2wUuvX549J5o=; b=A7cr9AzgJGNZ+ragnNJCl0hqsK9RopPVq7KiCQ7xLK1/0FEusOXrhtrGBuEZQfP3T9Xsg8 OslgaTq4kjzrhZs3T1ZONMRkddWCK9I2IcqdM/wapVmrGRG5mosYINX38S2ah5j+sp/W+q WJfCkJVYJCLdWYlDK2GL+R1zxYt3bwCh6pg8BU+vJeXe2nrckMnwgSjhghC1KxGuR51OXS RWKpVjCD0pkJ2uE1qu7PTl8qhGqiK6L0zbOe8SSBXSszBKSc40mVf3nmV6konL+hXQYzgL QMG9nm5g8RJjefWVhhqb6KwKPpyRdYmqLxb4qLEJ5pKIh5XdTI+s764xQJpZeA== 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 4Wy2XM4Pnbz1595; Mon, 2 Sep 2024 08:50:43 +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 4828ohcb007153; Mon, 2 Sep 2024 08:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4828oha5007150; Mon, 2 Sep 2024 08:50:43 GMT (envelope-from git) Date: Mon, 2 Sep 2024 08:50:43 GMT Message-Id: <202409020850.4828oha5007150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 8b9f8a7e763d - stable/14 - arm64: Clear td_frame when returning to userspace List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 8b9f8a7e763dfc533ce2abd5b48d1ba9f54165e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8b9f8a7e763dfc533ce2abd5b48d1ba9f54165e2 commit 8b9f8a7e763dfc533ce2abd5b48d1ba9f54165e2 Author: Andrew Turner AuthorDate: 2024-06-12 13:08:13 +0000 Commit: Andrew Turner CommitDate: 2024-09-02 08:48:17 +0000 arm64: Clear td_frame when returning to userspace When returning from an exception to userspace clear the saved td_frame. On the next exception this should point to the frame, however this is not guaranteed. To ensure the trap frame pointer is either valid or NULL clear it before returning to userspace in the EL0 synchronous exception handler. Reviewed by: kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44807 (cherry picked from commit 4eec584d79c1e8375d863c7eec7229ac7ec3f13b) --- sys/arm64/arm64/exception.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index b1990fc71281..0df440863632 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -214,9 +214,11 @@ ENTRY(handle_el0_sync) save_registers 0 ldr x0, [x18, #PC_CURTHREAD] mov x1, sp + mov x22, x0 str x1, [x0, #TD_FRAME] bl do_el0_sync do_ast + str xzr, [x22, #TD_FRAME] restore_registers 0 ERET END(handle_el0_sync)