hw/arm/virt: Honor highmem setting when computing the memory map
authorMarc Zyngier <maz@kernel.org>
Fri, 14 Jan 2022 14:07:38 +0000 (14:07 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 20 Jan 2022 11:47:53 +0000 (11:47 +0000)
commit0152b169ce163b99660b80a8ed6664707e889052
treefa81815224d29f9f4ba72d6b6c6f427273485576
parenta63618b147443de2485fb93705e21879b25c64c2
hw/arm/virt: Honor highmem setting when computing the memory map

Even when the VM is configured with highmem=off, the highest_gpa
field includes devices that are above the 4GiB limit.
Similarily, nothing seem to check that the memory is within
the limit set by the highmem=off option.

This leads to failures in virt_kvm_type() on systems that have
a crippled IPA range, as the reported IPA space is larger than
what it should be.

Instead, honor the user-specified limit to only use the devices
at the lowest end of the spectrum, and fail if we have memory
crossing the 4GiB limit.

Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Message-id: 20220114140741.1358263-4-maz@kernel.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt.c