Skip to content

Commit

Permalink
virt: set the CPU type in BOOTINFO
Browse files Browse the repository at this point in the history
BI_CPUTYPE/BI_MMUTYPE/BI_FPUTYPE were statically assigned to the
68040 information.
This patch changes the code to set in bootinfo the information
provided by the command line '-cpu' parameter.

Bug: https://gitlab.com/qemu-project/qemu/-/issues/2091
Reported-by: Daniel Palmer <daniel@0x0f.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-ID: <20240223155742.2790252-1-laurent@vivier.eu>
  • Loading branch information
vivier committed Mar 11, 2024
1 parent 7489f7f commit e39a080
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions hw/m68k/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,20 @@ static void virt_init(MachineState *machine)
param_ptr = param_blob;

BOOTINFO1(param_ptr, BI_MACHTYPE, MACH_VIRT);
BOOTINFO1(param_ptr, BI_FPUTYPE, FPU_68040);
BOOTINFO1(param_ptr, BI_MMUTYPE, MMU_68040);
BOOTINFO1(param_ptr, BI_CPUTYPE, CPU_68040);
if (m68k_feature(&cpu->env, M68K_FEATURE_M68020)) {
BOOTINFO1(param_ptr, BI_CPUTYPE, CPU_68020);
} else if (m68k_feature(&cpu->env, M68K_FEATURE_M68030)) {
BOOTINFO1(param_ptr, BI_MMUTYPE, MMU_68030);
BOOTINFO1(param_ptr, BI_CPUTYPE, CPU_68030);
} else if (m68k_feature(&cpu->env, M68K_FEATURE_M68040)) {
BOOTINFO1(param_ptr, BI_FPUTYPE, FPU_68040);
BOOTINFO1(param_ptr, BI_MMUTYPE, MMU_68040);
BOOTINFO1(param_ptr, BI_CPUTYPE, CPU_68040);
} else if (m68k_feature(&cpu->env, M68K_FEATURE_M68060)) {
BOOTINFO1(param_ptr, BI_FPUTYPE, FPU_68060);
BOOTINFO1(param_ptr, BI_MMUTYPE, MMU_68060);
BOOTINFO1(param_ptr, BI_CPUTYPE, CPU_68060);
}
BOOTINFO2(param_ptr, BI_MEMCHUNK, 0, ram_size);

BOOTINFO1(param_ptr, BI_VIRT_QEMU_VERSION,
Expand Down

0 comments on commit e39a080

Please sign in to comment.