From nobody Tue Aug 20 09:02:22 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 4Wp3Pp6Bggz5Sj8r; Tue, 20 Aug 2024 09:02:22 +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 4Wp3Pp2kHTz4vj4; Tue, 20 Aug 2024 09:02:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144542; 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=hFAPG/SqsHTaTAGMRW7LxxDISBd2muLnLZZ53KpDEuk=; b=QFldxuFhCmWFm5Xrhv/v79cCVYyxxMmsV+y7O7X/1zF1GtPpcIB8UBZ+R87JDGUtfz37X6 HfS6UaBzgzNW4sK841OzqqRzbz9iybld4epb6Vr7VWry92dquSbi1UBT/b9LNEhyab/yBd BTOYLklc53QpORoIW0SM2464IoLqXvUBt6nOFzqWMFFrguPGfjzmJ2MG/rB2mSHeZbCQHY 1bYwJhNH9ME1Mp/UJVyt3oYgsu+IYURbFzuB1yDn/p85K41bVLClcaIkjVXGImT/LxjjBL 7ioPrIFj/hmQOIM544HxX4RGJZG6ImWffgoJJ5sB8oUaGr5eoj7Y31xF17X+ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144542; a=rsa-sha256; cv=none; b=bNVjsnNY/Xq/Z/4Mi6VFiM7hYv75RxbGiSsvXouYP8uAU79NREjI6tuNe1ga3xjcqeOIRy by7y4NXAgCELmy0/+pE3WcEZrNj4ET/fy65UgYzkpypUIrsrkKLvrpYBdbHT8qr8uXC3FR nsuMbHqzpivrtWLOOkYjKDSW7xv9VdkDWfwyHMwapygfuSeQ9z758Ny0RKpZ9oM/Bzlu/w BMNLSGf7Hp2a7b/o9xClvbTYP1cHMH9DeWCfCor8UKOtAm94pvsZ9xJj2RXFvubv0kc1Q6 TejcluUoFs9tTHytmk9j/8q8tU+KU/+snR+HtgvCBxeqDFzPzxpTFHVQxtdR4A== 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=1724144542; 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=hFAPG/SqsHTaTAGMRW7LxxDISBd2muLnLZZ53KpDEuk=; b=T1XX3REQIHYARRuUw3RE7o9RN/NT6aZM7VQhk6XN3L4FlF8XhscmXSWjyzxguktXfsgo/R zdP4xmNiHtHszc8HiL7Rq1cDFer3DZN3B4LvSAINngl75XB3WyMpSW20bsMt96K0RLtcD9 ehLNtl5FkHKqge1HUMi8HF2xv7HgeHwGzDWsJk8wS0Uiw2383K8zt1eCYuiwWua/TVI5+g uLxJeAaC9BGQRa04LIX/12QlRjnj9xNsHwgjCvYcxx+Qhla0O+8wvFzyNBttOXkeq8rJS0 PydYUhFhJ0GFQ1j0twQlDdSSVao5/M33cCdB/DkH6vQd+P7iOb01E6syjNswWA== 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 4Wp3Pp1MWxztfq; Tue, 20 Aug 2024 09:02:22 +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 47K92MX5081697; Tue, 20 Aug 2024 09:02:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92MDW081694; Tue, 20 Aug 2024 09:02:22 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:22 GMT Message-Id: <202408200902.47K92MDW081694@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: 20eabb33b464 - main - arm64/vmm: Only store the guest par_el1 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: 20eabb33b4645bc088c40d6475d5fa628b39031f Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=20eabb33b4645bc088c40d6475d5fa628b39031f commit 20eabb33b4645bc088c40d6475d5fa628b39031f Author: Andrew Turner AuthorDate: 2024-08-19 12:44:05 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:15 +0000 arm64/vmm: Only store the guest par_el1 There is no need to store the host par_el1. We don't depend on it not changing across calls into a guest. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46079 --- sys/arm64/vmm/vmm_hyp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index ae0c46331382..9c84bb4b294e 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -220,6 +220,7 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) hypctx->tf.tf_spsr = READ_SPECIALREG(spsr_el2); if (guest) { hypctx->tf.tf_esr = READ_SPECIALREG(esr_el2); + hypctx->par_el1 = READ_SPECIALREG(par_el1); } /* Store the guest special registers */ @@ -232,7 +233,6 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest) hypctx->csselr_el1 = READ_SPECIALREG(csselr_el1); hypctx->mdccint_el1 = READ_SPECIALREG(mdccint_el1); hypctx->mdscr_el1 = READ_SPECIALREG(mdscr_el1); - hypctx->par_el1 = READ_SPECIALREG(par_el1); if (guest_or_nonvhe(guest)) { hypctx->elr_el1 = READ_SPECIALREG(EL1_REG(ELR)); @@ -279,7 +279,6 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(csselr_el1, hypctx->csselr_el1); WRITE_SPECIALREG(mdccint_el1, hypctx->mdccint_el1); WRITE_SPECIALREG(mdscr_el1, hypctx->mdscr_el1); - WRITE_SPECIALREG(par_el1, hypctx->par_el1); if (guest_or_nonvhe(guest)) { WRITE_SPECIALREG(EL1_REG(ELR), hypctx->elr_el1); @@ -302,6 +301,10 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest) WRITE_SPECIALREG(EL1_REG(TTBR1), hypctx->ttbr1_el1); } + if (guest) { + WRITE_SPECIALREG(par_el1, hypctx->par_el1); + } + WRITE_SPECIALREG(cptr_el2, hypctx->cptr_el2); WRITE_SPECIALREG(vpidr_el2, hypctx->vpidr_el2); WRITE_SPECIALREG(vmpidr_el2, hypctx->vmpidr_el2);