[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: |
Peter Maydell |
Subject: |
Re: [PATCH 8/8] hw/arm/virt: Disable highmem when on hypervisor.framework |
Date: |
Fri, 27 Nov 2020 16:38:18 +0000 |
On Fri, 27 Nov 2020 at 16:26, Eduardo Habkost <ehabkost@redhat.com> wrote:
>
> On Thu, Nov 26, 2020 at 10:29:01PM +0000, Peter Maydell wrote:
> > On Thu, 26 Nov 2020 at 22:14, Eduardo Habkost <ehabkost@redhat.com> wrote:
> > > 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?
> >
> > It's a property of the CPU (eg our emulated TCG CPUs may have
> > varying supported numbers of physical address bits). So the
> > virt board ought to look at the CPU, and the CPU should be
> > set up with the right information for all of KVM, TCG, HVF
> > (either a specific max_phys_addr_bits value or just ensure
> > its ID_AA64MMFR0_EL1.PARange is right, not sure which would
> > be easier/nicer).
>
> Agreed.
>
> My suggestion would still apply to the CPU code that will pick
> the address size; ideally, accel-specific behaviour should be
> represented as meaningful fields in AccelClass (either data or
> virtual methods) instead of direct *_enabled() checks.
Having looked a bit more closely at some of the relevant target/arm
code, I think the best approach is going to be that in virt.c
we just check the PARange ID register field (probably via
a convenience function that does the conversion of that to
a nice number-of-bits return value; we might even have one
already). KVM and TCG both already set that ID register field
in the CPU struct correctly in their existing
implicitly-accelerator-specific code; HVF needs to do the same.
thanks
-- PMM
- Re: [PATCH 1/8] hvf: Add hypervisor entitlement to output binaries, (continued)
- [PATCH 3/8] arm: Set PSCI to 0.2 for HVF, 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, 2020/11/26
- 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 <=
- 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
[PATCH 5/8] hvf: Add Apple Silicon support, Alexander Graf, 2020/11/26
[PATCH 7/8] arm: Add Hypervisor.framework build target, Alexander Graf, 2020/11/26