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 F168AC4332F for ; Thu, 3 Nov 2022 13:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiKCNIP (ORCPT ); Thu, 3 Nov 2022 09:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231316AbiKCNHx (ORCPT ); Thu, 3 Nov 2022 09:07:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D850611C27 for ; Thu, 3 Nov 2022 06:07:49 -0700 (PDT) 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 8AC65B82784 for ; Thu, 3 Nov 2022 13:07:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2138CC433C1; Thu, 3 Nov 2022 13:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667480867; bh=paPkw39dqHtmErAsf9C/CLDJENUkAuTQbIXYzYC094Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HIYf+nQdrasSK/NVQgGx2iqIUt/stTwTv4lk1CfomCCZn/QTuub9yvHJ2Wz0QUSN5 5N1JyUVMduehZOkIHHl7QNQ4DdLmYCACpfOfhQgxmANP7630fce2ubXIPGddWBv83b qsQp05lAMG3mQjRJram82blP7wQsyfYOwfKiVpvCy4TN/qi4ZJT8VrSGxtgjIBiY7E X5RigzF7elfmQ39vl0Dvr9Gpe/MDiRw81wLKqAFAHR0+k+Xxe9XQ50a7fRCYC+6Hvy 8UMz4wscne+dbcAvK6NQstNmOYmR/seOHShcztXdN4FunsY2Zep9xIwonFje/L8WN6 8mS8LIAkWcJUw== 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 1oqZwe-003VMC-Gl; Thu, 03 Nov 2022 13:07:44 +0000 Date: Thu, 03 Nov 2022 13:07:38 +0000 Message-ID: <86h6zgqj8l.wl-maz@kernel.org> From: Marc Zyngier To: Wei-Lin Chang Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: Update comment of create_hyp_mappings In-Reply-To: <20221103053228.961591-1-r09922117@csie.ntu.edu.tw> References: <20221103053228.961591-1-r09922117@csie.ntu.edu.tw> 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 (aarch64-unknown-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: r09922117@csie.ntu.edu.tw, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 03 Nov 2022 05:32:28 +0000, Wei-Lin Chang wrote: > > HYP_PAGE_OFFSET is removed since 4.8, and the method for generating Hyp > VAs has evolved. Update the functional description of > create_hyp_mappings accordingly. > > Signed-off-by: Wei-Lin Chang > --- > arch/arm64/kvm/mmu.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index c9a13e487..a9ae4a3f9 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -424,9 +424,10 @@ void kvm_unshare_hyp(void *from, void *to) > * @to: The virtual kernel end address of the range (exclusive) > * @prot: The protection to be applied to this range > * > - * The same virtual address as the kernel virtual address is also used > - * in Hyp-mode mapping (modulo HYP_PAGE_OFFSET) to the same underlying > - * physical pages. > + * The Hyp virtual address is generated by masking the kernel VA with > + * va_mask then inserting tag_val for the higher bits starting from > + * tag_lsb. See kvm_compute_layout() in va_layout.c for more info. > + * Both Hyp VA and kernel VA ranges map to the same underlying physical pages. > */ > int create_hyp_mappings(void *from, void *to, enum kvm_pgtable_prot prot) > { What's the difference with the previous instance of this patch? M. -- Without deviation from the norm, progress is not possible.