[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: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 0/3] Fix access_with_adjusted_size() on big-endian |
Date: |
Tue, 2 Oct 2018 14:34:40 +0200 |
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?