[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 17/17] accel/tcg: use current_machine as it is always set
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v8 17/17] accel/tcg: use current_machine as it is always set for softmmu |
Date: |
Wed, 16 Sep 2020 17:24:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 9/16/20 4:20 PM, Claudio Fontana wrote:
> current_machine is always set before accelerators are initialized,
> so use that instead of MACHINE(qdev_get_machine()).
>
> Signed-off-by: Claudio Fontana <cfontana@suse.de>
> ---
> accel/tcg/tcg-cpus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/accel/tcg/tcg-cpus.c b/accel/tcg/tcg-cpus.c
> index ec7158b55e..05af1168a2 100644
> --- a/accel/tcg/tcg-cpus.c
> +++ b/accel/tcg/tcg-cpus.c
> @@ -484,7 +484,7 @@ static void tcg_start_vcpu_thread(CPUState *cpu)
> * then we will have cpus running in parallel.
> */
> if (qemu_tcg_mttcg_enabled()) {
> - MachineState *ms = MACHINE(qdev_get_machine());
> + MachineState *ms = current_machine;
> if (ms->smp.max_cpus > 1) {
What about simply using:
if (current_machine->smp.max_cpus > 1) {
> parallel_cpus = true;
> }
>
Regardless:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
- [PATCH v8 10/17] cpus: cleanup now unneeded includes, (continued)
- [PATCH v8 10/17] cpus: cleanup now unneeded includes, Claudio Fontana, 2020/09/16
- [PATCH v8 08/17] cpus: extract out whpx-specific code to target/i386/, Claudio Fontana, 2020/09/16
- [PATCH v8 09/17] cpus: extract out hvf-specific code to target/i386/hvf/, Claudio Fontana, 2020/09/16
- [PATCH v8 12/17] cpus: add handle_interrupt to the CpusAccel interface, Claudio Fontana, 2020/09/16
- [PATCH v8 11/17] cpus: remove checks for non-NULL cpus_accel, Claudio Fontana, 2020/09/16
- [PATCH v8 15/17] hax: remove hax specific functions from global includes, Claudio Fontana, 2020/09/16
- [PATCH v8 16/17] kvm: remove kvm specific functions from global includes, Claudio Fontana, 2020/09/16
- [PATCH v8 14/17] whpx: remove whpx specific functions from global includes, Claudio Fontana, 2020/09/16
- [PATCH v8 13/17] hvf: remove hvf specific functions from global includes, Claudio Fontana, 2020/09/16
- [PATCH v8 17/17] accel/tcg: use current_machine as it is always set for softmmu, Claudio Fontana, 2020/09/16
- Re: [PATCH v8 17/17] accel/tcg: use current_machine as it is always set for softmmu,
Philippe Mathieu-Daudé <=
- Re: [PATCH v8 00/17] QEMU cpus.c refactoring part2, Richard Henderson, 2020/09/18