qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH for-5.0?] target/xtensa: Statically allocate xtensa_insnbufs


From: Richard Henderson
Subject: Re: [PATCH for-5.0?] target/xtensa: Statically allocate xtensa_insnbufs
Date: Mon, 6 Apr 2020 21:59:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 4/6/20 9:04 PM, Max Filippov wrote:
> On Mon, Apr 6, 2020 at 8:09 PM Richard Henderson
> <address@hidden> wrote:
>>
>> Rather than dynamically allocate, and risk failing to free
>> when we longjmp out of the translator, allocate the maximum
>> buffer size from any of the supported cpus, which is 8:
> 
> There's macro MAX_INSN_LENGTH that defines maximal supported
> instruction length in bytes. Maybe the following instead, along the lines
> of what libisa does dynamically?:

Thanks for the pointer.  Looks better than mine.

>  #define MAX_INSN_LENGTH 64
> +#define MAX_INSNBUF_LENGTH \
> +    ((MAX_INSN_LENGTH + sizeof(xtensa_insnbuf_word) - 1) / \
> +     sizeof(xtensa_insnbuf_word))

There is a ROUND_UP macro, but it seems unnecessary.


r~



reply via email to

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