[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 04/29] target-microblaze: Fallback to our lat
From: |
Alistair Francis |
Subject: |
Re: [Qemu-devel] [PATCH v1 04/29] target-microblaze: Fallback to our latest CPU version |
Date: |
Thu, 03 May 2018 20:05:40 +0000 |
On Thu, May 3, 2018 at 2:25 AM Edgar E. Iglesias <address@hidden>
wrote:
> From: "Edgar E. Iglesias" <address@hidden>
> Today, when running QEMU in linux-user or with boards that don't
> select a specific CPU version, we treat it as an invalid version
> and log a message.
> Instead, if no specific version was selected, fallback to our
> latest CPU version.
> Signed-off-by: Edgar E. Iglesias <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> target/microblaze/cpu.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
> diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
> index 4dc1404800..06476f6efc 100644
> --- a/target/microblaze/cpu.c
> +++ b/target/microblaze/cpu.c
> @@ -72,6 +72,9 @@ static const struct {
> {NULL, 0},
> };
> +/* If no specific version gets selected, default to the following. */
> +#define DEFAULT_CPU_VERSION "10.0"
> +
> static void mb_cpu_set_pc(CPUState *cs, vaddr value)
> {
> MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
> @@ -141,6 +144,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error
**errp)
> MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
> CPUMBState *env = &cpu->env;
> uint8_t version_code = 0;
> + const char *version;
> int i = 0;
> Error *local_err = NULL;
> @@ -162,8 +166,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error
**errp)
> | PVR2_FPU_EXC_MASK \
> | 0;
> - for (i = 0; mb_cpu_lookup[i].name && cpu->cfg.version; i++) {
> - if (strcmp(mb_cpu_lookup[i].name, cpu->cfg.version) == 0) {
> + version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION;
> + for (i = 0; mb_cpu_lookup[i].name && version; i++) {
> + if (strcmp(mb_cpu_lookup[i].name, version) == 0) {
> version_code = mb_cpu_lookup[i].version_id;
> break;
> }
> --
> 2.14.1
- [Qemu-devel] [PATCH v1 01/29] target-microblaze: dec_load: Use bool instead of unsigned int, (continued)
- [Qemu-devel] [PATCH v1 01/29] target-microblaze: dec_load: Use bool instead of unsigned int, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 02/29] target-microblaze: dec_store: Use bool instead of unsigned int, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 03/29] target-microblaze: compute_ldst_addr: Use bool instead of int, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 04/29] target-microblaze: Fallback to our latest CPU version, Edgar E. Iglesias, 2018/05/03
- Re: [Qemu-devel] [PATCH v1 04/29] target-microblaze: Fallback to our latest CPU version,
Alistair Francis <=
- [Qemu-devel] [PATCH v1 05/29] target-microblaze: Correct special register array sizes, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 06/29] target-microblaze: Correct the PVR array size, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 09/29] target-microblaze: Conditionalize setting of PVR11_USE_MMU, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 08/29] target-microblaze: Remove USE_MMU PVR checks, Edgar E. Iglesias, 2018/05/03
- [Qemu-devel] [PATCH v1 10/29] target-microblaze: Bypass MMU with MMU_NOMMU_IDX, Edgar E. Iglesias, 2018/05/03