[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 6/6] hw/arm/virt: Add 'compact-highmem' property
From: |
Gavin Shan |
Subject: |
Re: [PATCH v4 6/6] hw/arm/virt: Add 'compact-highmem' property |
Date: |
Wed, 5 Oct 2022 07:33:40 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 |
Hi Marc,
On 10/5/22 1:39 AM, Marc Zyngier wrote:
On Tue, 04 Oct 2022 01:26:27 +0100,
Gavin Shan <gshan@redhat.com> wrote:
After the improvement to high memory region address assignment is
applied, the memory layout can be changed, introducing possible
migration breakage. For example, VIRT_HIGH_PCIE_MMIO memory region
is disabled or enabled when the optimization is applied or not, with
the following configuration.
pa_bits = 40;
vms->highmem_redists = false;
vms->highmem_ecam = false;
vms->highmem_mmio = true;
The question is how are these parameters specified by a user? Short of
hacking the code, this isn't really possible.
Yeah, It's impossible to have false for vms->highmem_redists unless
the code is hacked.
# qemu-system-aarch64 -accel kvm -cpu host \
-machine virt-7.2,compact-highmem={on, off} \
-m 4G,maxmem=511G -monitor stdio
Region compact-highmem=off compact-highmem=on
----------------------------------------------------------------
RAM [1GB 512GB] [1GB 512GB]
HIGH_GIC_REDISTS [512GB 512GB+64MB] [disabled]
HIGH_PCIE_ECAM [512GB+256MB 512GB+512MB] [disabled]
HIGH_PCIE_MMIO [disabled] [512GB 1TB]
In order to keep backwords compatibility, we need to disable the
optimization on machines, which is virt-7.1 or ealier than it. It
means the optimization is enabled by default from virt-7.2. Besides,
'compact-highmem' property is added so that the optimization can be
explicitly enabled or disabled on all machine types by users.
Not directly related to this series, but it seems to me that we should
be aiming at reproducible results across HW implementations (at least
with KVM). Depending on how many PA bits the HW implements, we end-up
with a set of devices or another, which is likely to be confusing for
a user.
I think we should consider an additional set of changes to allow a
user to specify the PA bits as well as the devices they want to see
enabled.
I think the idea to selectively enable devices (high memory regions)
is sensible. For example, users may needn't HIGH_PCIE_MMIO at all
in some systems, where they have limited PCI devices.
I'm not sure about PA bits because it has been discovered from hardware
and configure the automatically optimized value/bits back to KVM. The
optimized value/bits is automatically calculated based on the enabled
high memory regions.
Thanks,
Gavin
- [PATCH v4 1/6] hw/arm/virt: Introduce virt_set_high_memmap() helper, (continued)
[PATCH v4 6/6] hw/arm/virt: Add 'compact-highmem' property, Gavin Shan, 2022/10/03
[PATCH v4 5/6] hw/arm/virt: Improve high memory region address, Gavin Shan, 2022/10/03