qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PULL 13/28] hw/arm/virt: Use 256MB ECAM region by default
Date: Mon, 8 Jan 2024 18:20:52 +0100	[thread overview]
Message-ID: <7771970b-569a-4123-b64f-d6ac3272aac8@redhat.com> (raw)
In-Reply-To: <CAFEAcA9ZQ7FCS=eTCvPNy+knpeia6r4GrF2UN5W2bE6znvonSA@mail.gmail.com>

Hi Peter,

On 1/8/24 16:52, Peter Maydell wrote:
> On Fri, 22 Jun 2018 at 14:09, Peter Maydell <peter.maydell@linaro.org> wrote:
>> From: Eric Auger <eric.auger@redhat.com>
>>
>> With this patch, virt-3.0 machine uses a new 256MB ECAM region
>> by default instead of the legacy 16MB one, if highmem is set
>> (LPAE supported by the guest) and (!firmware_loaded || aarch64).
>>
>> Indeed aarch32 mode FW may not support this high ECAM region.
> This is a rather old change by now, but I've been looking
> at it because it exposes an issue which was previously
> masked by a different bug...
>
>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
>> index d8abf89e8c8..0f8bfa57d7e 100644
>> --- a/hw/arm/virt.c
>> +++ b/hw/arm/virt.c
>> @@ -1318,6 +1318,7 @@ static void machvirt_init(MachineState *machine)
>>      int n, virt_max_cpus;
>>      MemoryRegion *ram = g_new(MemoryRegion, 1);
>>      bool firmware_loaded = bios_name || drive_get(IF_PFLASH, 0, 0);
>> +    bool aarch64 = true;
>>
>>      /* We can probe only here because during property set
>>       * KVM is not available yet
>> @@ -1433,6 +1434,8 @@ static void machvirt_init(MachineState *machine)
>>          numa_cpu_pre_plug(&possible_cpus->cpus[cs->cpu_index], DEVICE(cpuobj),
>>                            &error_fatal);
>>
>> +        aarch64 &= object_property_get_bool(cpuobj, "aarch64", NULL);
>> +
>>          if (!vms->secure) {
>>              object_property_set_bool(cpuobj, false, "has_el3", NULL);
>>          }
>> @@ -1491,6 +1494,8 @@ static void machvirt_init(MachineState *machine)
>>          create_uart(vms, pic, VIRT_SECURE_UART, secure_sysmem, serial_hd(1));
>>      }
>>
>> +    vms->highmem_ecam &= vms->highmem && (!firmware_loaded || aarch64);
> Do you remember why this conditional is the way it is?
It comes from Laszlo's suggestion at
http://patchwork.ozlabs.org/project/qemu-devel/cover/1527091418-11874-1-git-send-email-eric.auger@redhat.com/#1920422

"I'd rather restrict the large/high ECAM feature to 64-bit guests (with or without
firmware), and to 32-bit LPAE kernels that are launched without firmware
(which, I think, has been the case for most of their history)."


See the associated thread too.

Hope this helps

Eric
> As it stands, it will disable the high-memory ECAM for
> an AArch32 VM that's loaded firmware, but leaves it enabled
> if we're direct booting Linux. That's a problem because 32-bit
> Linux falls over if you pass it a highmem-ECAM, even if LPAE
> is enabled (somewhere along the line it discards the high 32
> bits of the address of the ECAM in the dtb, so it thinks the
> ECAM overlaps with another memory region, and won't recognize
> the pci controller; I have a feeling this is a regression in
> the kernel). Plus, we have no way to tell if the guest
> kernel has LPAE enabled at all.
>
> Maybe it would be safer to insist that the guest is aarch64
> before we enable highmem ECAM?
>
> thanks
> -- PMM
>



  reply	other threads:[~2024-01-08 17:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 12:56 [Qemu-devel] [PULL 00/28] target-arm queue Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 01/28] hw/intc/arm_gicv3: fix an extra left-shift when reading IPRIORITYR Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 02/28] target/arm: Minor cleanup for ARMv6-M 32-bit instructions Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 03/28] target-arm: fix a segmentation fault due to illegal memory access Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 04/28] linux-headers: Update to kernel mainline commit b357bf602 Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 05/28] target/arm: Allow KVM device address overwriting Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 06/28] hw/intc/arm_gicv3: Introduce redist-region-count array property Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 07/28] hw/intc/arm_gicv3_kvm: Get prepared to handle multiple redist regions Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 08/28] hw/arm/virt: GICv3 DT node with one or two redistributor regions Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 09/28] hw/arm/virt-acpi-build: Advertise one or two GICR structures Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 10/28] hw/arm/virt: Register two redistributor regions when necessary Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 11/28] hw/arm/virt: Add a new 256MB ECAM region Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 12/28] hw/arm/virt: Add virt-3.0 machine type Peter Maydell
2018-06-22 12:56 ` [Qemu-devel] [PULL 13/28] hw/arm/virt: Use 256MB ECAM region by default Peter Maydell
2024-01-08 15:52   ` Peter Maydell
2024-01-08 17:20     ` Eric Auger [this message]
2018-06-22 12:56 ` [Qemu-devel] [PULL 14/28] hw/arm/virt: Increase max_cpus to 512 Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 15/28] target-arm: Add the Cortex-R5F Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 16/28] xlnx-zynqmp: Swap Cortex-R5 for Cortex-R5F Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 17/28] hw/misc/tz-mpc.c: Implement the Arm TrustZone Memory Protection Controller Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 18/28] hw/misc/tz-mpc.c: Implement registers Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 19/28] hw/misc/tz-mpc.c: Implement correct blocked-access behaviour Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 20/28] hw/misc/tz_mpc.c: Honour the BLK_LUT settings in translate Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 21/28] hw/misc/iotkit-secctl.c: Implement SECMPCINTSTATUS Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 22/28] hw/arm/iotkit: Instantiate MPC Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 23/28] hw/arm/iotkit: Wire up MPC interrupt lines Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 24/28] hw/arm/mps2-tz.c: Instantiate MPCs Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 25/28] target/arm: Introduce ARM_FEATURE_M_MAIN Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 26/28] target/arm: Strict alignment for ARMv6-M and ARMv8-M Baseline Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 27/28] vl.c: Don't zero-initialize statics for serial_hds Peter Maydell
2018-06-22 12:57 ` [Qemu-devel] [PULL 28/28] xen: Don't use memory_region_init_ram_nomigrate() in pci_assign_dev_load_option_rom() Peter Maydell
2018-06-22 16:08 ` [Qemu-devel] [PULL 00/28] target-arm queue Peter Maydell

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=7771970b-569a-4123-b64f-d6ac3272aac8@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).