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 9351BC433F5 for ; Fri, 26 Nov 2021 10:52:39 +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=Tw/pVWssGs9OegdiE5u6RZb862mv2u9WmB3OE/4qABM=; b=4J9+bt1WQJGvlJ 3uLDfQAfqORFW0Tl7LdneEk+dyVzlds5gQH4gqAuY+rnzXnW15NjljerJU+/RHgKbqlNYFNr3jDBH IRkOgvRhIIOVvJvKMYSF8Ax488KlRXsUQqzAJRH3rOqoN/YvZ7Kz1YulYpFPByzpBa4zPLMyez4GP qOoK0YfrahTkb+m11r/LCuGWVyq9TGmN9UErLaPFj/C9yMr2nadPZ+Ah1sqarpbBw9T7sg8NvADWn QO2kZIcm7G22KNgeKP3dX5w6jS4K0VZ9ay50IfpH+EtfFAsTMkn7sMCxb5t8WLEpZX6yo3bZIw7DU W3czsbzd8iUZwr70AIjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqYot-00A5oh-3x; Fri, 26 Nov 2021 10:51:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqYop-00A5nd-29 for linux-arm-kernel@lists.infradead.org; Fri, 26 Nov 2021 10:51:04 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5268461108; Fri, 26 Nov 2021 10:51:02 +0000 (UTC) Received: from sofa.misterjones.org ([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 1mqYol-0080U2-SJ; Fri, 26 Nov 2021 10:51:00 +0000 Date: Fri, 26 Nov 2021 10:50:59 +0000 Message-ID: <875ysfchrg.wl-maz@kernel.org> From: Marc Zyngier To: Ganapatrao Kulkarni Cc: catalin.marinas@arm.com, will@kernel.org, andre.przywara@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, darren@os.amperecomputing.com, Quentin Perret , D Scott Phillips Subject: Re: [PATCH 1/2] KVM: arm64: Use appropriate mmu pointer in stage2 page table init. In-Reply-To: <84b7602f-93c1-74e3-bebf-23ed9e795b9b@os.amperecomputing.com> References: <20211122095803.28943-1-gankulkarni@os.amperecomputing.com> <20211122095803.28943-2-gankulkarni@os.amperecomputing.com> <87bl28cpko.wl-maz@kernel.org> <84b7602f-93c1-74e3-bebf-23ed9e795b9b@os.amperecomputing.com> 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, catalin.marinas@arm.com, will@kernel.org, andre.przywara@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, darren@os.amperecomputing.com, qperret@google.com, scott@os.amperecomputing.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-20211126_025103_206065_8CE83AED X-CRM114-Status: GOOD ( 39.16 ) 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 Hi Ganapatro, On Fri, 26 Nov 2021 05:45:26 +0000, Ganapatrao Kulkarni wrote: > > Hi Marc, > > > On 25-11-2021 07:19 pm, Marc Zyngier wrote: > > [+ Quentin] > > > > Hi Ganapatro, > > > > On Mon, 22 Nov 2021 09:58:02 +0000, > > Ganapatrao Kulkarni wrote: > >> > >> The kvm_pgtable_stage2_init/kvm_pgtable_stage2_init_flags function > >> assume arch->mmu is same across all stage 2 mmu and initializes > >> the pgt(page table) using arch->mmu. > >> Using armc->mmu is not appropriate when nested virtualization is enabled > >> since there are multiple stage 2 mmu tables are initialized to manage > >> Guest-Hypervisor as well as Nested VM for the same vCPU. > >> > >> Add a mmu argument to kvm_pgtable_stage2_init that can be used during > >> initialization. This patch is a preparatory patch for the > >> nested virtualization series and no functional changes. > > > > Thanks for having had a look, and for the analysis. This is obviously > > a result of a hasty conversion to the 'new' page table code, and a > > total oversight on my part. > > > > I'm however not particularly thrilled with the approach you have taken > > though, as carrying both the kvm->arch pointer *and* the mmu pointer > > seems totally redundant (the mmu structure already has a backpointer > > to kvm->arch or its pkvm equivalent). All we need is to rework the > > initialisation for this pointer to be correct at the point of where we > > follow it first. > > > > I've pushed out my own version of this[1]. Please have a look. > > > > Thanks, > > > > M. > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=kvm-arm64/nv-5.16-WIP&id=21790a24d88c3ed37989533709dad3d40905f5c3 > > > > Thanks for the rework and rebasing to 5.16. > > I went through the patch, the gist of the patch seems to me same. > Please free feel to add, > Reviewed-by: Ganapatrao Kulkarni Thanks! > Looks like kvm-arm64/nv-5.16-WIP branch is broken for NV. > I tried booting Guest hypervisor using lkvm and the vcpu init from > lkvm is failing(Fatal: Unable to initialise vcpu). Did not dig/debug > more in to the issue yet. I'm still trying to iron a few issues, but you should be able to boot a NV guest. However, the way it is enabled has changed: you need to pass 'kvm-arm.mode=nested' to the command line instead of the previous 'kvm-arm.nested=1' which I have got rid of. That could well be the issue. With the current state of the tree (I just pushed another fix), you should be able to boot a L1 guest hypervisor and a L2 guest. I'm getting a crash at the point where the L2 guest reaches userspace though, so something is broken in the PSTATE or ERET tracking, I'd expect. 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