From: Julien Grall <julien.grall@linaro.org>
To: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Tim Deegan <tim@xen.org>,
xen-devel@lists.xen.org
Subject: Re: [RFC PATCH 09/13] arch/arm: create device tree nodes for Dom0 cpufreq cpu driver
Date: Tue, 07 Oct 2014 16:26:54 +0100 [thread overview]
Message-ID: <5434063E.1040500@linaro.org> (raw)
In-Reply-To: <1412691566-7320-10-git-send-email-oleksandr.dmytryshyn@globallogic.com>
Hi Oleksandr,
On 10/07/2014 03:19 PM, Oleksandr Dmytryshyn wrote:
> This patch copies all cpu@0..cpu@N nodes (from input
> device tree) with properties to /cpus/cpu@0/private_data
> node (device tree for Dom0). Thus we can have any number
> of VCPUs in Dom0 and we give all information about all
> physical CPUs in the private_data node. Driver in Dom0
> should parse /cpus/cpu@0/private_data path instead of the
> /cpus path in the device tree.
>
> Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@globallogic.com>
> ---
> xen/arch/arm/domain_build.c | 58 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 58 insertions(+)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 2db0236..a142cc4 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -436,6 +436,10 @@ static int make_cpus_node(const struct domain *d, void *fdt,
> char buf[15];
> u32 clock_frequency;
> bool_t clock_valid;
> +#ifdef HAS_CPUFREQ
> + const struct dt_property *pp;
> + char *node_name;
> +#endif
>
> DPRINT("Create cpus node\n");
>
> @@ -517,6 +521,60 @@ static int make_cpus_node(const struct domain *d, void *fdt,
> return res;
> }
>
The function make_cpus_node is quite big. I would introduce a new
function to copy the "private_data".
I was also thinking if it wouldn't have been better to move those nodes
under the hypervisor one because it's Xen stuff.
> +#ifdef HAS_CPUFREQ
> + /*
> + * Add "private_data" node to cpu@0 and copy to it
> + * original cpu@0..cpu@N nodes with its properties.
> + * This is needed for the cpufreq cpu driver in Dom0
> + */
This copy is mostly related to Xen
Wouldn't it be better to copy those nodes in the hypervisor node?
> + if ( cpu == 0 )
> + {
> + DPRINT("Create private_data node\n");
> +
> + res = fdt_begin_node(fdt, "private_data");
> + if ( res )
> + return res;
> +
> + dt_for_each_child_node( cpus, npcpu )
> + {
> + if ( dt_device_type_is_equal(npcpu, "cpu") )
> + {
> + node_name = strrchr(dt_node_full_name(npcpu), '/');
> + if ( node_name )
> + node_name++;
IIRC, it's not possible to have an empty node_name here. The node name
will always be /cpus/name.
I would turn this if to an ASSERT, and drop the if just below.
> +
> + if ( node_name && *node_name )
> + {
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-10-07 15:26 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 14:19 [RFC PATCH 00/13] xen_cpufreq implementation in Xen hypervisor Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 01/13] cpufreq: move cpufreq.h file to the xen/include/cpufreq location Oleksandr Dmytryshyn
2014-10-07 14:22 ` Andrew Cooper
2014-10-07 14:27 ` Oleksandr Dmytryshyn
2014-10-07 14:35 ` Jan Beulich
2014-10-09 6:04 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 02/13] pm: move processor_perf.h " Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 03/13] pmstat: move pmstat.c file to the xen/drivers/pm location Oleksandr Dmytryshyn
2014-10-07 14:38 ` Jan Beulich
2014-10-09 6:05 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 04/13] cpufreq: use turbo settings only for x86 architecture Oleksandr Dmytryshyn
2014-10-07 14:39 ` Jan Beulich
2014-10-09 6:05 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 05/13] pmstat: make pmstat functions more generalizable Oleksandr Dmytryshyn
2014-10-07 14:40 ` Jan Beulich
2014-10-09 6:06 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 06/13] cpufreq: make cpufreq driver " Oleksandr Dmytryshyn
2014-10-07 14:42 ` Jan Beulich
2014-10-09 6:06 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 07/13] xen/arm: enable cpu hotplug Oleksandr Dmytryshyn
2014-10-07 15:15 ` Julien Grall
2014-10-09 6:07 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 08/13] xen/dts: make the dt_find_property function to be global Oleksandr Dmytryshyn
2014-10-07 15:09 ` Julien Grall
2014-10-09 6:09 ` Oleksandr Dmytryshyn
2014-10-09 11:15 ` Julien Grall
2014-10-09 11:40 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 09/13] arch/arm: create device tree nodes for Dom0 cpufreq cpu driver Oleksandr Dmytryshyn
2014-10-07 15:26 ` Julien Grall [this message]
2014-10-09 6:10 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 10/13] xen: arm: implement platform hypercall Oleksandr Dmytryshyn
2014-10-07 15:39 ` Julien Grall
2014-10-09 6:11 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 11/13] cpufreq: add xen-cpufreq driver Oleksandr Dmytryshyn
2014-10-07 14:44 ` Jan Beulich
2014-10-08 13:51 ` Stefano Stabellini
2014-10-10 9:00 ` Jan Beulich
2014-10-10 9:04 ` Stefano Stabellini
2014-10-10 9:39 ` Jan Beulich
2014-10-10 9:39 ` Stefano Stabellini
2014-10-10 9:46 ` Jan Beulich
2014-10-10 9:54 ` Stefano Stabellini
2014-10-10 9:59 ` Ian Campbell
2014-10-10 12:51 ` Jan Beulich
2014-10-10 14:42 ` Stefano Stabellini
2014-10-13 8:56 ` Oleksandr Dmytryshyn
2014-10-13 9:39 ` Jan Beulich
2014-10-13 11:59 ` Oleksandr Dmytryshyn
2014-10-13 12:28 ` Jan Beulich
2014-10-13 13:38 ` Andrii Tseglytskyi
2014-10-13 14:11 ` Jan Beulich
2014-10-13 14:29 ` Andrii Tseglytskyi
2014-10-14 12:20 ` Jan Beulich
2014-10-14 12:39 ` Andrii Tseglytskyi
2014-10-14 12:51 ` Stefano Stabellini
2014-10-14 12:58 ` Andrii Tseglytskyi
2014-10-14 13:00 ` Andrii Tseglytskyi
2014-10-14 13:05 ` Ian Campbell
2014-10-14 13:07 ` Andrii Tseglytskyi
2014-10-15 10:55 ` Stefano Stabellini
2014-10-15 11:17 ` Andrii Tseglytskyi
2014-10-15 12:34 ` Ian Campbell
2014-10-15 16:26 ` Jan Beulich
2014-10-10 15:19 ` Ian Campbell
2014-10-10 10:40 ` Jan Beulich
2014-10-09 6:13 ` Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 12/13] xen: arm: implement XEN_SYSCTL_cpufreq_op Oleksandr Dmytryshyn
2014-10-07 14:19 ` [RFC PATCH 13/13] xen/arm: enable cpufreq functionality for ARM Oleksandr Dmytryshyn
2014-10-07 14:34 ` [RFC PATCH 00/13] xen_cpufreq implementation in Xen hypervisor Jan Beulich
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=5434063E.1040500@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=oleksandr.dmytryshyn@globallogic.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.