]> 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 Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Oct 2019 21:58:28 +0000 (16:58 -0500)
commitd7e9b19f0b4ae99e1a5bfe8f190847e7f1785db4
treec13d631db1162658d7ab4a59d5097095554e6187
parentc4ac49457896e13139f9edb83fa88c04a2d524b1
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>
(cherry picked from commit 21e2acd583126db94f6d881005cd58e835160582)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/i386/acpi-build.c