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 D81151C27 for ; Mon, 23 Oct 2023 09:42:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MJ7uFMYq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63463C433C9; Mon, 23 Oct 2023 09:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698054128; bh=vJtR0z0k2gxIZGFrNrdcBJKHDQ05vCR9A/5ikboQtLQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MJ7uFMYqoa2JNi9M4P/JqrtTZ01+Qeg4AnZEYOljU1YFRoGEijC+XUi1QX2rznWLU hF7ptP4o13S5fiK8FTgEcTZYZ7ESJHzdJnTx4QO2yr7kyVbKCgLs38bjrRq1zhe0Rq uAux1IMiB8PgR8HxZDzIavelBB8gvXoi690cfJwGmYZilhgRBeItiUpz7pYUOMfv+4 opWldTnQCFe3PlbHqdXfOWYIBPsyPW/kLuqm/YRo/Aw7n9wka9mo0RZum4t1L8lNnj Q+4Dn5IjOL1TU0/J9St12ZEQuIRFh8/+DuFqEn/pNLqJRqOCHssYsL3A/FdMI89QYZ CpqNE+PqV4eJQ== 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 1qurRm-006nBA-1X; Mon, 23 Oct 2023 10:42:06 +0100 Date: Mon, 23 Oct 2023 10:42:04 +0100 Message-ID: <864jih65g3.wl-maz@kernel.org> From: Marc Zyngier To: Ryan Roberts Cc: Catalin Marinas , Will Deacon , Oliver Upton , Suzuki K Poulose , James Morse , Zenghui Yu , Ard Biesheuvel , Anshuman Khandual , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v4 00/12] KVM: arm64: Support FEAT_LPA2 at hyp s1 and vm s2 In-Reply-To: <2a1c314b-1fa4-47ac-a977-fba1ce06d614@arm.com> References: <20231009185008.3803879-1-ryan.roberts@arm.com> <867cnhmun2.wl-maz@kernel.org> <2a1c314b-1fa4-47ac-a977-fba1ce06d614@arm.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/29.1 (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: ryan.roberts@arm.com, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, suzuki.poulose@arm.com, james.morse@arm.com, yuzenghui@huawei.com, ardb@kernel.org, anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 20 Oct 2023 16:22:29 +0100, Ryan Roberts wrote: > > On 20/10/2023 11:54, Marc Zyngier wrote: > > Hi Ryan, > > > > On Mon, 09 Oct 2023 19:49:56 +0100, > > Ryan Roberts wrote: > >> > >> Hi All, > >> > >> This adds support for FEAT_LPA2 to KVM for both hypervisor stage 1 (for the > >> nvhe/protected modes) and the vm stage 2 translation tables (for all modes). > >> FEAT_LPA2 enables 52 bit PAs and VAs for 4KB and 16KB granules (note this is > >> already supported for 64KB granules via the FEAT_LPA and FEAT_LVA extensions). > >> The series does not include support for FEAT_LPA2 in the kernel stage 1. This > >> support is provided separately by Ard Biesheuvel's series at [4]. The two series > >> are mostly independent. > >> > >> This is a small update from v3, rebased onto v6.6-rc5 and incorporating some > >> minor changes based on review comments from Oliver. > >> > >> NOTE: I've included my patch to update the range-based tlbi functions to work > >> with LPA2 in this version, because KVM has started using range-based tlbi > >> invalidation as of v6.6-rc1. I've done this in such a way that KVM-originated > >> calls will use the LPA2 format if LPA2 is in use by KVM, but the > >> kernel-originated calls are hardcoded to never use the LPA2 format. If merging > >> with Ard's series, you will need to update the 2 calls to __flush_tlb_range_op() > >> from __flush_tlb_range() appropriately. > >> > >> > >> Testing > >> ======= > >> > >> Testing has been done exclusively on the FVP and covers my boot matrix tests > >> and kvm selftests. > >> > >> The host/guest config boot matrix gives the same (expected) results as for the > >> v3 submission; of 180 conifgs, 12 fail, and these are all due to attempting to > >> load the host kernel into high memory which isn't expected to work until the > >> kernel has FEAT_LPA2 support for its stage 1. (refer to v1 posting for details > >> on the exact configs). > >> > >> KVM selftests have been enhanced to support P52V48 4K and 16K guest modes, and > >> all tests have been run against a P48V48_4K host and a P52V52_4K host (a run > >> takes about 10 hours on FVP, sigh, but I can test a few more host configs if > >> useful). > > > > Have you tried with the (brand new) "arm64_sw.hvhe=1" command-line > > option, which enables VHE for the EL2 hypervisor only? I expect things > > to work, but it would be good to make sure... > > No, I haven't tried. I did notice it when I rebased but convinced myself that it > doesn't affect the page table stuff. I'm happy to give it a spin once I've > rebased to v6.7-rc1 though. It does affect the page-table format (KVM_PTE_LEAF_ATTR_LO_S1_AP_RO and co), so I'm taking the view that whatever is not tested doesn't work. Thanks for giving it a go! M. -- 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 78E46C001E0 for ; Mon, 23 Oct 2023 09:42:35 +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=N5qA62cwdxgfEM6y96lOOtv95bmRkxO9OIuX8x7CdME=; b=KQrWCzLmYFdd5o m0yIoDhf44s8ub9k0lWeQ6viJYvEcRKVRdTaKNtRcWVrwwwAIq4NMVnxEF+ACjFSokrQFSyuRGgmR fc9x76HCthJrMxFRJIbFxTJPW7u4z/QY6j6QRBPlLZE11b5SAYUV/ZtyXy8bl/hANvlbpg8XPWYin 8oQN6P26SisxZFHfyKk2rocMABfZPVlrcOtbt5RfkQV57MGcO8Xu0Euh91eI8bIFXZJVI1MzwY2Yk 4gDY/oQJBmFGCKJtU00WHb+wm6NwvjktKUyM4SeNYAsgPGIsN/VzfvrkwR+jfhLHjokXgAhWmoECl VhzCDlVurPhzmHu27P1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qurRt-006uHP-1R; Mon, 23 Oct 2023 09:42:13 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qurRq-006uGk-28 for linux-arm-kernel@lists.infradead.org; Mon, 23 Oct 2023 09:42:12 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 107E3B8095D; Mon, 23 Oct 2023 09:42:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63463C433C9; Mon, 23 Oct 2023 09:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698054128; bh=vJtR0z0k2gxIZGFrNrdcBJKHDQ05vCR9A/5ikboQtLQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MJ7uFMYqoa2JNi9M4P/JqrtTZ01+Qeg4AnZEYOljU1YFRoGEijC+XUi1QX2rznWLU hF7ptP4o13S5fiK8FTgEcTZYZ7ESJHzdJnTx4QO2yr7kyVbKCgLs38bjrRq1zhe0Rq uAux1IMiB8PgR8HxZDzIavelBB8gvXoi690cfJwGmYZilhgRBeItiUpz7pYUOMfv+4 opWldTnQCFe3PlbHqdXfOWYIBPsyPW/kLuqm/YRo/Aw7n9wka9mo0RZum4t1L8lNnj Q+4Dn5IjOL1TU0/J9St12ZEQuIRFh8/+DuFqEn/pNLqJRqOCHssYsL3A/FdMI89QYZ CpqNE+PqV4eJQ== 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 1qurRm-006nBA-1X; Mon, 23 Oct 2023 10:42:06 +0100 Date: Mon, 23 Oct 2023 10:42:04 +0100 Message-ID: <864jih65g3.wl-maz@kernel.org> From: Marc Zyngier To: Ryan Roberts Cc: Catalin Marinas , Will Deacon , Oliver Upton , Suzuki K Poulose , James Morse , Zenghui Yu , Ard Biesheuvel , Anshuman Khandual , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v4 00/12] KVM: arm64: Support FEAT_LPA2 at hyp s1 and vm s2 In-Reply-To: <2a1c314b-1fa4-47ac-a977-fba1ce06d614@arm.com> References: <20231009185008.3803879-1-ryan.roberts@arm.com> <867cnhmun2.wl-maz@kernel.org> <2a1c314b-1fa4-47ac-a977-fba1ce06d614@arm.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/29.1 (aarch64-unknown-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: ryan.roberts@arm.com, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, suzuki.poulose@arm.com, james.morse@arm.com, yuzenghui@huawei.com, ardb@kernel.org, anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev 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-20231023_024211_022169_E2F1EA95 X-CRM114-Status: GOOD ( 31.93 ) 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 Fri, 20 Oct 2023 16:22:29 +0100, Ryan Roberts wrote: > > On 20/10/2023 11:54, Marc Zyngier wrote: > > Hi Ryan, > > > > On Mon, 09 Oct 2023 19:49:56 +0100, > > Ryan Roberts wrote: > >> > >> Hi All, > >> > >> This adds support for FEAT_LPA2 to KVM for both hypervisor stage 1 (for the > >> nvhe/protected modes) and the vm stage 2 translation tables (for all modes). > >> FEAT_LPA2 enables 52 bit PAs and VAs for 4KB and 16KB granules (note this is > >> already supported for 64KB granules via the FEAT_LPA and FEAT_LVA extensions). > >> The series does not include support for FEAT_LPA2 in the kernel stage 1. This > >> support is provided separately by Ard Biesheuvel's series at [4]. The two series > >> are mostly independent. > >> > >> This is a small update from v3, rebased onto v6.6-rc5 and incorporating some > >> minor changes based on review comments from Oliver. > >> > >> NOTE: I've included my patch to update the range-based tlbi functions to work > >> with LPA2 in this version, because KVM has started using range-based tlbi > >> invalidation as of v6.6-rc1. I've done this in such a way that KVM-originated > >> calls will use the LPA2 format if LPA2 is in use by KVM, but the > >> kernel-originated calls are hardcoded to never use the LPA2 format. If merging > >> with Ard's series, you will need to update the 2 calls to __flush_tlb_range_op() > >> from __flush_tlb_range() appropriately. > >> > >> > >> Testing > >> ======= > >> > >> Testing has been done exclusively on the FVP and covers my boot matrix tests > >> and kvm selftests. > >> > >> The host/guest config boot matrix gives the same (expected) results as for the > >> v3 submission; of 180 conifgs, 12 fail, and these are all due to attempting to > >> load the host kernel into high memory which isn't expected to work until the > >> kernel has FEAT_LPA2 support for its stage 1. (refer to v1 posting for details > >> on the exact configs). > >> > >> KVM selftests have been enhanced to support P52V48 4K and 16K guest modes, and > >> all tests have been run against a P48V48_4K host and a P52V52_4K host (a run > >> takes about 10 hours on FVP, sigh, but I can test a few more host configs if > >> useful). > > > > Have you tried with the (brand new) "arm64_sw.hvhe=1" command-line > > option, which enables VHE for the EL2 hypervisor only? I expect things > > to work, but it would be good to make sure... > > No, I haven't tried. I did notice it when I rebased but convinced myself that it > doesn't affect the page table stuff. I'm happy to give it a spin once I've > rebased to v6.7-rc1 though. It does affect the page-table format (KVM_PTE_LEAF_ATTR_LO_S1_AP_RO and co), so I'm taking the view that whatever is not tested doesn't work. Thanks for giving it a go! 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