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~
