From nobody Sun Jul 26 13:25:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1781644662; cv=none; d=zohomail.com; s=zohoarc; b=QSocxYX7bXRbVcfUOLFm3aCnbTj3FCxdgf3nQAGRCy769vPvpaJRUwsCmt2gr/yVYBHUK5HKCNqSjDMvDC5qWc6ywinXLs/VRrXUn//hirwgACsI5lbkC+WJqFIeLilZTG0tiRKvvZFKnsE9IuVb2UyXxCgcV9gAGoi+rpdXhUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781644662; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iDa0e5001y7tneBy+onsLO4aLvxgvC5Yy1n3xQavxeU=; b=l6SOct5iwL5DjoeTaM33M1ugdL78zm6VchRJTbt6E/ayawMQxdHsY8UQ+sRIcgmr305leNmy6buLh4sh1hmXJSoELB4HHrVGAYJnm+BKg2k/kHPUk+iYlD89DduvrbaUaHLzRaikqhHhqV8k+VYIq5D/rXlM40b3l1zE1zE14kE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1781644662865372.33534630585723; Tue, 16 Jun 2026 14:17:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wZb9f-0004Zw-Ff; Tue, 16 Jun 2026 17:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZb9d-0004Zc-RJ for qemu-devel@nongnu.org; Tue, 16 Jun 2026 17:17:06 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wZb9c-00065N-Ag for qemu-devel@nongnu.org; Tue, 16 Jun 2026 17:17:05 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 28C4943B72; Tue, 16 Jun 2026 21:17:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E58C41F000E9; Tue, 16 Jun 2026 21:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781644622; bh=iDa0e5001y7tneBy+onsLO4aLvxgvC5Yy1n3xQavxeU=; h=From:To:Cc:Subject:Date; b=Q9WlwmOyvUxGkdmzxAWzJI+r1U4mEB/jUupKWbW+mWD8Spl2aJo2DNNGv7NGjdhZl 2ouVsiJOPMkrFVhExxKZ5esFFNRL9uZOO7g20N9nVLkH0eacaTdpXVysFcoVwZVvHW oFo3R6GUOQWfGN/7ba/qsZVO0UZBMTWM9lmCad9qFDi9GHqTLGx0FzgBGIIFbdbNB+ zx92pSWbQg/Mxvl2uuzwzFrqHUEhBYrKBIxo8ImrdV5KEgCoRc4r60ameDalN51rcw W57pPVAZfbhgsFy3QNQfEIswJswU0WC0Mo5oP5HOuPziYPVgYRkdehjnvs6ZJmNmUY oTqgrWlCgHHnQ== From: Helge Deller To: qemu-devel@nongnu.org Cc: Helge Deller , Thomas Huth , Laurent Vivier Subject: [PATCH v2] linux-user: Implement /proc/cpuinfo for m68k CPU Date: Tue, 16 Jun 2026 23:16:44 +0200 Message-ID: <20260616211643.70727-2-deller@kernel.org> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of 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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.445, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: qemu development 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-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1781644664387158500 Content-Type: text/plain; charset="utf-8" From: Helge Deller Mimic the entries for /proc/cpuinfo to what can be seen on the debian porterbox mitchy.debian.org. v2: Add QEMU version Cc: Thomas Huth Cc: Laurent Vivier Signed-off-by: Helge Deller --- linux-user/m68k/target_proc.h | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/linux-user/m68k/target_proc.h b/linux-user/m68k/target_proc.h index 3df8f28e22..dca77d8483 100644 --- a/linux-user/m68k/target_proc.h +++ b/linux-user/m68k/target_proc.h @@ -1,6 +1,8 @@ /* * M68K specific proc functions for linux-user * + * Copyright (c) 2026 Helge Deller + * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef M68K_TARGET_PROC_H @@ -13,4 +15,48 @@ static int open_hardware(CPUArchState *cpu_env, int fd) } #define HAVE_ARCH_PROC_HARDWARE =20 + +static int open_cpuinfo(CPUArchState *cpu_env, int fd) +{ + const char *cpu, *fpu; + struct timespec res; + double freq_mhz; + + if (clock_getres(CLOCK_REALTIME, &res) =3D=3D -1) { + res.tv_nsec =3D 1; + } + freq_mhz =3D 1000.0 / res.tv_nsec; + + if (m68k_feature(cpu_env, M68K_FEATURE_M68010)) { + cpu =3D "68010"; + } else if (m68k_feature(cpu_env, M68K_FEATURE_M68020)) { + cpu =3D "68020"; + } else if (m68k_feature(cpu_env, M68K_FEATURE_M68030)) { + cpu =3D "68030"; + } else if (m68k_feature(cpu_env, M68K_FEATURE_M68040)) { + cpu =3D "68040"; + } else if (m68k_feature(cpu_env, M68K_FEATURE_M68060)) { + cpu =3D "68060"; + } else { + cpu =3D "680x0"; + } + + if (m68k_feature(cpu_env, M68K_FEATURE_FPU)) { + fpu =3D cpu; + } else { + fpu =3D "none(soft float)"; + } + + dprintf(fd, "CPU:\t\t%s\n" + "MMU:\t\t%s\n" + "FPU:\t\t%s\n" + "Clocking:\t%.1fMHz\n" + "Model:\t\tQEMU user v" QEMU_VERSION "\n", + cpu, cpu, fpu, freq_mhz); + /* dropped BogoMips and Calibration for now */ + + return 0; +} +#define HAVE_ARCH_PROC_CPUINFO + #endif /* M68K_TARGET_PROC_H */ --=20 2.54.0