Thread (18 messages) 18 messages, 5 authors, 2021-07-23

Re: [PATCH 1/5] KVM: arm64: Walk userspace page tables to compute the THP mapping size

From: Marc Zyngier <maz@kernel.org>
Date: 2021-07-19 09:32:02
Also in: kvm, kvmarm, linux-mm

On Mon, 19 Jul 2021 07:31:30 +0100,
Paolo Bonzini [off-list ref] wrote:
On 17/07/21 11:55, Marc Zyngier wrote:
quoted
We currently rely on the kvm_is_transparent_hugepage() helper to
discover whether a given page has the potential to be mapped as
a block mapping.

However, this API doesn't really give un everything we want:
- we don't get the size: this is not crucial today as we only
   support PMD-sized THPs, but we'd like to have larger sizes
   in the future
- we're the only user left of the API, and there is a will
   to remove it altogether

To address the above, implement a simple walker using the existing
page table infrastructure, and plumb it into transparent_hugepage_adjust().
No new page sizes are supported in the process.

Signed-off-by: Marc Zyngier <maz@kernel.org>
If it's okay for you to reuse the KVM page walker that's fine of
course, but the arch/x86/mm functions lookup_address_in_{mm,pgd} are
mostly machine-independent and it may make sense to move them to mm/.

That would also allow reusing the x86 function host_pfn_mapping_level.
That could work to some extent, but the way the x86 code equates level
to mapping size is a bit at odds with the multiple page sizes that
arm64 deals with.

We're also trying to move away from the whole P*D abstraction, because
this isn't something we want to deal with in the self-contained EL2
object.

Thanks,

	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help