[Top][All Lists]

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

Re: [Qemu-trivial] [Qemu-devel] [Qemu-ppc] [PATCH v3 04/10] hw/ppc: Repl

From: Like Xu
Subject: Re: [Qemu-trivial] [Qemu-devel] [Qemu-ppc] [PATCH v3 04/10] hw/ppc: Replace global smp variables with machine smp properties
Date: Thu, 6 Jun 2019 16:37:05 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 2019/6/6 16:20, Greg Kurz wrote:
On Thu, 6 Jun 2019 13:07:32 +1000
David Gibson <address@hidden> wrote:

On Wed, Jun 05, 2019 at 11:54:56PM -0300, Eduardo Habkost wrote:
On Wed, Jun 05, 2019 at 11:52:41PM -0300, Eduardo Habkost wrote:
On Sun, May 19, 2019 at 04:54:22AM +0800, Like Xu wrote:
The global smp variables in ppc are replaced with smp machine properties.

A local variable of the same name would be introduced in the declaration
phase if it's used widely in the context OR replace it on the spot if it's
only used once. No semantic changes.

Signed-off-by: Like Xu <address@hidden>

Any objections from the ppc maintainers to queueing this through
the Machine Core tree?

Oops, CCing the ppc maintainers.

No objection here.

Acked-by: David Gibson <address@hidden>

Just one nit...


diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index ee24212765..c9ffe9786c 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -231,6 +231,8 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
                                            target_ulong args,
                                            uint32_t nret, target_ulong rets)
+    MachineState *ms = MACHINE(qdev_get_machine());

rtas_ibm_get_system_parameter() has a SpaprMachineState *spapr argument, no
need to rely on qdev_get_machine().

I will fix it in the next (rebased) version. Thank you, Greg.

But this can be fixed in a followup patch I guess. Not worth holding the
patchset because of that.

+    unsigned int max_cpus = ms->smp.max_cpus;
      target_ulong parameter = rtas_ld(args, 0);
      target_ulong buffer = rtas_ld(args, 1);
      target_ulong length = rtas_ld(args, 2);
@@ -244,7 +246,7 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
                                            current_machine->ram_size / MiB,
-                                          smp_cpus,
+                                          ms->smp.cpus,
          ret = sysparm_st(buffer, length, param_val, strlen(param_val) + 1);

reply via email to

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