qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH v20 02/21] s390x/cpu topology: add topology entries on CPU ho


From: Pierre Morel
Subject: Re: [PATCH v20 02/21] s390x/cpu topology: add topology entries on CPU hotplug
Date: Wed, 3 May 2023 09:21:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0


On 5/2/23 14:30, Cédric Le Goater wrote:
On 4/25/23 18:14, Pierre Morel wrote:
The topology information are attributes of the CPU and are
specified during the CPU device creation.


[...]
+
+/**
+ * s390_topology_init:
+ * @ms: the machine state where the machine topology is defined
+ *
+ * Keep track of the machine topology.
+ *
+ * Allocate an array to keep the count of cores per socket.
+ * The index of the array starts at socket 0 from book 0 and
+ * drawer 0 up to the maximum allowed by the machine topology.
+ */
+static void s390_topology_init(MachineState *ms)
+{
+    CpuTopology *smp = &ms->smp;
+
+    s390_topology.smp = smp;

I am not sure the 'smp' shortcut is necessary. 'MachineState *ms' is
always available where 'CpuTopology *smp' is used. so it could be
computed from a local variable AFAICT. It would reduce the risk of
'smp' being NULL in some (future) code path.

Thanks,

C.


So I will use directly current_machine->smp

You are right it is more homogeneous, there is no need to keep a pointer here.

Thanks

Pierre


[...]




reply via email to

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