From nobody Tue Aug 20 09:02:19 2024 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 4Wp3Pm44Msz5ShsH; Tue, 20 Aug 2024 09:02:20 +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 4Wp3Pl6tprz4vbw; Tue, 20 Aug 2024 09:02:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144540; 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=FjZ9RiKMC659aVDH3Z+ZSJVtLtVbySec3mAWm/qJW2s=; b=I5Mt9yIbxwzWxaWPPOL5JpADWc4fYEhWXBW5Q3szRY5w/iVYZ0ARPIAlby/GyZyg/y+4cy F5iJyV5KFQKa3rSww996gbCW9YWwzlfyT8l4rfHB58rCSHTUP/uapWpBKCsGW0t2XyOvz0 X7rw9GcAApK2nxZxq0A7J4jVjby8E+kTo080lffnQBR22QZz53aD3pJgorg2vFaPlqkdTc qeSdxmghdCK0eWP3KjED3IuJJO94pr/N9T+TGNc4Oko3HR2Nqt1eTZhCK/AL9qd1N0j472 Wj5JKlJmWl0BSkxqnLmGA8XC9WC+Yq7St18rXa6Zfph55XajO0K5w/PTmlRKow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144540; a=rsa-sha256; cv=none; b=Y+Fak1KaKBwX5X2hf1u8WuVwAZD6cttUNwQ7zwzYNm2hHod5gj9MRWrKcfaL2mCvMigVTr 6sgc9c2/hKwhjT4PCMdOyAwf1z9gTNXda9nqVkjLpdvBQFGR3xd7h67qbGmtVKBdrdreyD Txl6X7oOWJ+xEl6JVMctsYD9BTM8y/QthsXLnwmH9LVWjN8vdGuykykASbFwpWvWQ6rCqZ Vny/tSm0nnN9mQ54gvSF7466IjTJLOzShXFBp2a14laSEPxx/VXEPvRGoYOqGtKTZEEhDT APC9BslRmwq+yoXuL1WSdULcj7jwabe3bba6lZfadu6yzcjnrE+J+K9k83hjfg== 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=1724144540; 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=FjZ9RiKMC659aVDH3Z+ZSJVtLtVbySec3mAWm/qJW2s=; b=h/VWcPznvTMxwa9fdR+DSCRCMOeDZblQg72KnCcsXplCKU+4ecrhib0vI3VVtptcOP0831 Pq51lcAPzIYAtJPp7CI+9buUkE90jsxsqhxcSX/dM12VnUWZuIpHPT2DZPxmnfs+5UR4g6 h2N0EyPWtTW80d5rX13++400tZSl1FExxRcfiNfDvgAqA3gme6AfdHq1h95FuCuhBbkKD6 Navgg5r9WPvli6A/5Bu5pVEHK3gsZme+9InuAXHyKk7jMPusoXHtzxRGFe4OJYQigz2wQx 4/Rjm6LiKDO4VeO8W8gqQEx1YwkgLMlguJY+f80d7jNuBVnWVu1jYKUZfkrD9g== 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 4Wp3Pl6T1lztjk; Tue, 20 Aug 2024 09:02:19 +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 47K92JsI081602; Tue, 20 Aug 2024 09:02:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92J2Z081599; Tue, 20 Aug 2024 09:02:19 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:19 GMT Message-Id: <202408200902.47K92J2Z081599@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: 6b17f49da0a2 - main - arm64/vmm: Restore hcr_el2 earlier 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: 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: 6b17f49da0a2c4cba05e6a1994fb10d16f11fe0a Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6b17f49da0a2c4cba05e6a1994fb10d16f11fe0a commit 6b17f49da0a2c4cba05e6a1994fb10d16f11fe0a Author: Andrew Turner AuthorDate: 2024-08-19 12:43:51 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Restore hcr_el2 earlier It may cause fields in other registers to change meaning. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46077 --- sys/arm64/vmm/vmm_hyp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index 92f8cd25251d..9341f42daef6 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -262,6 +262,9 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) uint64_t dfr0; /* Restore the special registers */ + WRITE_SPECIALREG(hcr_el2, hypctx->hcr_el2); + isb(); + WRITE_SPECIALREG(elr_el1, hypctx->elr_el1); WRITE_SPECIALREG(sp_el0, hypctx->sp_el0); WRITE_SPECIALREG(tpidr_el0, hypctx->tpidr_el0); @@ -290,7 +293,6 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(spsr_el1, hypctx->spsr_el1); WRITE_SPECIALREG(cptr_el2, hypctx->cptr_el2); - WRITE_SPECIALREG(hcr_el2, hypctx->hcr_el2); WRITE_SPECIALREG(vpidr_el2, hypctx->vpidr_el2); WRITE_SPECIALREG(vmpidr_el2, hypctx->vmpidr_el2);