From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BAE21DFE00; Tue, 17 Dec 2024 14:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734444378; cv=none; b=JHQgtwvtIe2EKh3mI2imCCz+NfCWoCedi/73BE2isafulM7Fg0R2smRmyNWkrMUwOdvfC69wgK8QuAyNjP9EYJ7bxUWrJgTxfa7mAN0S4eLx5WHYbtvNsbeWmIRVmADk9NcYvgw96pKBCaqDErTkn2wEukKi41obI8vNrgMpNos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734444378; c=relaxed/simple; bh=sRYFkVqoQ7WVWtIBYz2OuAjeAt/6gkjTXYc/NTa8jnk=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=QVB5I4TqdNiO81HwPO3XS+6DysoESbgIx4y+TfIYuCebbZOtvxbuzGASQZr+X8aBy9nGnqWPSd1rfwhLrFcj4APGDGtmobqcqBfNZzucBwW4c7QNjel3sONwI0GKLmzc0Ad+Lti25PKu0KSnIu9aU8HSicOAleQ7D8Jq140aMB0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=prbcWabO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="prbcWabO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0A3EC4CED4; Tue, 17 Dec 2024 14:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734444377; bh=sRYFkVqoQ7WVWtIBYz2OuAjeAt/6gkjTXYc/NTa8jnk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=prbcWabOTuBkNbtMYI66UPlJNIkVKDob7yE4wXS+0mv640w8Mflnrm0MVNz/CrCwx jzbSn1g5TZ47pfAUdJaSvC4JWoIteeZ1FX2PrDaCMweujLl8tfWqfK/zRO3YPAQMYa /pvZtZqEl7zp/NFAX8jI6vZBLxHeHQ/dS6GAf7ngKQZBQU4EnLaii64OmE10VEPNMG Mx1QSxTLouq1iXjiY1rzzc7voVwNAQ2hHz+uqDvwxv+4aqUiOoESgIjb0JD6mTmtVr E2TgM1hBP4fpvHk9lzYmxj2ANZq52Uc46/La0B/oULauaBxSj8hARLaGKvmVWV1Smb 5iAxg8B00VrRQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tNYDH-004ZwV-Rt; Tue, 17 Dec 2024 14:06:15 +0000 Date: Tue, 17 Dec 2024 14:06:15 +0000 Message-ID: <86seqmqu94.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Fuad Tabba , Vincent Donnefort , Sebastian Ene , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 11/18] KVM: arm64: Introduce __pkvm_host_unshare_guest() In-Reply-To: References: <20241216175803.2716565-1-qperret@google.com> <20241216175803.2716565-12-qperret@google.com> <86wmfyr1j4.wl-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/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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: qperret@google.com, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, tabba@google.com, vdonnefort@google.com, sebastianene@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 17 Dec 2024 13:33:57 +0000, Quentin Perret wrote: > > On Tuesday 17 Dec 2024 at 11:29:03 (+0000), Marc Zyngier wrote: > > > +static int __check_host_shared_guest(struct pkvm_hyp_vm *vm, u64 *__phys, u64 ipa) > > > +{ > > > + enum pkvm_page_state state; > > > + struct hyp_page *page; > > > + kvm_pte_t pte; > > > + u64 phys; > > > + s8 level; > > > + int ret; > > > + > > > + ret = kvm_pgtable_get_leaf(&vm->pgt, ipa, &pte, &level); > > > + if (ret) > > > + return ret; > > > + if (level != KVM_PGTABLE_LAST_LEVEL) > > > > So there is still a very strong assumption that a guest is only > > provided page mappings, and no blocks? > > Yep, very much so. It's one of the main limitations of the series as-is > (with the absence of support for mapping anything else than memory in > guests). Those limitations were mentioned in the cover letter of v1, but > I should have kept that mention in later versions, sorry! > > The last patch of the series has a tweak to user_mem_abort() to force > mappings to PTE level which is trivial to do as we already need to do > similar things for dirty logging. And __pkvm_host_share_guest() doesn't > take a 'size' parameter in its current form, it assumes it is being > passed a single pfn. So all in all this works well, and simplifies the > series a lot. > > Huge-page support should come as a natural extension to this series, but > I was hoping it could be done separately as that should have no > *functional* impact observable from userspace. I'm slightly more > concerned about the lack of support for mapping MMIO, but that too is > going to be some work, and I guess you should just turn pKVM off if > you want that for now... > > Happy to address either or both of these limitations as part of this > series if we think they're strictly required to land this stuff > upstream, this is obviously up for debate. But that's going to be quite > a few patches on top :-) No, I just wanted to make sure I did have the correct interpretation of what this does. 'd rather have something that works first, and then add large mapping support. You can even sell it as a performance improvement! :) Thanks, M. -- Without deviation from the norm, progress is not possible.