From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org,
david@gibson.dropbear.id.au
Subject: [PATCH 2/2] spapr.c: remove 'ibm,chip-id' from DT
Date: Fri, 19 Mar 2021 15:34:53 -0300 [thread overview]
Message-ID: <20210319183453.4466-3-danielhb413@gmail.com> (raw)
In-Reply-To: <20210319183453.4466-1-danielhb413@gmail.com>
The attribute 'ibm,chip-id' does not exist in PAPR. This alone would be
enough reason to remove it from the spapr DT, but before doing that,
let's give a brief context on how and why it was introduced.
'ibm,chip-id' was added in the spapr DT by commit 10582ff83279. This
commit references kernel commit 256f2d4b463d ("powerpc: Use ibm,chip-id
property to compute cpu_core_mask if available"). In this kernel commit,
the 'ibm,chip-id' DT attribute is being used to calculate the
cpu_core_mask in traverse_siblings_chip_id(). This function still need
to consider 'ibm,chip-id' not being available as well to avoid breaking
older guests.
Later on, kernel commit df52f6714071 ("powerpc/smp: Rework CPU topology
construction") removed traverse_siblings_chip_id() and its callers,
making the CPU topology calculation independent of the 'ibm,chip-id'
attribute.
Last, but perhaps most relevant, kernel commit 4ca234a9cbd7
("powerpc/smp: Stop updating cpu_core_mask") changed the way the kernel
calculates the cpu_core_mask, removing the use of 'ibm,chip-id' in the
calculation altogether, with consequences already discussed in the
previous patch.
All that said, since it's not in PAPR and the pseries kernel does not
rely on it, let's remove ibm,chip-id from the DT for the default machine
type. This removal is related to the previous SMP change, so re-use the
same smc->pre_6_0_smp_topology flag.
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
Suggested-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/spapr.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 745f71c243..58efb51ac7 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -649,6 +649,7 @@ static void spapr_dt_cpu(CPUState *cs, void *fdt, int offset,
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs);
+ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(ms);
int index = spapr_get_vcpu_id(cpu);
uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40),
0xffffffff, 0xffffffff};
@@ -745,8 +746,10 @@ static void spapr_dt_cpu(CPUState *cs, void *fdt, int offset,
spapr_dt_pa_features(spapr, cpu, fdt, offset);
- _FDT((fdt_setprop_cell(fdt, offset, "ibm,chip-id",
- cs->cpu_index / vcpus_per_socket)));
+ if (smc->pre_6_0_smp_topology) {
+ _FDT((fdt_setprop_cell(fdt, offset, "ibm,chip-id",
+ cs->cpu_index / vcpus_per_socket)));
+ }
_FDT((fdt_setprop(fdt, offset, "ibm,pft-size",
pft_size_prop, sizeof(pft_size_prop))));
--
2.29.2
prev parent reply other threads:[~2021-03-19 18:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 18:34 [PATCH 0/2] pseries: SMP sockets must match NUMA nodes Daniel Henrique Barboza
2021-03-19 18:34 ` [PATCH 1/2] spapr: number of SMP sockets must be equal to " Daniel Henrique Barboza
2021-03-23 1:03 ` David Gibson
2021-03-23 17:21 ` Daniel Henrique Barboza
2021-03-25 2:10 ` David Gibson
2021-03-25 8:56 ` Cédric Le Goater
2021-03-25 10:15 ` Daniel Henrique Barboza
2021-03-29 4:20 ` David Gibson
2021-03-29 15:32 ` Cédric Le Goater
2021-03-29 18:32 ` Daniel Henrique Barboza
2021-03-29 23:55 ` Igor Mammedov
2021-03-31 0:57 ` David Gibson
2021-03-31 4:58 ` Michael Ellerman
2021-03-31 15:22 ` Cédric Le Goater
2021-04-01 2:53 ` David Gibson
2021-03-31 15:18 ` Cédric Le Goater
2021-03-31 17:29 ` Daniel Henrique Barboza
2021-03-31 17:40 ` Cédric Le Goater
2021-04-01 2:59 ` David Gibson
2021-04-01 9:21 ` Cédric Le Goater
2021-03-29 23:51 ` Igor Mammedov
2021-03-30 21:33 ` Daniel Henrique Barboza
2021-03-19 18:34 ` Daniel Henrique Barboza [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210319183453.4466-3-danielhb413@gmail.com \
--to=danielhb413@gmail.com \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).