]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/xtensa: xtfpga: fix bootloader placement in SMP
authorMax Filippov <jcmvbkbc@gmail.com>
Mon, 21 Jan 2019 00:26:07 +0000 (16:26 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 24 Jan 2019 18:44:25 +0000 (10:44 -0800)
Use BSP reset PC as a place for the mini-bootloader because in SMP
configurations APs and BSP may have different boot addresses.
This fixes SMP linux uImage boot on xtfpga boards.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
hw/xtensa/xtfpga.c

index 21094319a659f3767dd0925a3bc1f78a3841eb81..d3afdfc247a76d87b37e3829d6ff5c59b5d81bf5 100644 (file)
@@ -234,10 +234,15 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
     int n;
 
     for (n = 0; n < smp_cpus; n++) {
+        CPUXtensaState *cenv = NULL;
+
         cpu = XTENSA_CPU(cpu_create(machine->cpu_type));
-        env = &cpu->env;
+        cenv = &cpu->env;
+        if (!env) {
+            env = cenv;
+        }
 
-        env->sregs[PRID] = n;
+        cenv->sregs[PRID] = n;
         qemu_register_reset(xtfpga_reset, cpu);
         /* Need MMU initialized prior to ELF loading,
          * so that ELF gets loaded into virtual addresses