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 DE731C433F5 for ; Mon, 20 Dec 2021 09:41:23 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F/JB+A+QiR5Znattk3yACl6ZQ5Wsn56PEQsDYl9Yrhw=; b=YiQjWwQxFAUaYk KVQSzcJAqcnAhI2vZQunO+9WJbZRnlUYl0Yj9utneW6PIk3YrS6oQ00O+orEbtrBhYdeuSyWgREYo UT7QfE8FTs6nIAaP0W0mW5h6Z7GiR4iAEQZYlcql5BqBJBiBDhINGZutaUhyEskLPE3hrMTZlA+0Y kqR5R0w74yAaW8v93BVZDzZ1d0eA+62rXVD7lriEh8joP2A1h6nI/oi+K7kXOu82QfMIZIukTSu16 tkeUjHnLDMm5T4Hli0nTpXNTGYpwNapO2ZE+zJhLnny2hGyofHQcXkOu+EF3mnL8Px/FE4DIAthqS dAec+jkDK40EOuFO1OXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzF92-001RpB-So; Mon, 20 Dec 2021 09:39:50 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzF8P-001RZw-Kf for linux-arm-kernel@lists.infradead.org; Mon, 20 Dec 2021 09:39:11 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21A0D60F59; Mon, 20 Dec 2021 09:39:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A6BBC36AE8; Mon, 20 Dec 2021 09:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639993148; bh=8uqK3NceI45AFjqWjabQhkzy6OyB8l6tZbp7LghvIPU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RX8e5eMEk4RDyeQGulOkOgxMG4kHuZ26vU8V2tfRww7hqIdmjC3pEcL9wLxlw66qI 0/ld8agKowe1G0Dkk+4uCU6FQukTYi3brHqjQQGQGwyyOrRdBkUZ0I5ovUNFztuYJ6 xCLepJgI63eTJlODabNrOtGv6qwrw5ohKFbDEIjuLjJdSkY2qIHT2+hm40AzCYb6Xs HWeHaswpxhg94mxJART9fKnUrknTcW/hAcF/7/ugF30nVFlgKAJBgHpH7/Yt39GaUi 9LiGntmonRo3XZkrOjPpijKIuEFhxwd6UqBnDypTTiKvWThJRwrw1HBXT/KttDgfa4 ohzUY5iek5AVw== Received: from cfbb000407.r.cam.camfibre.uk ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mzF8M-00DFb8-LE; Mon, 20 Dec 2021 09:39:06 +0000 Date: Mon, 20 Dec 2021 09:39:06 +0000 Message-ID: <87ilvjwr7p.wl-maz@kernel.org> From: Marc Zyngier To: Ganapatrao Kulkarni Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Andre Przywara , Christoffer Dall , Jintack Lim , Haibo Xu , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com Subject: Re: [PATCH v5 31/69] KVM: arm64: nv: Respect the virtual HCR_EL2.NV1 bit setting In-Reply-To: References: <20211129200150.351436-1-maz@kernel.org> <20211129200150.351436-32-maz@kernel.org> 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/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: gankulkarni@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, andre.przywara@arm.com, christoffer.dall@arm.com, jintack@cs.columbia.edu, haibo.xu@linaro.org, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_013909_798644_3DA54C38 X-CRM114-Status: GOOD ( 23.32 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 20 Dec 2021 07:18:51 +0000, Ganapatrao Kulkarni wrote: > > > > On 30-11-2021 01:31 am, Marc Zyngier wrote: > > From: Jintack Lim > > > > Forward ELR_EL1, SPSR_EL1 and VBAR_EL1 traps to the virtual EL2 if the > > virtual HCR_EL2.NV bit is set. > > > > This is for recursive nested virtualization. > > > > Signed-off-by: Jintack Lim > > Signed-off-by: Marc Zyngier > > --- > > arch/arm64/include/asm/kvm_arm.h | 1 + > > arch/arm64/kvm/sys_regs.c | 28 +++++++++++++++++++++++++++- > > 2 files changed, 28 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h > > index 9759bc893a51..68af5509e4b0 100644 > > --- a/arch/arm64/include/asm/kvm_arm.h > > +++ b/arch/arm64/include/asm/kvm_arm.h > > @@ -20,6 +20,7 @@ > > #define HCR_AMVOFFEN (UL(1) << 51) > > #define HCR_FIEN (UL(1) << 47) > > #define HCR_FWB (UL(1) << 46) > > +#define HCR_NV1 (UL(1) << 43) > > #define HCR_NV (UL(1) << 42) > > #define HCR_API (UL(1) << 41) > > #define HCR_APK (UL(1) << 40) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > > index e96877fc3b2a..511e06b6f603 100644 > > --- a/arch/arm64/kvm/sys_regs.c > > +++ b/arch/arm64/kvm/sys_regs.c > > @@ -288,6 +288,22 @@ static bool access_rw(struct kvm_vcpu *vcpu, > > return true; > > } > > +/* This function is to support the recursive nested > > virtualization */ > > +static bool forward_nv1_traps(struct kvm_vcpu *vcpu, struct sys_reg_params *p) > > +{ > > + return forward_traps(vcpu, HCR_NV1); > > +} > > + > > Shall we move this helper to emulate-nested.c? Sure, that shouldn't be a problem. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel