qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/arm: Use signed quantity to represent VMSAv8-64 trans


From: Peter Maydell
Subject: Re: [PATCH] target/arm: Use signed quantity to represent VMSAv8-64 translation level
Date: Tue, 22 Nov 2022 13:20:48 +0000

On Mon, 21 Nov 2022 at 19:02, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Mon, 21 Nov 2022 at 19:51, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Mon, 21 Nov 2022 at 17:43, Ard Biesheuvel <ardb@kernel.org> wrote:
> > >
> > > The LPA2 extension implements 52-bit virtual addressing for 4k and 16k
> > > translation granules, and for the former, this means an additional level
> > > of translation is needed. This means we start counting at -1 instead of
> > > 0 when doing a walk, and so 'level' is now a signed quantity, and should
> > > be typed as such. So turn it from uint32_t into int32_t.
> > >
> >
> > Does this cause any visible wrong behaviour, or is it just
> > a cleanup thing ?
> >
>
> No, 5 level paging is completely broken because of this, given that
> the 'level < 3' tests give the wrong result for (uint32_t)-1

Right, thanks. This seems like a bug worth fixing for 7.2.

We should make 'uint32_t startlevel' also an int32_t
for consistency, I think, given that it is also sometimes
negative, though in that case it doesn't get used in any
comparisons so it's not going to cause wrong behaviour.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]