From nobody Tue Feb 10 11:56:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) client-ip=209.85.128.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602350808; cv=none; d=zohomail.com; s=zohoarc; b=KWNpFhAcvytJt9MoCb9H4ZyLhcnQ36SGDVZzFuoqCEZZnkGlzX41Tm2Om6WWkv3RpnvXuRLemr8lkS/GmzBhZhZe6TZzcehpwlKyRMqlX6lwEQx6bQcxGJ+KEjFgk+cDZ7cIjiKxqKsbn41QGHXxtOP9nIlh927L/2mcjN4UUZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602350808; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AzmFEGnohCvn1W440dVAMj47SxdqWOdTt0i8s2oVyM8=; b=HsdRt0kBRaWGiYmf+b2oxY8hR6lxOJB76AQkeoXdJmNG/1ri1+5jucFHqXS/Cx2JYUk63n3ep8CRa8FEEw9OzSsxvCEbaB9LBR/cfih9N+m9Kh4z0PLjFkgzRuaf+nX1mA4PjA176d2z4mOWgFsEKk4sOWBbozOi7B8CmdtZbxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.zohomail.com with SMTPS id 16023508083101009.0253844053525; Sat, 10 Oct 2020 10:26:48 -0700 (PDT) Received: by mail-wm1-f65.google.com with SMTP id q5so12849090wmq.0 for ; Sat, 10 Oct 2020 10:26:47 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id i11sm16786068wre.32.2020.10.10.10.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Oct 2020 10:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AzmFEGnohCvn1W440dVAMj47SxdqWOdTt0i8s2oVyM8=; b=OspX0yPr7Xj5RvIU/nGUysSoWyPtK1GUzJz4KC82XCDc2iJD5UIUk1FPJBAb5Rv8sT LI0kbu1/foPAmnlp+yb0Kn+ifFzoMdX5h/pVB7eIr/E64AsVSo578Yc6RT1fAkkvk1BU 2uPKRmP8mxtjMiWuCWlDc8gpkfWuuSjHWhIs24scFJsDPMN851j5wC+ji6HPvuM7KxNA dDCpRA+JFk4UQdJe5MSbanfQ7VyDhGNxT+KTaWcu5Jo33k9+CwLkKW8UYM/ha2EDSZGz GJaHJlYgbpWuSmLeV8FCZMQW7/p3rT+o1y2ntxqq9cgIr+Kk0FZ1ze/3YeE4QNRIErHQ SoNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AzmFEGnohCvn1W440dVAMj47SxdqWOdTt0i8s2oVyM8=; b=iVyrMRCyPnCMAb43F4jm+mmPWTpc3EtlmDsi4012bytTudkKUSYagBfLFTfgHrfbhq rLfcinJRBlkp87cI9T9tx7pQDbqqWvnwazIAI1ZJAhm/7fcHMIqrKLVINUao/xJkRNxr sDUSifKljvelbNVCARQECaR/GRmO1bTSIPh7R3TPe1YnQ7+TGqxvWBpBz++yVYebJ7M8 DWmOIyYj899FvyxjZrjLBQ30E4mIw8hgniXstTFtVSIdU3UdiuHC0Jg2YVZd/WfaLxuB VI47TmokkIaT1ZqSYE8rbsNWSJtaXMHvN8fsYnlUfeg9kcT3/uigN1uos2AZuc099jET 2YAQ== X-Gm-Message-State: AOAM533FLUo6fAaPIcOq6EaYwybxr4aNw0XQSiyDfwfcFZSRYsmHrJXX 7v8YStlkTAAEaiuwMdJuGKg= X-Google-Smtp-Source: ABdhPJyXHdUBLGljPFHqIC/kRszrJeCdF+H9u3tgZs/XSnnZUlLzDSuDyB5WB1l/Q+h/lnyDuNVONA== X-Received: by 2002:a1c:63c3:: with SMTP id x186mr3652008wmb.66.1602350806437; Sat, 10 Oct 2020 10:26:46 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Damien Hedde , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Huacai Chen , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Paolo Bonzini , Aurelien Jarno , Huacai Chen , Aleksandar Rikalo , Paul Burton , Jiaxun Yang , Luc Michel Subject: [PATCH v2 20/20] target/mips/cpu: Display warning when CPU is used without input clock Date: Sat, 10 Oct 2020 19:26:17 +0200 Message-Id: <20201010172617.3079633-21-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201010172617.3079633-1-f4bug@amsat.org> References: <20201010172617.3079633-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) All our QOM users provides an input clock. In order to avoid avoid future machines added without clock, display a warning. User-mode emulation use the CP0 timer with the RDHWR instruction (see commit cdfcad788394) so keep using the fixed 200 MHz clock without diplaying any warning. Only display it in system-mode emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 3deb0245e7c..0c801a3a075 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -19,12 +19,14 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/cutils.h" #include "qapi/error.h" #include "cpu.h" #include "internal.h" #include "kvm_mips.h" #include "qemu/module.h" #include "sysemu/kvm.h" +#include "sysemu/qtest.h" #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" @@ -157,6 +159,12 @@ static void mips_cpu_realizefn(DeviceState *dev, Error= **errp) Error *local_err =3D NULL; =20 if (!clock_get(cpu->clock)) { +#ifndef CONFIG_USER_ONLY + g_autofree char *cpu_freq_str =3D freq_to_str(CPU_FREQ_HZ_DEFAULT); + + warn_report("CPU input clock is not connected to any output clock,= " + "using default frequency of %s.", cpu_freq_str); +#endif /* Initialize the frequency in case the clock remains unconnected.= */ clock_set_hz(cpu->clock, CPU_FREQ_HZ_DEFAULT); } --=20 2.26.2