From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Alexander Graf <agraf@suse.de>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] spapr: add ibm, chip-id property in device tree
Date: Sat, 12 Apr 2014 02:41:47 +1000 [thread overview]
Message-ID: <53481B4B.6010805@ozlabs.ru> (raw)
In-Reply-To: <53481879.5090007@suse.de>
On 04/12/2014 02:29 AM, Alexander Graf wrote:
>
> On 13.03.14 07:29, Alexey Kardashevskiy wrote:
>> This adds a "ibm,chip-id" property for CPU nodes which should be the same
>> for all cores in the same CPU socket. The recent guest kernels use this
>> information to associate threads with sockets.
>>
>> Refer to the kernel commit 256f2d4b463d3030ebc8d2b54f427543814a2bdc
>> for more details.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>> hw/ppc/spapr.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index bf46c38..6366230 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -308,6 +308,8 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
>> uint32_t interrupt_server_ranges_prop[] = {0, cpu_to_be32(smp_cpus)};
>> int i, smt = kvmppc_smt_threads();
>> unsigned char vec5[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x80};
>> + QemuOpts *opts = qemu_opts_find(qemu_find_opts("smp-opts"), NULL);
>> + unsigned sockets = opts ? qemu_opt_get_number(opts, "sockets", 0) : 0;
>> fdt = g_malloc0(FDT_MAX_SIZE);
>> _FDT((fdt_create(fdt, FDT_MAX_SIZE)));
>> @@ -465,6 +467,13 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
>> page_sizes_prop, page_sizes_prop_size)));
>> }
>> + if (sockets) {
>> + int cpus_per_socket = smp_cpus / sockets;
>> + uint32_t chip_id = cs->cpu_index / cpus_per_socket;
>> +
>> + _FDT((fdt_property_cell(fdt, "ibm,chip-id", chip_id)));
>> + }
>
> Have you verified this works correctly with threads?
Sorry, do not follow you.
-smp X,sockets=Y,threads=Z - what combination of XYZ is suspicious?
> Also, I don't see why
> we should omit the chip-id when we don't define sockets.
Why should we pollute device tree...
--
Alexey
prev parent reply other threads:[~2014-04-11 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 6:29 [Qemu-devel] [PATCH] spapr: add ibm, chip-id property in device tree Alexey Kardashevskiy
2014-04-11 16:29 ` Alexander Graf
2014-04-11 16:41 ` Alexey Kardashevskiy [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=53481B4B.6010805@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--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).