From nobody Wed Jun 12 15:51:04 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 4VzqlF17g3z5MxwW; Wed, 12 Jun 2024 15:51:05 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VzqlD4jz9z4Yhf; Wed, 12 Jun 2024 15:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718207464; 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=/H4aLiNbYgZ2xDWFjvzDLQ/xhXg0+nMwYKpMyzENFi0=; b=SuehpNAobRNOMgo6WLjeP8tmX0FmE0U70ri6P+zsX9GUWe4YNej07COW1djcNwpmY791TE +HmEEvi8KUo6sReplOL2O6+CnSvXk3VnlO0F30dXqM3VElGyt3qaIeXMa/VIB9cYLVMZ31 mA4wXkpNTDtq6u8EmREs/vtijOh01F/UxKQAgcgEl+D+2X3312JZVIBj0hARma+IuHjj6C rj2C6xa4dwNQ5afv2IiHw02gWtrEWpN7g0aK8+KwqJCTXx+e7Z2riNd4IDnQsyt2ef/g5z FER9OsR4uIijGPWxw69hceMpCyhtjmbXjvnZJgzDtwAtZ8trrW1qFK5oY5CmRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718207464; a=rsa-sha256; cv=none; b=NEnyx2jFCuGHhdnb2Z8gU38X7mVNlKipQn09EW8as5iVBSjTOsYv39UUeCsum79h21lfW7 8C+tSvB/xedNBmW/kki447fLkLkIbh3dTtSj2fPH6D6idMs+nu5XDCeJ9SNXjQm8z5NKaw 4oB7+Mk0/8HPCr/k6sPIMAGDIyy2xh0DZpkimye1MjlnYUFDglLAEO4YsYcCv37PGt2tpy oooNTlZaaOnd00SaXuPJh2DAU/FyZIAMCM+fExyFk1SwzV/tbBfZA8Eyd+XO3EdFGWvugf /K9+absB4UQ/82PUpAWrdlMuFpLvTzLyk65MYhMRTLXwjCOmF+lqeBELvfI5+w== 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=1718207464; 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=/H4aLiNbYgZ2xDWFjvzDLQ/xhXg0+nMwYKpMyzENFi0=; b=uO3DhS1bXNLLto/DIZLSsRm9AH4EGO+paVbK7ynwJX0N5fsPbWm0vx3pTgL8KJ12QTKX8X DlKKLmTdKFlVZ2hDBQ2R7KKAWkLYJDKQRr1k5bMOeK3YUbBYm0Etk14RFSv5XmcJq0XFrB 2fLY3xgfy1Jvl3FMJRvTMNZ3gyL8fBhEpXpwh44Oi3VBXTisMQk44gcX5BuIbwjatxkvK2 zqz1F64U6RyF5GAL69pCkiuqj/p2g7eTjhMiHDHT/Ebf9bFfAxZ9gt49QgQLmxY1EiWLlq RGXjQM0XXg2WgOImkhnLIV5lCXIOOYX5YvqxyTSzLNEpx+uW5aGSZvBQ2ciReA== 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 4VzqlD47grzySK; Wed, 12 Jun 2024 15:51:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45CFp48g057519; Wed, 12 Jun 2024 15:51:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45CFp4pB057516; Wed, 12 Jun 2024 15:51:04 GMT (envelope-from git) Date: Wed, 12 Jun 2024 15:51:04 GMT Message-Id: <202406121551.45CFp4pB057516@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: 4eec584d79c1 - main - arm64: Clear td_frame when returning to userspace 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: 4eec584d79c1e8375d863c7eec7229ac7ec3f13b Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4eec584d79c1e8375d863c7eec7229ac7ec3f13b commit 4eec584d79c1e8375d863c7eec7229ac7ec3f13b Author: Andrew Turner AuthorDate: 2024-06-12 13:08:13 +0000 Commit: Andrew Turner CommitDate: 2024-06-12 13:08:13 +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 --- 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 662684588e0c..3dff834e27a2 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -252,9 +252,11 @@ ENTRY(handle_el0_sync) KMSAN_ENTER 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] KMSAN_LEAVE restore_registers 0 ERET