[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH v2] exec: Fix non-power-of-2 sized accesses
From: |
Alex Williamson |
Subject: |
Re: [Qemu-stable] [PATCH v2] exec: Fix non-power-of-2 sized accesses |
Date: |
Fri, 16 Aug 2013 09:46:42 -0600 |
On Fri, 2013-08-16 at 09:43 -0600, Alex Williamson wrote:
> On Fri, 2013-08-16 at 09:37 -0600, Alex Williamson wrote:
> > On Fri, 2013-08-16 at 08:27 -0700, Richard Henderson wrote:
> > > On 08/16/2013 05:50 AM, Alex Williamson wrote:
> > > > + /* Size must be a power of 2 */
> > > > + if (l & (l - 1)) {
> > > > + while (l & (access_size_max - 1)) {
> > > > + access_size_max >>= 1;
> > > > + }
> > > > + }
> > > > +
> > >
> > > Why the loop at all? x & -x extracts the lsb of x.
> >
> > l = 5, we want 4, not 1. Thanks,
>
> Which is not what my patch does either :-\
Simple change though
while (!(l & access_size_max))...