qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v2] tcg: workaround branch instruction overflow in


From: Richard Henderson
Subject: Re: [Qemu-devel] [RFC v2] tcg: workaround branch instruction overflow in tcg_out_qemu_ld/st
Date: Sun, 29 Apr 2018 09:39:21 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 04/28/2018 03:29 AM, 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:
>     v2:
>       - add a pointer to the tail of the list to add new element
>         at the end and keep the original ordering
>       - remove the recursive call

A much better approach.

Elsewhere in TCG I have used the QTAILQ macros for manipulating a double-linked
list.  Perhaps using QSIMPLEQ for the single-linked list with tail access would
be the thing here?  I'm not 100% sure it's cleaner, but maybe worth a look.


r~



reply via email to

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