From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
"Tim (Xen.org)" <tim@xen.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 4/4] xen: arm: create dom0 DTB /hypervisor/ node dynamically.
Date: Tue, 5 Feb 2013 11:26:51 +0000 [thread overview]
Message-ID: <5110EC7B.1060804@citrix.com> (raw)
In-Reply-To: <1359555990-12186-4-git-send-email-ian.campbell@citrix.com>
On 30/01/13 14:26, Ian Campbell wrote:
> I initially added hypervisor-new and confirmed via /proc/device-model
> that the content is the same before changing it to drop and replace
> an existing node.
>
> NB: There is an ambiguity in the compatibility property.
> linux/arch/arm/boot/dts/xenvm-4.2.dts says "xen,xen-4.2" while
> Documentation/devicetree/bindings/arm/xen.txt says "xen,xen-4.3". I
> don't know which is correct but I've erred on the side of the DTS.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> xen/arch/arm/domain_build.c | 53 +++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 51 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index bb10096..d3ef180 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -34,7 +34,7 @@ custom_param("dom0_mem", parse_dom0_mem);
> * are added (yet) but one terminating reserve map entry (16 bytes) is
> * added.
> */
> -#define DOM0_FDT_EXTRA_SIZE (sizeof(struct fdt_reserve_entry))
> +#define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry))
>
> struct vcpu *__init alloc_dom0_vcpu0(void)
> {
> @@ -186,6 +186,13 @@ static int fdt_next_dom0_node(const void *fdt, int node,
> if ( depth >= DEVICE_TREE_MAX_DEPTH )
> break;
>
> + /* Skip /hypervisor/ node. We will inject our own. */
> + if ( fdt_node_check_compatible(fdt, node, "xen,xen" ) == 0 )
> + {
> + printk("Device-tree contains \"xen,xen\" node. Ignoring.\n");
> + continue;
> + }
> +
> /* Skip multiboot subnodes */
> if ( fdt_node_check_compatible(fdt, node,
> "xen,multiboot-module" ) == 0 )
> @@ -199,6 +206,45 @@ static int fdt_next_dom0_node(const void *fdt, int node,
> return node;
> }
>
> +static void make_hypervisor_node(void *fdt, int addrcells, int sizecells)
> +{
> + const char compat[] = "xen,xen-4.2\0xen,xen";
> + u32 reg[4];
> + u32 intr[3];
> + u32 *cell;
> +
> + /*
> + * Sanity-check address sizes, since addresses and sizes which do not take
> + * up exactly 4 or 8 bytes are not supported.
> + */
> + if ((addrcells != 1 && addrcells != 2) ||
> + (sizecells != 1 && sizecells != 2))
> + panic("Cannot cope with this size");
You could add those two properties in the hypervisor node if they don't
match what we expect them to be. This would avoid panicking with a
device tree that have different default values.
--
Anthony PERARD
next prev parent reply other threads:[~2013-02-05 11:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 14:26 [PATCH 0/4 V6] xen: arm: parse modules from DT during early boot Ian Campbell
2013-01-30 14:26 ` [PATCH 1/4] dtb: correct handling of #address-cells and #size-cells Ian Campbell
2013-02-15 12:43 ` Stefano Stabellini
2013-02-15 13:18 ` Ian Campbell
2013-02-15 17:04 ` Ian Campbell
2013-02-18 13:11 ` Stefano Stabellini
2013-02-18 13:25 ` Ian Campbell
2013-02-18 11:22 ` Ian Campbell
2013-01-30 14:26 ` [PATCH 2/4] xen: arm: parse modules from DT during early boot Ian Campbell
2013-02-15 12:55 ` Stefano Stabellini
2013-01-30 14:26 ` [PATCH 3/4] xen: strip xen, multiboot-module nodes from dom0 device tree Ian Campbell
2013-02-15 12:53 ` Stefano Stabellini
2013-01-30 14:26 ` [PATCH 4/4] xen: arm: create dom0 DTB /hypervisor/ node dynamically Ian Campbell
2013-02-05 11:26 ` Anthony PERARD [this message]
2013-02-05 11:30 ` Ian Campbell
2013-02-18 14:04 ` Ian Campbell
2013-02-15 12:52 ` Stefano Stabellini
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=5110EC7B.1060804@citrix.com \
--to=anthony.perard@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=ian.campbell@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 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).