From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-14.mta1.migadu.com (out-14.mta1.migadu.com [95.215.58.14]) (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 857912106 for ; Sat, 22 Apr 2023 20:32:10 +0000 (UTC) Date: Sat, 22 Apr 2023 20:32:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1682195528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CZJOD9xaW8frMjk5AuArVyQlU/FYeEtl40G/DCpjWD0=; b=rnuYe9Uc+sKPcZjfmwOJ7nChAiphNRpJ3OhpsVRo4wbr19ZdtSZuTqsG2wFoIfscNQqllC 4dn2TZxGcuvqcoG7850RVwEInd69jby6WhbZytlrSgl6R3vi6csjetufFTdrrJgbqlJmqQ ctiIDaaJ2cMU7CjwH394aNPBNev42Vo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ricardo Koller Cc: Gavin Shan , pbonzini@redhat.com, maz@kernel.org, oupton@google.com, yuzenghui@huawei.com, dmatlack@google.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, qperret@google.com, catalin.marinas@arm.com, andrew.jones@linux.dev, seanjc@google.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, eric.auger@redhat.com, reijiw@google.com, rananta@google.com, bgardon@google.com, ricarkol@gmail.com, Shaoqin Huang Subject: Re: [PATCH v7 03/12] KVM: arm64: Add helper for creating unlinked stage2 subtrees Message-ID: References: <20230409063000.3559991-1-ricarkol@google.com> <20230409063000.3559991-5-ricarkol@google.com> <9cb621b0-7174-a7c7-1524-801b06f94e8f@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Sat, Apr 22, 2023 at 01:09:26PM -0700, Ricardo Koller wrote: > On Mon, Apr 17, 2023 at 02:18:26PM +0800, Gavin Shan wrote: > > > + /* .addr (the IPA) is irrelevant for an unlinked table */ > > > + struct kvm_pgtable_walk_data data = { > > > + .walker = &walker, > > > + .addr = 0, > > > + .end = kvm_granule_size(level), > > > + }; > > > > The comment about '.addr' seems incorrect. The IPA address is still > > used to locate the page table entry, so I think it would be something > > like below: > > > > /* The IPA address (.addr) is relative to zero */ > > > > Extended it to say this: > > * The IPA address (.addr) is relative to zero. The goal is to > * map "kvm_granule_size(level) - 0" worth of pages. I actually prefer the original wording, as Gavin's suggestion makes this comment read as though the IPA of the walk bears some degree of validity, which it does not. The intent of the code is to create some *ambiguous* input address range, so maybe: /* * The input address (.addr) is irrelevant for walking an * unlinked table. Construct an ambiguous IA range to map * kvm_granule_size(level) worth of memory. */ -- Thanks, Oliver