Hi Marc, On 1/6/22 8:34 PM, Marc Zyngier wrote: > Hi Eric, > > On Wed, 05 Jan 2022 09:41:19 +0000, > Eric Auger <eric.auger@xxxxxxxxxx> wrote: >> couldn't you simply introduce highmem_redist which is truly missing. You >> could set it in virt_set_memmap() in case you skip extended_map overlay >> and use it in virt_gicv3_redist_region_count() as you did? >> In addition to the device memory top address check against the 4GB limit >> if !highmem, we should be fine then? > No, highmem really isn't nearly enough. > > Imagine you have (like I do) a system with 36 bits of IPA space. > Create a VM with 8GB of RAM (which means the low-end of IPA space is > already 9GB). Obviously, highmem=true here. With the current code, we > will try to expose this PCI MMIO range, which falls way out of the IPA > space (you need at least 40 bits of IPA to even cover it with the > smallest configuration). In that case the he High MMIO region is accounted in the vms->highest_gpa: for (i = VIRT_LOWMEMMAP_LAST; i < ARRAY_SIZE(extended_memmap); i++) { hwaddr size = extended_memmap[i].size; base = ROUND_UP(base, size); vms->memmap[i].base = base; vms->memmap[i].size = size; base += size; } vms->highest_gpa = base - 1; and virt_kvm_type() should exit in that case at: if (requested_pa_size > max_vm_pa_size) { error_report("-m and ,maxmem option values " "require an IPA range (%d bits) larger than " "the one supported by the host (%d bits)", requested_pa_size, max_vm_pa_size); exit(1); } ? > > highmem really is a control that says 'things may live above 4GB'. It > doesn't say *how far* above 4GB it can be placed. Which is what I am > trying to address. OK I will look at your v4 ;-) Thanks Eric > > Thanks, > > M. >