[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: |
Zhao Liu |
Subject: |
Re: [PATCH 3/6] target/s390x/cpu_models: Make kvm_s390_get_host_cpu_model() return boolean |
Date: |
Mon, 22 Apr 2024 17:03:16 +0800 |
On Fri, Apr 19, 2024 at 11:08:22AM +0200, Philippe Mathieu-Daudé wrote:
> Date: Fri, 19 Apr 2024 11:08:22 +0200
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> Subject: Re: [PATCH 3/6] target/s390x/cpu_models: Make
> kvm_s390_get_host_cpu_model() return boolean
>
> 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/
>
Good, pls let me pick this patch into my v2.
- Re: [PATCH 1/6] target/s390x/cpu_model: Make check_compatibility() return boolean, (continued)
[PATCH 4/6] target/s390x/cpu_models: Drop local @err in get_max_cpu_model(), Zhao Liu, 2024/04/19
[PATCH 6/6] target/s390x/cpu_models_sysemu: Drop local @err in apply_cpu_model(), Zhao Liu, 2024/04/19
[PATCH 5/6] target/s390x/cpu_models: Make kvm_s390_apply_cpu_model() return boolean, Zhao Liu, 2024/04/19
Re: [PATCH 0/6] s390x/cpu_models: Misc cleanup on returned error code and local @err variables, Philippe Mathieu-Daudé, 2024/04/19