On Sat, Nov 12, 2022 at 08:17:04AM +0000, Ricardo Koller wrote: > The page table walker does not visit block PTEs in post-order. But there > are some cases where doing so would be beneficial, for example: breaking a > 1G block PTE into a full tree in post-order avoids visiting the new tree. > > Allow post order visits of block PTEs. This will be used in a subsequent > commit for eagerly breaking huge pages. > > Signed-off-by: Ricardo Koller <ricarkol@xxxxxxxxxx> > --- > arch/arm64/include/asm/kvm_pgtable.h | 4 ++-- > arch/arm64/kvm/hyp/nvhe/setup.c | 2 +- > arch/arm64/kvm/hyp/pgtable.c | 25 ++++++++++++------------- > 3 files changed, 15 insertions(+), 16 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index e2edeed462e8..d2e4a5032146 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -255,7 +255,7 @@ struct kvm_pgtable { > * entries. > * @KVM_PGTABLE_WALK_TABLE_PRE: Visit table entries before their > * children. > - * @KVM_PGTABLE_WALK_TABLE_POST: Visit table entries after their > + * @KVM_PGTABLE_WALK_POST: Visit leaf or table entries after their > * children. It is not immediately obvious from this change alone that promoting the post-order traversal of every walker to cover leaf + table PTEs is safe. Have you considered using a flag for just leaf post-order visits? -- Thanks, Oliver