[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled()
From: |
Greg Kurz |
Subject: |
Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled() |
Date: |
Tue, 20 Jun 2023 16:48:03 +0200 |
On Tue, 20 Jun 2023 09:55:49 +0200
Claudio Fontana <cfontana@suse.de> wrote:
> On 6/20/23 09:48, Philippe Mathieu-Daudé wrote:
> > Although the PPC target only supports the TCG and KVM
> > accelerators, QEMU supports more. We can no assume that
> > '!kvm == tcg', so test for the correct accelerator. This
> > also eases code review, because here we don't care about
> > KVM, we really want to test for TCG.
> >
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> I don't remember anymore, but what about qtest ? It is usually the forgotten
> case in these kind of tests... so much complexity :-)
>
This check was added with TCG in mind because it is a known limitation.
I don't see any reason to prevent qtest from being used with the rest
of this function though.
> Ciao,
>
> Claudio
>
>
> > ---
> > hw/ppc/spapr.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index dcb7f1c70a..c4b666587b 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -2524,7 +2524,7 @@ static void spapr_set_vsmt_mode(SpaprMachineState
> > *spapr, Error **errp)
> > int ret;
> > unsigned int smp_threads = ms->smp.threads;
> >
> > - if (!kvm_enabled() && (smp_threads > 1)) {
> > + if (tcg_enabled() && (smp_threads > 1)) {
Bonjour Philippe,
Please drop the unneeded parens in the second check.
With this fixed,
Reviewed-by: Greg Kurz <groug@kaod.org>
Cheers,
--
Greg
> > error_setg(errp, "TCG cannot support more than 1 thread/core "
> > "on a pseries machine");
> > return;
>
--
Greg
- [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(), Philippe Mathieu-Daudé, 2023/06/20
- Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(), Claudio Fontana, 2023/06/20
- Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(),
Greg Kurz <=
- Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(), Harsh Prateek Bora, 2023/06/20
- Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(), Cédric Le Goater, 2023/06/20
- Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(), David Gibson, 2023/06/20
- Re: [PATCH] hw/ppc/spapr: Test whether TCG is enabled with tcg_enabled(), BALATON Zoltan, 2023/06/20