diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2020-03-24 17:39:12 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2020-04-07 08:55:10 +1000 |
commit | 79178edd2a0b012c5cd27e0168beb83ef4b617ef (patch) | |
tree | 2196dcc3ed580bf7e8baec82d5ded78871bd85b2 /target/ppc | |
parent | 3b4f50bd7d16322a109a026a87a945dff660f38b (diff) |
vfio/spapr: Fix page size calculation
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 <aik@ozlabs.ru>
Message-Id: <20200324063912.25063-1-aik@ozlabs.ru>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc')
0 files changed, 0 insertions, 0 deletions