[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] i386: fix '-cpu ?' output for host cpu type
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] i386: fix '-cpu ?' output for host cpu type |
Date: |
Mon, 2 Jul 2018 19:35:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 02/07/2018 18:56, Greg Kurz wrote:
> Since commit d6dcc5583e7, '-cpu ?' shows the description of the
> X86_CPU_TYPE_NAME("max") for the host CPU model:
>
> Enables all features supported by the accelerator in the current host
>
> instead of the expected:
>
> KVM processor with all supported host features
>
> or
>
> HVF processor with all supported host features
>
> This is caused by the early use of kvm_enabled() and hvf_enabled() in
> a class_init function. Since the accelerator isn't configured yet, both
> helpers return false unconditionally.
>
> A QEMU binary will only be compiled with one of these accelerators, not
> both. The appropriate description can thus be decided at build time.
>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> target/i386/cpu.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 1e6a7d0a7504..e5da60b28973 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -2838,13 +2838,13 @@ static void host_x86_cpu_class_init(ObjectClass *oc,
> void *data)
> xcc->host_cpuid_required = true;
> xcc->ordering = 8;
>
> - if (kvm_enabled()) {
> - xcc->model_description =
> - "KVM processor with all supported host features ";
> - } else if (hvf_enabled()) {
> - xcc->model_description =
> - "HVF processor with all supported host features ";
> - }
> +#if defined(CONFIG_KVM)
> + xcc->model_description =
> + "KVM processor with all supported host features ";
> +#elif defined(CONFIG_HVF)
> + xcc->model_description =
> + "HVF processor with all supported host features ";
> +#endif
> }
>
> static const TypeInfo host_x86_cpu_type_info = {
>
Queued, thanks.
Paolo