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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FE62C433EF for ; Mon, 20 Dec 2021 09:18:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbhLTJSJ (ORCPT ); Mon, 20 Dec 2021 04:18:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbhLTJSI (ORCPT ); Mon, 20 Dec 2021 04:18:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054E6C061574 for ; Mon, 20 Dec 2021 01:18:08 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id B84F2B80DA2 for ; Mon, 20 Dec 2021 09:18:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B1CEC36AE5; Mon, 20 Dec 2021 09:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639991885; bh=QT8TE5OZg9xFpKPCWQf7/TdMscTgPU04EByEA7AUTnw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rISuHgPlbqDcAqJ8hAMJDPNXGw0Br2+w9sPz1vUDTVIB/X1R5ZaEVVyOXYTlss/0i lxLI1s1stXGzKveHpWcwJ1LIUQLLaTk3rMqvvSuNWX65CSCNRNdvZVEumYnCvOzb5p xcp6YI/xvqLkyufZyoszFkrQeOssFI30HjzYqI49ngH+OhGxcSw1EC75WFeeGIxuM6 2nL8vuFKeXNFwVphPCMSeYgAftG1IG8qnvkMFlO+RHpTdnydZ9wTJaEItr8W7PbTxz Rog/2YkUmNHR09KBmIotnoxAzPIu7mQHXXOaeFsgWWdAMfD/0C9bBlXdLGsNwun18y 7WdHHHhdUYCRg== 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 1mzEnz-00DFJn-I5; Mon, 20 Dec 2021 09:18:03 +0000 Date: Mon, 20 Dec 2021 09:18:03 +0000 Message-ID: <87k0fzws6s.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 29/69] KVM: arm64: nv: Respect the virtual HCR_EL2.NV bit setting In-Reply-To: References: <20211129200150.351436-1-maz@kernel.org> <20211129200150.351436-30-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") Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, 20 Dec 2021 07:11:03 +0000, Ganapatrao Kulkarni wrote: > > Hi Marc, > > On 30-11-2021 01:31 am, Marc Zyngier wrote: > > From: Jintack Lim > > > > Forward traps due to HCR_EL2.NV bit to the virtual EL2 if they are not > > coming from the virtual EL2 and the virtual HCR_EL2.NV bit is set. > > > > In addition to EL2 register accesses, setting NV bit will also make EL12 > > register accesses trap to EL2. To emulate this for the virtual EL2, > > forword traps due to EL12 register accessses to the virtual EL2 if the > > virtual HCR_EL2.NV bit is set. > > > > This is for recursive nested virtualization. > > What is recursive nested virtualization means? > Are we going to set NV/NV1/NV2 bits of ID_AA64MMFR2_EL1 of > Guest-Hypervisor to support NV in Guest-Hypervisor? Of course. An implementation of nested virtualisation that would stop at L1 would be pretty crap and fail to live up to the 'turtles all the way down' paradigm. Note that the recursive support is still a work in progress, as making it work for real in a software model is an exercise in futility (for example, we make no effort to make the VNCR_EL2 mapping work past L1). Once someone sends me a NV-capable box, I'll get it working. M. -- Without deviation from the norm, progress is not possible.