Re: [PATCH] KVM: arm64: Fix the upper limit of the walker range
From: Sebastian Ene
Date: Thu Jan 16 2025 - 09:53:29 EST
On Thu, Jan 16, 2025 at 01:49:54PM +0000, Suzuki K Poulose wrote:
Hi,
> On 16/01/2025 10:55, Marc Zyngier wrote:
> > On Thu, 16 Jan 2025 01:16:40 +0000,
> > Mark Brown <broonie@xxxxxxxxxx> wrote:
> > >
> > > On Tue, Jan 14, 2025 at 02:50:51PM +0000, Sebastian Ene wrote:
> > >
> > > > Prevent the walker from running into weeds when walking an
> > > > entire address range.
> > >
> > > The KVM page_fault_test selftest started failing in next-20250115 on
> > > at least n1sdp and TX2 in VHE mode and a bisect seems to point to this
> > > change. The bisect only just finished, I've done no further
> > > investigation.
> > >
> > > When the test fails it generates backtraces like that below:
> >
> > [...]
> >
> > Thanks for the heads up.
> >
> > Given how close we are to the merge window opening, I've dropped this
> > patch from -next.
> >
> > Seb: it looks this breaks a bunch of existing assumptions. Let's
> > revisit this before -rc1, if possible.
> In kvm_pgtable_walk() we set the walk_data.end to PAGE_ALIGNED(start +
> size), where size is BIT(ia_size) and start = 0, for
> kvm_pgtable_stage2_destroy().
>
> And subtracting the limit in _kvm_pgtable_walk makes things go bad,
> returning -ERANGE.
> Given the kvm_pgtable_walk() passes the "end" as the top address (not
> including it), and is always PAGE_ALIGNED, we should probably leave things
> as it is in the code.
>
Thanks for looking into this.
I have a fix but it is too much of a surgery so we decided not to send
it and instead go with the removal of my change.
>
> Cheers
> Suzuki
>
>
> >
> > Thanks,
> >
> > M.
> >
>
Thanks,
Sebastian