]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/acpi: fix gint overflow in crs_range_compare
authorEvgeny Yakovlev <wrfsh@yandex-team.ru>
Thu, 18 Jul 2019 16:14:23 +0000 (19:14 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 25 Jul 2019 08:17:35 +0000 (04:17 -0400)
commit21e2acd583126db94f6d881005cd58e835160582
tree53f19e1d19d5bfdb9646d940e8918df8cc7890d9
parentdf98d7ccc2e9e3e5080cce30a6d9c09dd827dc15
i386/acpi: fix gint overflow in crs_range_compare

When very large regions (32GB sized in our case, PCI pass-through of GPUs)
are compared substraction result does not fit into gint.

As a result crs_replace_with_free_ranges does not get sorted ranges and
incorrectly computes PCI64 free space regions. Which then makes linux
guest complain about device and PCI64 hole intersection and device
becomes unusable.

Fix that by returning exactly fitting ranges.

Also fix indentation of an entire crs_replace_with_free_ranges to make
checkpatch happy.

Cc: qemu-stable@nongnu.org
Signed-off-by: Evgeny Yakovlev <wrfsh@yandex-team.ru>
Message-Id: <1563466463-26012-1-git-send-email-wrfsh@yandex-team.ru>
Signed-off-by: Evgeny Yakovlev <wrfsh@yandex-team.ru>
hw/i386/acpi-build.c