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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E1E2C433FE for ; Thu, 25 Nov 2021 13:50:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 02FF74B150; Thu, 25 Nov 2021 08:50:11 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dOEMiBNRjfzq; Thu, 25 Nov 2021 08:50:09 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EE6534B164; Thu, 25 Nov 2021 08:50:09 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 804824B11A for ; Thu, 25 Nov 2021 08:50:08 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hwctD0GNp+d6 for ; Thu, 25 Nov 2021 08:50:03 -0500 (EST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 5782D4B126 for ; Thu, 25 Nov 2021 08:50:03 -0500 (EST) 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 4CAFE60EB5; Thu, 25 Nov 2021 13:50: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 1mqF8R-007oqV-So; Thu, 25 Nov 2021 13:50:00 +0000 Date: Thu, 25 Nov 2021 13:49:59 +0000 Message-ID: <87bl28cpko.wl-maz@kernel.org> From: Marc Zyngier To: Ganapatrao Kulkarni Subject: Re: [PATCH 1/2] KVM: arm64: Use appropriate mmu pointer in stage2 page table init. In-Reply-To: <20211122095803.28943-2-gankulkarni@os.amperecomputing.com> References: <20211122095803.28943-1-gankulkarni@os.amperecomputing.com> <20211122095803.28943-2-gankulkarni@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, d.scott.phillips@amperecomputing.com, qperret@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: d.scott.phillips@amperecomputing.com, kvm@vger.kernel.org, catalin.marinas@arm.com, darren@os.amperecomputing.com, andre.przywara@arm.com, will@kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu [+ 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 -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 C03DAC433EF for ; Thu, 25 Nov 2021 13:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355544AbhKYNzO (ORCPT ); Thu, 25 Nov 2021 08:55:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:60586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355330AbhKYNxN (ORCPT ); Thu, 25 Nov 2021 08:53:13 -0500 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 4CAFE60EB5; Thu, 25 Nov 2021 13:50: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 1mqF8R-007oqV-So; Thu, 25 Nov 2021 13:50:00 +0000 Date: Thu, 25 Nov 2021 13:49:59 +0000 Message-ID: <87bl28cpko.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, d.scott.phillips@amperecomputing.com, Quentin Perret Subject: Re: [PATCH 1/2] KVM: arm64: Use appropriate mmu pointer in stage2 page table init. In-Reply-To: <20211122095803.28943-2-gankulkarni@os.amperecomputing.com> References: <20211122095803.28943-1-gankulkarni@os.amperecomputing.com> <20211122095803.28943-2-gankulkarni@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") 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, 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, d.scott.phillips@amperecomputing.com, qperret@google.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 [+ 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 -- Without deviation from the norm, progress is not possible. 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 0D983C433EF for ; Thu, 25 Nov 2021 13:52:40 +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=kuKNj62GoIts/hzvWuTUE7fayP14DNGU5rUziv/RwH4=; b=qeCiMOcHDHgAAW r4hFxWIvAfCCttkq+y3XnIjSLh2042ptDq46vXMs/wAHMNpUbcgp4z4RIzMgTnsH2OKG2QHmlnhvn zQqdWWVXrO2kVQH2WHPcouli0D7QlMmNcSZ80aKej97VzmFK9V1EWGm88eyuRvWtJ/KNhYhqK4Jq2 1n+8r4zQjMfbxujhPnibo0QyTKV/1TjsaUGfCXIYSCwicetq29yLd7g4ajET3oFTRW/YD/iWxXvVW NvJtDxpE2uNyAj0nv51F1b50496odKNxhuStRwhBUajO0h3SQ8jcVfrqfvPrALzjqEnpoxGP2EL7/ yBN9rUkXV2FT3bBqUrCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqF8Y-007ikH-AO; Thu, 25 Nov 2021 13:50:06 +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 1mqF8U-007ij9-IX for linux-arm-kernel@lists.infradead.org; Thu, 25 Nov 2021 13:50: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 4CAFE60EB5; Thu, 25 Nov 2021 13:50: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 1mqF8R-007oqV-So; Thu, 25 Nov 2021 13:50:00 +0000 Date: Thu, 25 Nov 2021 13:49:59 +0000 Message-ID: <87bl28cpko.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, d.scott.phillips@amperecomputing.com, Quentin Perret Subject: Re: [PATCH 1/2] KVM: arm64: Use appropriate mmu pointer in stage2 page table init. In-Reply-To: <20211122095803.28943-2-gankulkarni@os.amperecomputing.com> References: <20211122095803.28943-1-gankulkarni@os.amperecomputing.com> <20211122095803.28943-2-gankulkarni@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, d.scott.phillips@amperecomputing.com, qperret@google.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-20211125_055002_664653_A45E211F X-CRM114-Status: GOOD ( 19.92 ) 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 [+ 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 -- 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