qemu-e2k/hw/vfio
Alexey Kardashevskiy 79178edd2a 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>
2020-04-07 08:55:10 +10:00
..
Kconfig hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
Makefile.objs hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
amd-xgbe.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
ap.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
calxeda-xgmac.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
ccw.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
common.c Report stringified errno in VFIO related errors 2020-02-18 20:20:49 +01:00
display.c hw/vfio/display: Remove superfluous semicolon 2020-02-18 20:20:49 +01:00
igd.c hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
pci-quirks.c hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
pci.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pci.h hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
platform.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
spapr.c vfio/spapr: Fix page size calculation 2020-04-07 08:55:10 +10:00
trace-events spapr: Support NVIDIA V100 GPU with NVLink2 2019-04-26 10:41:23 +10:00