On 02/23/2018 01:59 AM, Peter Maydell wrote:
> On 22 February 2018 at 20:14, Richard Henderson
> <richard.hender...@linaro.org> wrote:
>> On 02/22/2018 08:41 AM, Peter Maydell wrote:
>>> On 16 February 2018 at 21:56, Richard Henderson
>>> <richard.hender...@linaro.org> wrote:
> 
>>>> +        if (sve_size <= std_size) {
>>>> +            sve_ofs = size;
>>>> +            size += sve_size;
>>>> +            end1_ofs = size;
>>>> +        } else {
>>>> +            /* Otherwise we need to allocate extra space.  */
>>>> +            extra_ofs = size;
>>>> +            size += sizeof(struct target_extra_context);
>>>> +            end1_ofs = size;
>>>> +            size += QEMU_ALIGN_UP(sizeof(struct target_aarch64_ctx), 16);
>>>
>>> Why do we add the size of target_aarch64_ctx to size here?
>>> We already account for the size of the end record later, so
>>> what is this one?
>>
>> This is for the end record within the extra space, as opposed to the end 
>> record
>> within the standard space which is what we accounted for before.  A comment
>> would help, I supposed.
> 
> Oh, so 'size' is accounting for both the standard space used
> and the extra space? I had thought that 'size' was just counting
> up the standard space used, and the extra space count was in
> extra_size.

Yes.  The revised code uses a different name, total_size, that hopefully makes
this more clear.


r~


Reply via email to