summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlistair Francis2019-04-20 04:23:53 +0200
committerPalmer Dabbelt2019-05-24 21:09:23 +0200
commitceb2ffd56e3ec7caa8afc94b78257bac99cd738b (patch)
tree0e2b5eea477cfc5af3fd0bff6ea56337eaf689aa
parentlinux-user/riscv: Add the CPU type as a comment (diff)
downloadqemu-ceb2ffd56e3ec7caa8afc94b78257bac99cd738b.tar.gz
qemu-ceb2ffd56e3ec7caa8afc94b78257bac99cd738b.tar.xz
qemu-ceb2ffd56e3ec7caa8afc94b78257bac99cd738b.zip
riscv: virt: Allow specifying a CPU via commandline
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
-rw-r--r--hw/riscv/virt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 3526463034..84d94d0c42 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -399,7 +399,7 @@ static void riscv_virt_board_init(MachineState *machine)
/* Initialize SOC */
object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
TYPE_RISCV_HART_ARRAY, &error_abort, NULL);
- object_property_set_str(OBJECT(&s->soc), VIRT_CPU, "cpu-type",
+ object_property_set_str(OBJECT(&s->soc), machine->cpu_type, "cpu-type",
&error_abort);
object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts",
&error_abort);
@@ -525,6 +525,7 @@ static void riscv_virt_board_machine_init(MachineClass *mc)
mc->desc = "RISC-V VirtIO Board (Privileged ISA v1.10)";
mc->init = riscv_virt_board_init;
mc->max_cpus = 8; /* hardcoded limit in BBL */
+ mc->default_cpu_type = VIRT_CPU;
}
DEFINE_MACHINE("virt", riscv_virt_board_machine_init)