From nobody Tue Aug 20 09:02:25 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 4Wp3Pt0Dydz5SjCL; Tue, 20 Aug 2024 09:02:26 +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 4Wp3Ps4VK9z4vlw; Tue, 20 Aug 2024 09:02:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724144545; 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=Fclc2UlIVTyK7GU6JSOBEJog36XgqLTJt+GY3B2V3t0=; b=KaqrFVhRSKKLCx+lEpf51ta+ir8d1Ht7MOOL1EyhbC462rLzzSHZki6HEEQwSrs4ronNwX POjIO7CuI9NstB//QDGSOG4SwLSPFUJPJ3HexUrAmYdBnMx9FBoYE6iosW2K5NinNbKexC yebjSmZXkvqmCFJoD+3V7N+vazaG97CyeFFqsDkIWmVuVWUFxqpjN533/dUH9pg/VIY5Hs diFZ+3wXC2BDO1xJVRtbKXjsrIPGxyPI+dLh9HoqESp95C2/xgsLrbMVRAG+iYi5jhFTzz 9OlOahjGdoG+sa+U6ZYgnl78oZsHpOjksYAT2xjMtH6ilFWLQSIevYUJI43FkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724144545; a=rsa-sha256; cv=none; b=ZwKs1jVRUoRKEOlS2GbrvKCOKXi7h5ZCymIJQ5DbAPph194+tcojlUXvn8Esl4K4GKXA1R jdlrVipHixGn7ubU3hRWrcngGWH3QBTv8IWT5M6EgWNgCmo9VMZTzZVevXNnpdc29H/ELr Nv8GYz6jFw+FySh7pQJLJyoRYD9MeN3AeqjQ/fdDZzuwLIHdOcNbpxtCEsZ2xPitqaiiBb WeN3aC86fftvXgVVEQ8UmNOSypjHQFYYIrJYj7YumakfvYQhFMz13hbhtp8meaH+DirvZC wGrLlblpMu3oJ4hgzR663Weyc8OjSXY3hIeKYEYBsbhjUICk7e+Tr3q5Q+DYHg== 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=1724144545; 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=Fclc2UlIVTyK7GU6JSOBEJog36XgqLTJt+GY3B2V3t0=; b=csmhKs0hTCdGPGLJlWpg1RcOWZSzd6DGqG8Zj65pRp8E6v8Q35ud03bHhxZOvT2I6i3nnT Kk8PY6w9A00zukoZ6btM5+1yyNU1gdnBsEuhMRpDhbKuNjxSdh1+R9jtZ318H/EvEqeSoD dMdUjO9IBjB3nCq1MQMaCPfx0TCl0iVtF1TmL1qfcKEUksAnvfmF0rF5oLUCDMJLpbXz2/ EyZ8iieUFj4gr+IG+slpBbEbPXbtq88cNMgzmOQW1AuaHTw2pXN3QOdHA/DZRyBdhAhpjl 1LqqHFcFSktdsrWJ1KRGMY3+NfudvqXlsbw7PKF76hkPRk6qoDOoBVt2FcU98A== 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 4Wp3Ps437kzv01; Tue, 20 Aug 2024 09:02:25 +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 47K92P7G081841; Tue, 20 Aug 2024 09:02:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47K92PdL081838; Tue, 20 Aug 2024 09:02:25 GMT (envelope-from git) Date: Tue, 20 Aug 2024 09:02:25 GMT Message-Id: <202408200902.47K92PdL081838@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: 79a19e0e8d8d - main - arm64/vmm: Hide non-VHE exception code from VHE 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: 79a19e0e8d8d1fa71092e542671213bfe99b024e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=79a19e0e8d8d1fa71092e542671213bfe99b024e commit 79a19e0e8d8d1fa71092e542671213bfe99b024e Author: Andrew Turner AuthorDate: 2024-08-19 12:44:24 +0000 Commit: Andrew Turner CommitDate: 2024-08-20 08:49:16 +0000 arm64/vmm: Hide non-VHE exception code from VHE Remove the non-VHE exception code from the VHE code path. As we replace the exception vectors when entering the guest we don't need to check which context we are in so can skip parts of the exception vectors. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46082 --- sys/arm64/vmm/vmm_hyp_exception.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/arm64/vmm/vmm_hyp_exception.S b/sys/arm64/vmm/vmm_hyp_exception.S index cd2b94f1ff0b..95b0e20f37ed 100644 --- a/sys/arm64/vmm/vmm_hyp_exception.S +++ b/sys/arm64/vmm/vmm_hyp_exception.S @@ -183,6 +183,7 @@ hyp_vectors: .macro handle_el2_excp type +#ifndef VMM_VHE /* Save registers before modifying so we can restore them */ str x9, [sp, #-16]! @@ -193,15 +194,18 @@ hyp_vectors: /* We got the exception while the guest was running */ ldr x9, [sp], #16 +#endif /* !VMM_VHE */ do_world_switch_to_host mov x0, \type ret +#ifndef VMM_VHE 1: /* We got the exception while the host was running */ ldr x9, [sp], #16 mov x0, \type ERET +#endif /* !VMM_VHE */ .endm @@ -223,6 +227,7 @@ LEND(handle_el2_el2h_error) LENTRY(handle_el2_el1_sync64) +#ifndef VMM_VHE /* Save registers before modifying so we can restore them */ str x9, [sp, #-16]! @@ -245,7 +250,9 @@ LENTRY(handle_el2_el1_sync64) ldr lr, [sp], #16 ERET -1: /* Guest exception taken to EL2 */ +1: +#endif + /* Guest exception taken to EL2 */ do_world_switch_to_host mov x0, #EXCP_TYPE_EL1_SYNC ret