From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>,
Daniel Palmer <daniel@0x0f.com>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: [PULL 1/1] virt: set the CPU type in BOOTINFO
Date: Mon, 11 Mar 2024 18:54:40 +0100 [thread overview]
Message-ID: <20240311175440.305912-2-laurent@vivier.eu> (raw)
In-Reply-To: <20240311175440.305912-1-laurent@vivier.eu>
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>
---
hw/m68k/virt.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c
index e2792ef46d93..b8e5e102e6b9 100644
--- a/hw/m68k/virt.c
+++ b/hw/m68k/virt.c
@@ -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,
--
2.43.2
next prev parent reply other threads:[~2024-03-11 17:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 17:54 [PULL 0/1] M68k for 9.0 patches Laurent Vivier
2024-03-11 17:54 ` Laurent Vivier [this message]
2024-03-12 11:05 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240311175440.305912-2-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=daniel@0x0f.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).