[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] tcg: workaround branch instruction overflow in tc
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [RFC] tcg: workaround branch instruction overflow in tcg_out_qemu_ld/st |
Date: |
Fri, 27 Apr 2018 14:28:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 27/04/2018 14:17, Laurent Vivier wrote:
> ppc64 uses a BC instruction to call the tcg_out_qemu_ld/st
> slow path. BC instruction uses a relative address encoded
> on 14 bits.
>
> The slow path functions are added at the end of the generated
> instructions buffer, in the reverse order of the callers.
> So more we have slow path functions more the distance between
> the caller (BC) and the function increases.
>
> This patch changes the behavior to generate the functions in
> the same order of the callers.
>
> Fixes: 15fa08f845 ("tcg: Dynamically allocate TCGOps")
> Signed-off-by: Laurent Vivier <address@hidden>
> ---
>
> Notes:
> This is an RFC for several reasons:
> - it doens't really fix the overflow problem
> only avoids the case
> - it uses a recursive function to revert the slow path
> functions order (and we can have a stack overflow...),
I think the number of slow path functions cannot be greater than
TCG_MAX_INSNS (i.e. 512): is it enough to overflow the stack?
Thanks,
Laurent