Re: [PATCH v7 03/12] KVM: arm64: Add helper for creating unlinked stage2 subtrees

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/23/23 4:37 AM, Ricardo Koller wrote:
On Sat, Apr 22, 2023 at 08:32:02PM +0000, Oliver Upton wrote:
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.
	 */


OK, this is the winner. Will go with this one in v8. Gavin, let me know
if you are not OK with this.


Looks good to me either.

Thanks,
Gavin




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux