[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 06/11] hvf: arm: Implement -cpu host
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v9 06/11] hvf: arm: Implement -cpu host |
Date: |
Mon, 13 Sep 2021 10:54:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 9/13/21 1:07 AM, Alexander Graf wrote:
> Now that we have working system register sync, we push more target CPU
> properties into the virtual machine. That might be useful in some
> situations, but is not the typical case that users want.
>
> So let's add a -cpu host option that allows them to explicitly pass all
> CPU capabilities of their host CPU into the guest.
>
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> Acked-by: Roman Bolshakov <r.bolshakov@yadro.com>
> Reviewed-by: Sergio Lopez <slp@redhat.com>
> ---
> target/arm/cpu.c | 9 ++++--
> target/arm/cpu.h | 2 ++
> target/arm/hvf/hvf.c | 76 ++++++++++++++++++++++++++++++++++++++++++++
> target/arm/hvf_arm.h | 19 +++++++++++
> target/arm/kvm_arm.h | 2 --
> 5 files changed, 104 insertions(+), 4 deletions(-)
> create mode 100644 target/arm/hvf_arm.h
>
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> @@ -2058,15 +2059,19 @@ static void arm_cpu_class_init(ObjectClass *oc, void
> *data)
> #endif /* CONFIG_TCG */
> }
>
> -#ifdef CONFIG_KVM
> +#if defined(CONFIG_KVM) || defined(CONFIG_HVF)
> static void arm_host_initfn(Object *obj)
> {
> ARMCPU *cpu = ARM_CPU(obj);
>
> +#ifdef CONFIG_KVM
> kvm_arm_set_cpu_features_from_host(cpu);
> if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
> aarch64_add_sve_properties(obj);
> }
> +#else
> + hvf_arm_set_cpu_features_from_host(cpu);
> +#endif
Could be cleaner as ARMCPUClass::set_cpu_features_from_host()?
- Re: [PATCH v9 01/11] arm: Move PMC register definitions to cpu.h, (continued)
- [PATCH v9 02/11] hvf: Add execute to dirty log permission bitmap, Alexander Graf, 2021/09/12
- [PATCH v9 03/11] hvf: Introduce hvf_arch_init() callback, Alexander Graf, 2021/09/12
- [PATCH v9 05/11] arm/hvf: Add a WFI handler, Alexander Graf, 2021/09/12
- [PATCH v9 04/11] hvf: Add Apple Silicon support, Alexander Graf, 2021/09/12
- [PATCH v9 08/11] arm: Add Hypervisor.framework build target, Alexander Graf, 2021/09/12
- [PATCH v9 10/11] arm: tcg: Adhere to SMCCC 1.3 section 5.2, Alexander Graf, 2021/09/12
- [PATCH v9 09/11] hvf: arm: Add rudimentary PMC support, Alexander Graf, 2021/09/12
- [PATCH v9 06/11] hvf: arm: Implement -cpu host, Alexander Graf, 2021/09/12
- Re: [PATCH v9 06/11] hvf: arm: Implement -cpu host,
Philippe Mathieu-Daudé <=
- [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Alexander Graf, 2021/09/12
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Peter Maydell, 2021/09/13
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Alexander Graf, 2021/09/13
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Peter Maydell, 2021/09/13
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Alexander Graf, 2021/09/13
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Peter Maydell, 2021/09/13
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Alexander Graf, 2021/09/13
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Marc Zyngier, 2021/09/15
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Alexander Graf, 2021/09/15
- Re: [PATCH v9 07/11] hvf: arm: Implement PSCI handling, Marc Zyngier, 2021/09/15