From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58F861B947; Sun, 17 Mar 2024 11:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710675769; cv=none; b=tUjrUGR8b9x9NraWwj48DQEKx9z6x57p5k4p4YPnCGBcY3Y4vNElXStZSJlQJqBQuIa/qSak/FsWDYoxhkH8+xVL6FqG4bZmX9jZydVs9UXVVufkzp6xP2txlXhe+vXvvd5L4MG7eU+TMSruMN1dfpqqu57QAHuXUogaoS8e5GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710675769; c=relaxed/simple; bh=yIs6FmWfE+g2CBU9z0E91nMt7P9sDGyQXWi8VWIJaV4=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=fKmP5fTe/z3jPpz0n8FgNvEAQ4iMc4lr+glso4Hx0TU1o6NWWh69PQ3c4JkLXV5LvHc/jPIP1k/aqGEdh/YK2fp9jxPTobhazQDHn8E/Kx5uLICL7+mwHgbEzDkJLluhzzyYKEOhz3IjWn2AKDIrrzrCw99r8dYD4k4XnWDXmpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hqbwkovl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hqbwkovl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D25E9C433F1; Sun, 17 Mar 2024 11:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710675768; bh=yIs6FmWfE+g2CBU9z0E91nMt7P9sDGyQXWi8VWIJaV4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hqbwkovlvfUoXlY5ydcjEvUyjUsyhjG29LkaktzOCa5mdJsmPTJOdiRAcxGrXOPoN Fo8lOmhBOanUnDA6D4IvYcURviaTQpTT9afwL1ZSLgX+wbKRj/1/uutdjprNW5aZLn Oo9rA53m5P2vXKSr2TVNtBE0r1GIw3It+f2Sl6Hc0z+AS3bDAFeBWffWAyHzqKj20g hb101omTBtdaUhaENDy6Ci7TwgbmtNrHdjCW9zJbLL3pqv35DWpQEHPnlWoFk2+SKZ /HYfENlc7nY+DjMtYc+hIwm94Q+QwlN0f2dPnBX7AOk2n8pD17EZMB04WZb5y4Dgqd yRJWWyIpEy3QA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rlouc-00D1X5-H0; Sun, 17 Mar 2024 11:42:46 +0000 Date: Sun, 17 Mar 2024 11:42:44 +0000 Message-ID: <86bk7d13uz.wl-maz@kernel.org> From: Marc Zyngier To: =?UTF-8?B?UGllcnJlLUNsw6ltZW50?= Tosi Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: Re: [PATCH 05/10] KVM: arm64: nVHE: Add EL2 sync exception handler In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ptosi@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 14 Mar 2024 20:24:31 +0000, Pierre-Cl=C3=A9ment Tosi wrote: >=20 > Introduce handlers for EL2{t,h} synchronous exceptions distinct from > handlers for other "invalid" exceptions when running with the nVHE host > vector. This will allow a future patch to handle CFI (synchronous) > errors without affecting other classes of exceptions. >=20 > Remove superfluous SP overflow check from the non-synchronous > handlers. Why are they superfluous? Because we are panic'ing? Detecting a stack overflow is pretty valuable in any circumstances. >=20 > Signed-off-by: Pierre-Cl=C3=A9ment Tosi > --- > arch/arm64/kvm/hyp/nvhe/host.S | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) >=20 > diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/hos= t.S > index 27c989c4976d..1b9111c2b480 100644 > --- a/arch/arm64/kvm/hyp/nvhe/host.S > +++ b/arch/arm64/kvm/hyp/nvhe/host.S > @@ -183,7 +183,7 @@ SYM_FUNC_END(__host_hvc) > .endif > .endm > =20 > -.macro invalid_host_el2_vect > +.macro host_el2_sync_vect > .align 7 > =20 > /* > @@ -221,6 +221,11 @@ SYM_FUNC_END(__host_hvc) > b __hyp_do_panic > .endm > =20 > +.macro invalid_host_el2_vect > + .align 7 > + b __hyp_panic > +.endm > + > /* > * The host vector does not use an ESB instruction in order to avoid con= suming > * SErrors that should only be consumed by the host. Guest entry is defe= rred by > @@ -233,12 +238,12 @@ SYM_FUNC_END(__host_hvc) > */ > .align 11 > SYM_CODE_START(__kvm_hyp_host_vector) > - invalid_host_el2_vect // Synchronous EL2t > + host_el2_sync_vect // Synchronous EL2t The real question is: under which circumstances would running with SP_EL0 be valid? I cannot see good reason for it. M. --=20 Without deviation from the norm, progress is not possible.