From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) (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 75C2D8BEC for ; Tue, 24 Jan 2023 17:11:27 +0000 (UTC) Date: Tue, 24 Jan 2023 17:11:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1674580285; 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=TyJQjATPh0tKJCEQcnqCvNrxjQJk0MT7om7mPRXWyqo=; b=K6k1kVS1Du6EUufjWRtLZ6pyq5z7L5toFFB0wjYBKLsHWX/X2G1T8qoTnjx+3zY86JYpXJ t+B/69mWrcXtYfGJDFh1VEo8gjU/xD6IbastSk0602xBrvKfJMuTNMZIhDKU2GktgEjuMl AZE0kp/oaUgMm9lUZ3cmHlXn25YIwuw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ricardo Koller Cc: Ben Gardon , pbonzini@redhat.com, maz@kernel.org, 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, gshan@redhat.com, reijiw@google.com, rananta@google.com, ricarkol@gmail.com Subject: Re: [PATCH 3/9] KVM: arm64: Add kvm_pgtable_stage2_split() Message-ID: References: <20230113035000.480021-1-ricarkol@google.com> <20230113035000.480021-4-ricarkol@google.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 Tue, Jan 24, 2023 at 08:46:58AM -0800, Ricardo Koller wrote: > On Mon, Jan 23, 2023 at 05:03:23PM -0800, Ben Gardon wrote: [...] > > Would it be accurate to say: > > /* No huge pages can exist at the root level, so there's nothing to > > split here. */ > > > > I think of "last level" as the lowest/leaf/4k level but > > KVM_PGTABLE_MAX_LEVELS - 1 is 3? > > Right, this is the 4k level. > > > Does ARM do the level numbering in > > reverse order to x86? > > Yes, it does. Interesting, x86 does > > iter->level--; > > while arm does: > > ret = __kvm_pgtable_walk(data, mm_ops, childp, level + 1); > > I don't think this numbering scheme is encoded anywhere in the PTEs, so > either architecture could use the other. The numbering we use in the page table walkers is deliberate, as it directly matches the Arm ARM. While we can certainly use either scheme I'd prefer we keep aligned with the architecture. -- Thanks, Oliver