From: Gavin Shan <gshan@redhat.com>
To: Cornelia Huck <cohuck@redhat.com>, qemu-arm@nongnu.org
Cc: qemu-devel@nongnu.org, maz@kernel.org, eric.auger@redhat.com,
zhenyzha@redhat.com, richard.henderson@linaro.org,
peter.maydell@linaro.org, shan.gavin@gmail.com
Subject: Re: [PATCH v5 6/6] hw/arm/virt: Add 'compact-highmem' property
Date: Thu, 20 Oct 2022 07:08:51 +0800 [thread overview]
Message-ID: <678052ed-2dbd-05c2-2e42-6b4ffa55f633@redhat.com> (raw)
In-Reply-To: <87wn8vzze9.fsf@redhat.com>
Hi Connie,
On 10/19/22 10:00 PM, Cornelia Huck wrote:
> On Wed, Oct 12 2022, 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;
>>
>> # 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.
>>
>> Signed-off-by: Gavin Shan <gshan@redhat.com>
>> Tested-by: Zhenyu Zhang <zhenyzha@redhat.com>
>> ---
>> docs/system/arm/virt.rst | 4 ++++
>> hw/arm/virt.c | 47 ++++++++++++++++++++++++++++++++++++++++
>> include/hw/arm/virt.h | 1 +
>> 3 files changed, 52 insertions(+)
>>
>> diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst
>> index 20442ea2c1..75bf5a4994 100644
>> --- a/docs/system/arm/virt.rst
>> +++ b/docs/system/arm/virt.rst
>> @@ -94,6 +94,10 @@ highmem
>> address space above 32 bits. The default is ``on`` for machine types
>> later than ``virt-2.12``.
>>
>> +compact-highmem
>> + Set ``on``/``off`` to enable/disable compact space for high memory regions.
>
> Maybe s/compact space/the compact layout/ ?
>
Yeah, 'compact layout' is better. I will amend in next respin.
>> + The default is ``on`` for machine types later than ``virt-7.2``
>> +
>> gic-version
>> Specify the version of the Generic Interrupt Controller (GIC) to provide.
>> Valid values are:
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index c05cfb5314..8f1dba0ece 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -174,6 +174,27 @@ static const MemMapEntry base_memmap[] = {
>> * Note the extended_memmap is sized so that it eventually also includes the
>> * base_memmap entries (VIRT_HIGH_GIC_REDIST2 index is greater than the last
>> * index of base_memmap).
>> + *
>> + * The addresses assigned to these regions are affected by 'compact-highmem'
>> + * property, which is to enable or disable the compact space in the Highmem
>
> s/space in/layout for/ ?
>
Agreed.
>> + * IO regions. For example, VIRT_HIGH_PCIE_MMIO can be disabled or enabled
>> + * depending on the property in the following scenario.
>> + *
>> + * pa_bits = 40;
>> + * vms->highmem_redists = false;
>> + * vms->highmem_ecam = false;
>> + * vms->highmem_mmio = true;
>> + *
>> + * # 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+256GB 512GB+512MB] [disabled]
>> + * HIGH_PCIE_MMIO [disabled] [512GB 1TB]
>> */
>> static MemMapEntry extended_memmap[] = {
>> /* Additional 64 MB redist region (can contain up to 512 redistributors) */
>
> (...)
>
>> @@ -3124,8 +3167,12 @@ DEFINE_VIRT_MACHINE_AS_LATEST(7, 2)
>>
>> static void virt_machine_7_1_options(MachineClass *mc)
>> {
>> + VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
>> +
>> virt_machine_7_2_options(mc);
>> compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len);
>> + /* Compact space for high memory regions was introduced with 7.2 */
>
> s/space/layout/ ?
>
Ack.
>> + vmc->no_highmem_compact = true;
>> }
>> DEFINE_VIRT_MACHINE(7, 1)
>>
>
> Other than the wording nits, lgtm.
>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>
Thanks,
Gavin
next prev parent reply other threads:[~2022-10-19 23:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-11 23:18 [PATCH v5 0/6] hw/arm/virt: Improve address assignment for high memory regions Gavin Shan
2022-10-11 23:18 ` [PATCH v5 1/6] hw/arm/virt: Introduce virt_set_high_memmap() helper Gavin Shan
2022-10-11 23:18 ` [PATCH v5 2/6] hw/arm/virt: Rename variable size to region_size in virt_set_high_memmap() Gavin Shan
2022-10-11 23:18 ` [PATCH v5 3/6] hw/arm/virt: Introduce variable region_base " Gavin Shan
2022-10-11 23:18 ` [PATCH v5 4/6] hw/arm/virt: Introduce virt_get_high_memmap_enabled() helper Gavin Shan
2022-10-19 13:50 ` Cornelia Huck
2022-10-20 4:57 ` Eric Auger
2022-10-11 23:18 ` [PATCH v5 5/6] hw/arm/virt: Improve high memory region address assignment Gavin Shan
2022-10-19 13:54 ` Cornelia Huck
2022-10-19 20:07 ` Eric Auger
2022-10-19 22:58 ` Gavin Shan
2022-10-11 23:18 ` [PATCH v5 6/6] hw/arm/virt: Add 'compact-highmem' property Gavin Shan
2022-10-19 14:00 ` Cornelia Huck
2022-10-19 23:08 ` Gavin Shan [this message]
2022-10-19 20:18 ` Eric Auger
2022-10-19 23:57 ` Gavin Shan
2022-10-20 9:44 ` Marc Zyngier
2022-10-20 11:13 ` Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=678052ed-2dbd-05c2-2e42-6b4ffa55f633@redhat.com \
--to=gshan@redhat.com \
--cc=cohuck@redhat.com \
--cc=eric.auger@redhat.com \
--cc=maz@kernel.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=shan.gavin@gmail.com \
--cc=zhenyzha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).