qemu-e2k/include/hw/arm
Gavin Shan 4a4ff9edc6 hw/arm/virt: Improve high memory region address assignment
There are three high memory regions, which are VIRT_HIGH_REDIST2,
VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses
are floating on highest RAM address. However, they can be disabled
in several cases.

(1) One specific high memory region is likely to be disabled by
    code by toggling vms->highmem_{redists, ecam, mmio}.

(2) VIRT_HIGH_PCIE_ECAM region is disabled on machine, which is
    'virt-2.12' or ealier than it.

(3) VIRT_HIGH_PCIE_ECAM region is disabled when firmware is loaded
    on 32-bits system.

(4) One specific high memory region is disabled when it breaks the
    PA space limit.

The current implementation of virt_set_{memmap, high_memmap}() isn't
optimized because the high memory region's PA space is always reserved,
regardless of whatever the actual state in the corresponding
vms->highmem_{redists, ecam, mmio} flag. In the code, 'base' and
'vms->highest_gpa' are always increased for case (1), (2) and (3).
It's unnecessary since the assigned PA space for the disabled high
memory region won't be used afterwards.

Improve the address assignment for those three high memory region by
skipping the address assignment for one specific high memory region if
it has been disabled in case (1), (2) and (3). The memory layout may
be changed after the improvement is applied, which leads to potential
migration breakage. So 'vms->highmem_compact' is added to control if
the improvement should be applied. For now, 'vms->highmem_compact' is
set to false, meaning that we don't have memory layout change until it
becomes configurable through property 'compact-highmem' in next patch.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Tested-by: Zhenyu Zhang <zhenyzha@redhat.com>
Message-id: 20221029224307.138822-6-gshan@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-12-15 11:18:19 +00:00
..
allwinner-a10.h
allwinner-h3.h
armsse-version.h
armsse.h
armv7m.h
aspeed_soc.h aspeed: Make aspeed_board_init_flashes public 2022-07-14 16:24:38 +02:00
aspeed.h
bcm2835_peripherals.h Align Raspberry Pi DMA interrupts with Linux DTS 2022-07-18 13:25:13 +01:00
bcm2836.h
boot.h target/arm: Make boards pass base address to armv7m_load_kernel() 2022-09-14 11:19:40 +01:00
digic.h
exynos4210.h hw/arm/exynos4210: Drop Exynos4210Irq struct 2022-04-21 11:37:04 +01:00
fdt.h
fsl-imx6.h
fsl-imx6ul.h
fsl-imx7.h
fsl-imx25.h
fsl-imx31.h
linux-boot-if.h
msf2-soc.h
npcm7xx.h
nrf51_soc.h
nrf51.h
omap.h
primecell.h
pxa.h
raspi_platform.h
sharpsl.h
smmu-common.h hw/arm/smmuv3: Cache event fault record 2022-04-28 13:57:33 +01:00
smmuv3.h
soc_dma.h
stm32f100_soc.h
stm32f205_soc.h
stm32f405_soc.h
virt.h hw/arm/virt: Improve high memory region address assignment 2022-12-15 11:18:19 +00:00
xlnx-versal.h hw/arm: versal: Connect the CRL 2022-04-21 11:37:03 +01:00
xlnx-zynqmp.h hw/arm/xlnx-zynqmp: Connect ZynqMP's USB controllers 2022-09-29 17:40:01 +01:00