[PATCH] winebuild: Clear RFLAGS before entering syscall.

Jacek Caban jacek at codeweavers.com
Wed Jun 2 10:35:31 CDT 2021


Hi Rémi,

On 6/1/21 10:43 AM, Rémi Bernon wrote:
> We pushed the flags, but kept them set. Far Cry sets NT flags, which
> causes later iretd instruction to raise a GP fault exception.
>
> This fixes a regression from e341d1f695311725752c287057f6c6ab60fdf2a3.


iret is responsible for a fair chunk of syscall dispatcher overhead. I 
plan to submit patches optimizing syscall dispatcher to not do iret in 
the usual code path and use signal_restore_full_cpu_context if context 
was modified during the syscall. I don't have 32-bit version implemented 
yet, but the idea would be the same. I think those optimization should 
fix the regression without adjusting flags on each syscall. 
signal_restore_full_cpu_context would still have the same problem, but 
maybe then we could do flags adjustment only there? Or are there other 
reasons to do the adjustment (in which case I would need to take that 
into account in my patches as well)?


Thanks,

Jacek




More information about the wine-devel mailing list