qemu-devel
[Top][All Lists]
Advanced

[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()?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]