Patchwork [1/3] target-arm: Setup smpboot code in all setups

login
register
mail settings
Submitter Adam Lackorzynski
Date Feb. 15, 2011, 10:48 a.m.
Message ID <20110215104852.GB19666@os.inf.tu-dresden.de>
Download mbox | patch
Permalink /patch/83231/
State New
Headers show

Comments

Adam Lackorzynski - Feb. 15, 2011, 10:48 a.m.
Make smpboot available not only for Linux but for all setups.

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
---
 hw/arm_boot.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)
Peter Maydell - Feb. 15, 2011, 1:01 p.m.
On 15 February 2011 10:48, Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote:
> Make smpboot available not only for Linux but for all setups.

I'm not convinced about this. I think if you're providing a raw
image for an SMP system (rather than a Linux kernel) then it's
your job to provide an image which handles the bootup of the
secondary CPUs, the same way it would be if you were providing
a ROM image for real hardware.

-- PMM

Patch

diff --git a/hw/arm_boot.c b/hw/arm_boot.c
index 620550b..a68b396 100644
--- a/hw/arm_boot.c
+++ b/hw/arm_boot.c
@@ -268,16 +268,17 @@  void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         }
         rom_add_blob_fixed("bootloader", bootloader, sizeof(bootloader),
                            info->loader_start);
-        if (info->nb_cpus > 1) {
-            smpboot[10] = info->smp_priv_base;
-            for (n = 0; n < sizeof(smpboot) / 4; n++) {
-                smpboot[n] = tswap32(smpboot[n]);
-            }
-            rom_add_blob_fixed("smpboot", smpboot, sizeof(smpboot),
-                               info->smp_loader_start);
-        }
         info->initrd_size = initrd_size;
     }
+
+    if (info->nb_cpus > 1) {
+        smpboot[10] = info->smp_priv_base;
+        for (n = 0; n < sizeof(smpboot) / 4; n++) {
+            smpboot[n] = tswap32(smpboot[n]);
+        }
+        rom_add_blob_fixed("smpboot", smpboot, sizeof(smpboot),
+                           info->smp_loader_start);
+    }
     info->is_linux = is_linux;
     qemu_register_reset(main_cpu_reset, env);
 }