qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Re-evaluate SVE vector length everytime ADDVL i


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] Re-evaluate SVE vector length everytime ADDVL is executed
Date: Wed, 13 Mar 2019 09:34:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 3/13/19 7:41 AM, Amir Charif wrote:
> In system emulation mode, the kernel may internally use 16-byte vectors.
> If this size is saved in the DisasContext before entering a userspace app
> that uses higher SVE sizes, the wrong size may be allocated on the stack
> resulting in corruption (segfaults in user space).
> This fix evaluates the vector size at runtime (as opposed to translation time)
> to always allocate the correct size on the stack (when ADDVL is used).

This is wrong.

In particular, if the computation of VL is wrong for ADDVL, it is wrong for
every other SVE instruction as well.  Most of which cannot have VL computed
at runtime like this.

That is why we break the TB at every change to VL.

Where do we "enter a userspace app" without breaking the TB and recomputing?
As far as I know this must have executed an ERET to return from EL1 to EL0,
which most definitely happens between TBs, or else no system calls would work
at all.

Do you have an example that provokes this failure?


r~



reply via email to

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