* [PATCH 0 of 3] Fixes for PowerPC Qemu KVM
@ 2008-04-28 21:23 Jerone Young
2008-04-28 21:23 ` [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory Jerone Young
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Jerone Young @ 2008-04-28 21:23 UTC (permalink / raw)
To: kvm-devel; +Cc: kvm-ppc-devel
This set of patches contain fixes for bamboo board model, as well as provides more functionality for device tree manipulation.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
3 files changed, 22 insertions(+), 1 deletion(-)
qemu/hw/device_tree.c | 16 ++++++++++++++++
qemu/hw/device_tree.h | 2 ++
qemu/hw/ppc440_bamboo.c | 5 ++++-
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory 2008-04-28 21:23 [PATCH 0 of 3] Fixes for PowerPC Qemu KVM Jerone Young @ 2008-04-28 21:23 ` Jerone Young 2008-04-30 20:21 ` Avi Kivity 2008-04-28 21:23 ` [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c Jerone Young 2008-04-28 21:23 ` [PATCH 3 of 3] Fix memory defined in device tree by declaring it dynamically for bamboo board model Jerone Young 2 siblings, 1 reply; 7+ messages in thread From: Jerone Young @ 2008-04-28 21:23 UTC (permalink / raw) To: kvm-devel; +Cc: kvm-ppc-devel 1 file changed, 1 deletion(-) qemu/hw/ppc440_bamboo.c | 1 - In 2.6.26 wait is now enabled by default. With this the /hypervisor node will not be need to be idetified to enable the guest to go into wait state while idle. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c --- a/qemu/hw/ppc440_bamboo.c +++ b/qemu/hw/ppc440_bamboo.c @@ -163,7 +163,6 @@ void bamboo_init(ram_addr_t ram_size, in dt_cell(fdt, "/chosen", "linux,initrd-end", (initrd_base + initrd_size)); dt_string(fdt, "/chosen", "bootargs", (char *)kernel_cmdline); - dt_node(fdt, "/", "hypervisor"); #endif if (kvm_enabled()) { ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory 2008-04-28 21:23 ` [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory Jerone Young @ 2008-04-30 20:21 ` Avi Kivity 0 siblings, 0 replies; 7+ messages in thread From: Avi Kivity @ 2008-04-30 20:21 UTC (permalink / raw) To: Jerone Young; +Cc: kvm-devel, kvm-ppc-devel Jerone Young wrote: > 1 file changed, 1 deletion(-) > qemu/hw/ppc440_bamboo.c | 1 - > > > In 2.6.26 wait is now enabled by default. With this the /hypervisor node will not be need to be idetified to enable the guest to go into wait state while idle. > > Signed-off-by: Jerone Young <jyoung5@us.ibm.com> > > diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c > --- a/qemu/hw/ppc440_bamboo.c > +++ b/qemu/hw/ppc440_bamboo.c > @@ -163,7 +163,6 @@ void bamboo_init(ram_addr_t ram_size, in > dt_cell(fdt, "/chosen", "linux,initrd-end", > (initrd_base + initrd_size)); > dt_string(fdt, "/chosen", "bootargs", (char *)kernel_cmdline); > - dt_node(fdt, "/", "hypervisor"); > #endif > > if (kvm_enabled()) { > I don't have this bit in my tree. -- Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c 2008-04-28 21:23 [PATCH 0 of 3] Fixes for PowerPC Qemu KVM Jerone Young 2008-04-28 21:23 ` [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory Jerone Young @ 2008-04-28 21:23 ` Jerone Young 2008-04-29 15:06 ` [kvm-ppc-devel] " Hollis Blanchard 2008-04-28 21:23 ` [PATCH 3 of 3] Fix memory defined in device tree by declaring it dynamically for bamboo board model Jerone Young 2 siblings, 1 reply; 7+ messages in thread From: Jerone Young @ 2008-04-28 21:23 UTC (permalink / raw) To: kvm-devel; +Cc: kvm-ppc-devel 2 files changed, 18 insertions(+) qemu/hw/device_tree.c | 16 ++++++++++++++++ qemu/hw/device_tree.h | 2 ++ This patch adds function dt_cell_multi to allow for manipulation of device tree properties that contain mulitiple 32bit values. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> diff --git a/qemu/hw/device_tree.c b/qemu/hw/device_tree.c --- a/qemu/hw/device_tree.c +++ b/qemu/hw/device_tree.c @@ -162,6 +162,22 @@ void dt_cell(void *fdt, char *node_path, } } +/* This function is to manipulate a cell with multiple values */ +void dt_cell_multi(void *fdt, char *node_path, char *property, + uint32_t *val_array, int size) +{ + + int offset; + int ret; + offset = get_offset_of_node(fdt, node_path); + ret = fdt_setprop(fdt, offset, property, val_array, size); + if (ret < 0) { + printf("Unable to set device tree property '%s'\n", + property); + exit(1); + } +} + void dt_string(void *fdt, char *node_path, char *property, char *string) { diff --git a/qemu/hw/device_tree.h b/qemu/hw/device_tree.h --- a/qemu/hw/device_tree.h +++ b/qemu/hw/device_tree.h @@ -19,6 +19,8 @@ void dump_device_tree_to_file(void *fdt, void dump_device_tree_to_file(void *fdt, char *filename); void dt_cell(void *fdt, char *node_path, char *property, uint32_t val); +void dt_cell_multi(void *fdt, char *node_path, char *property, + uint32_t *val_array, int size); void dt_string(void *fdt, char *node_path, char *property, char *string); void dt_node(void *fdt, char *node_parent_path, char *name); ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kvm-ppc-devel] [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c 2008-04-28 21:23 ` [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c Jerone Young @ 2008-04-29 15:06 ` Hollis Blanchard 2008-04-29 16:36 ` Jerone Young 0 siblings, 1 reply; 7+ messages in thread From: Hollis Blanchard @ 2008-04-29 15:06 UTC (permalink / raw) To: Jerone Young; +Cc: kvm-ppc-devel, kvm-devel On Monday 28 April 2008 16:23:04 Jerone Young wrote: > +/* This function is to manipulate a cell with multiple values */ > +void dt_cell_multi(void *fdt, char *node_path, char *property, > + uint32_t *val_array, int size) > +{ > + > + int offset; > + int ret; Could you please be more careful with your whitespace? -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [kvm-ppc-devel] [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c 2008-04-29 15:06 ` [kvm-ppc-devel] " Hollis Blanchard @ 2008-04-29 16:36 ` Jerone Young 0 siblings, 0 replies; 7+ messages in thread From: Jerone Young @ 2008-04-29 16:36 UTC (permalink / raw) To: Hollis Blanchard; +Cc: kvm-ppc-devel, kvm-devel [-- Attachment #1: Type: text/plain, Size: 680 bytes --] On Tue, 2008-04-29 at 10:06 -0500, Hollis Blanchard wrote: > On Monday 28 April 2008 16:23:04 Jerone Young wrote: > > +/* This function is to manipulate a cell with multiple values */ > > +void dt_cell_multi(void *fdt, char *node_path, char *property, > > + uint32_t *val_array, int size) > > +{ > > + > > + int offset; > > + int ret; > > Could you please be more careful with your whitespace? Hmmm..I'm looking at the patch on my local machine and it doesn't have any whitespace damage. If there is whitespace damage it was caused by something else (like hg email is doing something). I've attached the orginal patch to this email. > [-- Attachment #2: add_cell_multi --] [-- Type: text/plain, Size: 1453 bytes --] Add function dt_cell_multi to hw/device_tree.c This patch adds function dt_cell_multi to allow for manipulation of device tree properties that contain mulitiple 32bit values. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> diff --git a/qemu/hw/device_tree.c b/qemu/hw/device_tree.c --- a/qemu/hw/device_tree.c +++ b/qemu/hw/device_tree.c @@ -162,6 +162,22 @@ void dt_cell(void *fdt, char *node_path, } } +/* This function is to manipulate a cell with multiple values */ +void dt_cell_multi(void *fdt, char *node_path, char *property, + uint32_t *val_array, int size) +{ + + int offset; + int ret; + offset = get_offset_of_node(fdt, node_path); + ret = fdt_setprop(fdt, offset, property, val_array, size); + if (ret < 0) { + printf("Unable to set device tree property '%s'\n", + property); + exit(1); + } +} + void dt_string(void *fdt, char *node_path, char *property, char *string) { diff --git a/qemu/hw/device_tree.h b/qemu/hw/device_tree.h --- a/qemu/hw/device_tree.h +++ b/qemu/hw/device_tree.h @@ -19,6 +19,8 @@ void dump_device_tree_to_file(void *fdt, void dump_device_tree_to_file(void *fdt, char *filename); void dt_cell(void *fdt, char *node_path, char *property, uint32_t val); +void dt_cell_multi(void *fdt, char *node_path, char *property, + uint32_t *val_array, int size); void dt_string(void *fdt, char *node_path, char *property, char *string); void dt_node(void *fdt, char *node_parent_path, char *name); [-- Attachment #3: Type: text/plain, Size: 320 bytes --] ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone [-- Attachment #4: Type: text/plain, Size: 158 bytes --] _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3 of 3] Fix memory defined in device tree by declaring it dynamically for bamboo board model 2008-04-28 21:23 [PATCH 0 of 3] Fixes for PowerPC Qemu KVM Jerone Young 2008-04-28 21:23 ` [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory Jerone Young 2008-04-28 21:23 ` [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c Jerone Young @ 2008-04-28 21:23 ` Jerone Young 2 siblings, 0 replies; 7+ messages in thread From: Jerone Young @ 2008-04-28 21:23 UTC (permalink / raw) To: kvm-devel; +Cc: kvm-ppc-devel 1 file changed, 4 insertions(+) qemu/hw/ppc440_bamboo.c | 4 ++++ This fixes a issue where the amount of memory is not properly being defined in the device tree. It currently is hardcoded for 144MB. The result is that if you specify a memory size below the hardcoded size, the guest crashes. This patch now dynamically changes the device tree to the memory value specified. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c --- a/qemu/hw/ppc440_bamboo.c +++ b/qemu/hw/ppc440_bamboo.c @@ -50,6 +50,7 @@ void bamboo_init(ram_addr_t ram_size, in int i=0, k=0; uint32_t cpu_freq; uint32_t timebase_freq; + uint32_t mem_reg_property[]={0, 0, ram_size}; printf("%s: START\n", __func__); @@ -73,6 +74,7 @@ void bamboo_init(ram_addr_t ram_size, in printf("WARNING: %i MB left over memory is ram\n", bytes_to_mb((int)tmp_ram_size)); ram_size -= tmp_ram_size; + mem_reg_property[2] = ram_size; } /* Setup CPU */ @@ -159,6 +161,8 @@ void bamboo_init(ram_addr_t ram_size, in /* manipulate device tree in memory */ dt_cell(fdt, "/cpus/cpu@0", "clock-frequency", cpu_freq); dt_cell(fdt, "/cpus/cpu@0", "timebase-frequency", timebase_freq); + dt_cell_multi(fdt, "/memory", "reg", mem_reg_property, + sizeof(mem_reg_property)); dt_cell(fdt, "/chosen", "linux,initrd-start", initrd_base); dt_cell(fdt, "/chosen", "linux,initrd-end", (initrd_base + initrd_size)); ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-04-30 20:21 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-04-28 21:23 [PATCH 0 of 3] Fixes for PowerPC Qemu KVM Jerone Young 2008-04-28 21:23 ` [PATCH 1 of 3] Remove dynamic allocation of /hypervisor node from device tree in memory Jerone Young 2008-04-30 20:21 ` Avi Kivity 2008-04-28 21:23 ` [PATCH 2 of 3] Add function dt_cell_multi to hw/device_tree.c Jerone Young 2008-04-29 15:06 ` [kvm-ppc-devel] " Hollis Blanchard 2008-04-29 16:36 ` Jerone Young 2008-04-28 21:23 ` [PATCH 3 of 3] Fix memory defined in device tree by declaring it dynamically for bamboo board model Jerone Young
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox