[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH qemu] vfio/spapr: Fix page size calculation
From: |
Peter Maydell |
Subject: |
Re: [PATCH qemu] vfio/spapr: Fix page size calculation |
Date: |
Thu, 26 Mar 2020 11:21:47 +0000 |
On Thu, 26 Mar 2020 at 00:39, David Gibson <address@hidden> wrote:
>
> On Tue, Mar 24, 2020 at 05:39:12PM +1100, Alexey Kardashevskiy wrote:
> > Coverity detected an issue (CID 1421903) with potential call of clz64(0)
> > which returns 64 which make it do "<<" with a negative number.
> >
> > This checks the mask and avoids undefined behaviour.
> >
> > In practice pgsizes and memory_region_iommu_get_min_page_size() always
> > have some common page sizes and even if they did not, the resulting page
> > size would be 0x8000.0000.0000.0000 (gcc 9.2) and
> > ioctl(VFIO_IOMMU_SPAPR_TCE_CREATE) would fail anyway.
> >
> > Signed-off-by: Alexey Kardashevskiy <address@hidden>
>
> Applied to ppc-for-5.1.
As a coverity-issue-fix it would be nice to have this in
5.0 unless you think it's particularly risky.
thanks
-- PMM