From nobody Tue Nov 26 03:57:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1710179714724230.1309235786424; Mon, 11 Mar 2024 10:55:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjrd-0001g2-HT; Mon, 11 Mar 2024 13:55:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjrQ-0001bz-QY for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:54:52 -0400 Received: from mout.kundenserver.de ([217.72.192.73]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjrM-0001GC-L4 for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:54:52 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MdeKd-1rAP2Z3Ah7-00ZeQq; Mon, 11 Mar 2024 18:54:42 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Laurent Vivier , Daniel Palmer , Mark Cave-Ayland Subject: [PULL 1/1] virt: set the CPU type in BOOTINFO Date: Mon, 11 Mar 2024 18:54:40 +0100 Message-ID: <20240311175440.305912-2-laurent@vivier.eu> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240311175440.305912-1-laurent@vivier.eu> References: <20240311175440.305912-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:sIypDfsU2Q1A68rSltQ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gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1710179716947100003 Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Laurent Vivier Reviewed-by: Mark Cave-Ayland 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 =3D param_blob; =20 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); =20 BOOTINFO1(param_ptr, BI_VIRT_QEMU_VERSION, --=20 2.43.2