qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/3] Fix access_with_adjusted_size() on big-endi


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 0/3] Fix access_with_adjusted_size() on big-endian
Date: Tue, 2 Oct 2018 13:35:26 +0100

On 2 October 2018 at 13:34, Philippe Mathieu-Daudé <address@hidden> wrote:
> On Tue, Oct 2, 2018 at 2:19 PM Peter Maydell <address@hidden> wrote:
>> On 27 September 2018 at 01:24, Philippe Mathieu-Daudé <address@hidden> wrote:
>> > Hi,
>> >
>> > This series fix a bug I'v been hunting for a long time.
>> >
>> > With BE regions, if the guest used smaller access than the region
>> > implementation, the shift value is negative, but since access_fn()
>> > uses unsigned type for shift, it result in a huge positive value,
>> > then accessors shift the value which eventually becomes 0.
>> >
>> > The fix is simply to use signed type for the shift, and shift to
>> > the opposite direction for negative values.
>>
>> Series
>> Reviewed-by: Peter Maydell <address@hidden>
>
> Thanks for reviewing this.
>
>> I guess we don't have very many devices that are BE and
>> that allow the guest to access them with a smaller
>> width than their implemented width...
>
> Do you think is it worth using the '(un)likely()' macros?

Probably not; that was just a comment on why we haven't run
into the bug sooner.

thanks
-- PMM



reply via email to

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