[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framewor
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework |
Date: |
Thu, 26 Nov 2020 17:14:05 -0500 |
On Thu, Nov 26, 2020 at 10:50:17PM +0100, Alexander Graf wrote:
> The Apple M1 only supports up to 36 bits of physical address space. That
> means we can not fit the 64bit MMIO BAR region into our address space.
>
> To fix this, let's not expose a 64bit MMIO BAR region when running on
> Apple Silicon.
>
> I have not been able to find a way to enumerate that easily, so let's
> just assume we always have that little PA space on hypervisor.framework
> systems.
>
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> ---
> hw/arm/virt.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 27dbeb549e..d74053ecd4 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -45,6 +45,7 @@
> #include "hw/display/ramfb.h"
> #include "net/net.h"
> #include "sysemu/device_tree.h"
> +#include "sysemu/hvf.h"
> #include "sysemu/numa.h"
> #include "sysemu/runstate.h"
> #include "sysemu/sysemu.h"
> @@ -1746,6 +1747,14 @@ static void machvirt_init(MachineState *machine)
> unsigned int smp_cpus = machine->smp.cpus;
> unsigned int max_cpus = machine->smp.max_cpus;
>
> + /*
> + * On Hypervisor.framework capable systems, we only have 36 bits of PA
> + * space, which is not enough to fit a 64bit BAR space
> + */
> + if (hvf_enabled()) {
> + vms->highmem = false;
> + }
Direct checks for *_enabled() are a pain to clean up later when
we add support to new accelerators. Can't this be implemented as
(e.g.) a AccelClass::max_physical_address_bits field?
> +
> /*
> * In accelerated mode, the memory map is computed earlier in kvm_type()
> * to create a VM with the right number of IPA bits.
> --
> 2.24.3 (Apple Git-128)
>
--
Eduardo
[PATCH 3/8] arm: Set PSCI to 0.2 for HVF, Alexander Graf, 2020/11/26
[PATCH 5/8] hvf: Add Apple Silicon support, Alexander Graf, 2020/11/26
[PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Alexander Graf, 2020/11/26
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework,
Eduardo Habkost <=
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Peter Maydell, 2020/11/26
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Eduardo Habkost, 2020/11/27
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Peter Maydell, 2020/11/27
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Eduardo Habkost, 2020/11/27
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Peter Maydell, 2020/11/27
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Eduardo Habkost, 2020/11/27
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Peter Maydell, 2020/11/27
- Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Eduardo Habkost, 2020/11/27
Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Peter Maydell, 2020/11/27
Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework, Alexander Graf, 2020/11/29