qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_mode


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean
Date: Fri, 19 Apr 2024 11:08:22 +0200
User-agent: Mozilla Thunderbird

On 19/4/24 10:44, Zhao Liu wrote:
Hi Thomas,

On Fri, Apr 19, 2024 at 09:50:46AM +0200, Thomas Huth wrote:
Date: Fri, 19 Apr 2024 09:50:46 +0200
From: Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make
  kvm_s390_get_host_cpu_model() return boolean

On 19/04/2024 08.57, Zhao Liu wrote:
From: Zhao Liu <zhao1.liu@intel.com>

As error.h suggested, the best practice for callee is to return
something to indicate success / failure.

So make kvm_s390_get_host_cpu_model() return boolean and check the
returned boolean in get_max_cpu_model() instead of accessing @err.

Additionally, since now get_max_cpu_model() returns directly if
kvm_s390_get_host_cpu_model() fills @err, so make
kvm_s390_get_host_cpu_model() return true by default for the non-KVM
case in target/s390x/cpu_models.h.

You could also argue the other way round that there should be something in
*model if it returns "true" ... anyway, the stub should never be executed,
so it likely doesn't matter too much, but I'd still prefer if we'd rather
return "false" in the non-KVM stub instead.

I see, since this interface in wrapped in kvm_enabled() condition, so
the non-kvm sutb wouldn't be called.

Thanks! Will change to return false.

Or try to rebase your series on this untested patch:
20240419090631.48055-1-philmd@linaro.org/">https://lore.kernel.org/qemu-devel/20240419090631.48055-1-philmd@linaro.org/




reply via email to

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