On Mon, 7 Sept 2026 at 22:24, Itaru Kitayama <[email protected]> wrote: > > Hi Fuad, > On Fri, Sep 04, 2026 at 09:45:30AM +0100, Fuad Tabba wrote: > > Hi Itaru, > > > > On Tue, 25 Aug 2026 at 22:18, Itaru Kitayama <[email protected]> > > wrote: > > ... > > > diff --git a/tools/testing/selftests/kvm/lib/arm64/processor.c > > > b/tools/testing/selftests/kvm/lib/arm64/processor.c > > > index 9108e14a9b5b..bcdf670c9eb8 100644 > > > --- a/tools/testing/selftests/kvm/lib/arm64/processor.c > > > +++ b/tools/testing/selftests/kvm/lib/arm64/processor.c > > > @@ -46,7 +46,7 @@ static u64 pud_index(struct kvm_vm *vm, gva_t gva) > > > u64 mask = (1UL << (vm->page_shift - 3)) - 1; > > > > > > TEST_ASSERT(vm->mmu.pgtable_levels >= 4, > > > - "Mode %d does not have at least 4 page table levels", > > > + "Mode %d does not have >= 4 page table levels", > > > > Patch 1 added this string one commit earlier. Could it go in with the > > final wording there? > > Surely, will fix in v2. > > > > > ... > > > > > @@ -298,10 +304,14 @@ struct kvm_vm *____vm_create(struct vm_shape shape) > > > > > > /* Setup mode specific traits. */ > > > switch (vm->mode) { > > > + case VM_MODE_P52V52_4K: > > > + vm->mmu.pgtable_levels = 5; > > > + break; > > > > This is now the deepest mode, so page_fault_test.c's sizing is stale: > > > > * VM_MODE_P48V48_4K is the mode with most PT pages; let's use > > * twice that just in case. > > pt_size = 26 * guest_page_size; > > > > The margin still covers it. Could pt_size come from vm->mmu.pgtable_levels? > > I'm not the author of the page_fault_test.c for arm64, but so I'm > guessing here; per the comment in the test, I dont think total number of > levels determines pt_size, rather by the addresses prepared for the > test. > > This stress test does not require high virtual addresses, though should > we update the comment while at it?
You're right, pgtable_levels alone wouldn't capture it: what sizes pt_size is the granule and how much the test maps, not the depth. So just updating the comment is enough: name VM_MODE_P52V52_4K as the deepest mode. At 5 levels it's the deepest any 4K mode uses, so the 2x margin holds and the constant won't need revisiting. Cheers, /fuad > > Thanks, > Itaru. > > > > > Cheers, > > /fuad > > > > > > > case VM_MODE_P52V48_4K: > > > vm->mmu.pgtable_levels = 4; > > > break; > > > case VM_MODE_P52V48_64K: > > > + case VM_MODE_P52V52_64K: > > > vm->mmu.pgtable_levels = 3; > > > break; > > > case VM_MODE_P48V48_4K: > > > @@ -322,6 +332,7 @@ struct kvm_vm *____vm_create(struct vm_shape shape) > > > case VM_MODE_P48V48_16K: > > > case VM_MODE_P40V48_16K: > > > case VM_MODE_P36V48_16K: > > > + case VM_MODE_P52V52_16K: > > > vm->mmu.pgtable_levels = 4; > > > break; > > > case VM_MODE_P47V47_16K: > > > > > > -- > > > 2.43.0 > > > > >

