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 90D6CC433EF for ; Wed, 20 Jul 2022 18:27:44 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kljsn7DfGmCGWRkuEs0KphwMoZZjDzbd6GOC2FFl3JU=; b=PINW35AL6fArvd KBS29mSmdDvLWhO3NPNdg6ZCq0f3socgSLkWIgHTr9pjRk2cCYeHIRK7db9Z8yhi59UDo04dRxGsc lKNe0+atLLtRpPyQFnJ272rNgWbwRRq40o9FMqyLvoWLCnQSnHfn6MPgNXH8B0jAt9gLIfjBVh8/5 EG4MmjICY6giQhnDJluaYCFFpjtRv/B8m03/lx9RBhcPk026N1PyQLXZrx7eVURWhNR/qa1Ndk4wH IanP2phsIxVc7yLZRuGSTrpc8fmUGbBD43jjhFcDXgC09cEplwdBM8U+sSxkbLxMK8nfudWO7AB1R MjCP03qhC91ujs5BAMSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEEP7-009E4p-Pk; Wed, 20 Jul 2022 18:26:38 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEEP2-009E28-By for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 18:26:33 +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 ams.source.kernel.org (Postfix) with ESMTPS id AADCCB821B3; Wed, 20 Jul 2022 18:26:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95BF8C3411E; Wed, 20 Jul 2022 18:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658341589; bh=1yszCxwggYM4jJ5bah2lLB5C4oXcdYdLEA0qjz82pAc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oR4ERFNR2+UVNBGGeoTFnTaaCoPW3ezYofdRY1WsECL0Og0X17PdO1j0IAic6PNq5 lJXxMQwcuoogN6wkbeKDDAQuLpOsE+SZ4tFcT3te+BcQgJhc6wHJTogCdJZo9nKUJk FW9C8rCPvo7x8jejTULVSWM1gaVZn0q26kV8aU4T7Z66BeV8CSNP6cUtus08KsLEgu MlPCJ3a0VNYYRuJ047pHFQ8xUWMY01bSxut7tt6Pzi0uCX+M5v6GeYfmW+U6rVC2NV lsb8AY9f93HbEauX8FpWAvrwXY9hkNj3Kbyuu0ip4sdoTQFLFlNCSf6ovWVFx0Fvce aiqLRl8JfZIcQ== Date: Wed, 20 Jul 2022 19:26:22 +0100 From: Will Deacon To: Vincent Donnefort Cc: kvmarm@lists.cs.columbia.edu, Ard Biesheuvel , Sean Christopherson , Alexandru Elisei , Andy Lutomirski , Catalin Marinas , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Fuad Tabba , Oliver Upton , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 18/24] KVM: arm64: Instantiate guest stage-2 page-tables at EL2 Message-ID: <20220720182621.GC16603@willie-the-truck> References: <20220630135747.26983-1-will@kernel.org> <20220630135747.26983-19-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_112632_591606_36D7BAD8 X-CRM114-Status: GOOD ( 11.48 ) 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 Tue, Jul 19, 2022 at 02:32:18PM +0100, Vincent Donnefort wrote: > [...] > > > } > > > > void reclaim_guest_pages(struct kvm_shadow_vm *vm) > > { > > - unsigned long nr_pages; > > + unsigned long nr_pages, pfn; > > > > nr_pages = kvm_pgtable_stage2_pgd_size(vm->kvm.arch.vtcr) >> PAGE_SHIFT; > > - WARN_ON(__pkvm_hyp_donate_host(hyp_virt_to_pfn(vm->pgt.pgd), nr_pages)); > > + pfn = hyp_virt_to_pfn(vm->pgt.pgd); > > + > > + guest_lock_component(vm); > > + kvm_pgtable_stage2_destroy(&vm->pgt); > > + vm->kvm.arch.mmu.pgd_phys = 0ULL; > > + guest_unlock_component(vm); > > + > > + WARN_ON(__pkvm_hyp_donate_host(pfn, nr_pages)); > > } > > The pfn introduction being removed in a subsequent patch, this is probably > unecessary noise. Quite right, that should be left as-is. Will fix. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel