From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A847CC25B76 for ; Mon, 3 Jun 2024 14:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+rh+lVKfG7wYagUo54ykNZSOwSeBfksrhrtOLOk+GZU=; b=EWBQkiJSmB1chw NDiPUA12StKPu4fNAvRRfVMVClG3E2k6KJaOK65JCntQwNmVKK+jPJ0Dk6F0zokTvqPRP7UIB25+c 09om7Htj5QwlScMtuSP+sfNzz3VRpxdnKHfHx4d64Gfo0qwazyU2fXd2to9yE0nPmaybgF+fUXnp/ UozTrNoqxWTSNOVWlbgau1uia+emVd6DQVGwOX7t4T4tKJzGK/NYmrC21AsEsQzwY0ijw5kKpSlTO W4+E1SEIjLm+7Nhf3aRMmCw8R3HrLw4p5jgQSGElO+sFWDU89RDCcupqsx9LAnVE2fY80jp/dMSGG rjOwACpO6O9Cd1iWJytw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE8hw-0000000H55F-0YR2; Mon, 03 Jun 2024 14:30:44 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE8hq-0000000H50B-072g for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2024 14:30:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4331E60EA9; Mon, 3 Jun 2024 14:30:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6214AC4AF09; Mon, 3 Jun 2024 14:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717425036; bh=zew+uG4r68QwYLUFKAKzwIzu32pc5sfFcOmdOWTc4V8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fg49YqSESADLCHTZ8owxyuJbUfacYZM3r8mgmhN8iWK80vEK48+LWPLhqnBDJekrv NvNtSSfeDBOSsKqdNIU4kJdtC2pTX2z+PYNzzkK/UwF3AXlTdD9PAmROp8EC5nJUMG TUsh6ruqRtWpD6ECVJLujfnNAuTJl/iVhf1uEwqiEINIWbGejej7Ft/O+arqXaQwD3 Px4AZYeQj9veYg5u712HacUI//gJG0acajSga3m1HELZhp/DhuKrbgVPaOG7G87jll rh22LBxo/Y7DEILknNRpDSK+BZSvat0BomoClfcWgChgE9EkPyqlkVNb+63esoLjb5 EDbw6l75Cxs+w== Date: Mon, 3 Jun 2024 15:30:30 +0100 From: Will Deacon To: =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Oliver Upton , Suzuki K Poulose , Vincent Donnefort Subject: Re: [PATCH v4 03/13] KVM: arm64: nVHE: Simplify __guest_exit_panic path Message-ID: <20240603143030.GD19151@willie-the-truck> References: <20240529121251.1993135-1-ptosi@google.com> <20240529121251.1993135-4-ptosi@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240529121251.1993135-4-ptosi@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240603_073038_959393_DCDDA037 X-CRM114-Status: GOOD ( 19.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 29, 2024 at 01:12:09PM +0100, Pierre-Cl=E9ment Tosi wrote: > In invalid_host_el2_vect (i.e. EL2{t,h} handlers in nVHE guest context), *guest* context? Are you sure? > remove the duplicate vCPU context check that __guest_exit_panic also > performs, allowing an unconditional branch to it. > = > Signed-off-by: Pierre-Cl=E9ment Tosi > --- > arch/arm64/kvm/hyp/nvhe/host.S | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > = > diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/hos= t.S > index 135cfb294ee5..71fb311b4c0e 100644 > --- a/arch/arm64/kvm/hyp/nvhe/host.S > +++ b/arch/arm64/kvm/hyp/nvhe/host.S > @@ -197,18 +197,13 @@ SYM_FUNC_END(__host_hvc) > sub x0, sp, x0 // x0'' =3D sp' - x0' =3D (sp + x0) - sp =3D x0 > sub sp, sp, x0 // sp'' =3D sp' - x0 =3D (sp + x0) - x0 =3D sp > = > - /* If a guest is loaded, panic out of it. */ > - stp x0, x1, [sp, #-16]! > - get_loaded_vcpu x0, x1 > - cbnz x0, __guest_exit_panic > - add sp, sp, #16 I think this is actually dead code and we should just remove it. AFAICT, invalid_host_el2_vect is only used for the host vectors and the loaded vCPU will always be NULL, so this is pointless. set_loaded_vcpu() is only called by the low-level guest entry/exit code and with the guest EL2 vectors installed. > - > /* > * The panic may not be clean if the exception is taken before the host > * context has been saved by __host_exit or after the hyp context has > * been partially clobbered by __host_enter. > */ > - b hyp_panic > + stp x0, x1, [sp, #-16]! > + b __guest_exit_panic In which case, this should just be: add sp, sp, #16 b hyp_panic Did I miss something? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel