From nobody Thu Nov 28 10:40:21 2024 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1694153438; cv=none; d=zohomail.com; s=zohoarc; b=R8j1gnYatVd5EooyAIaXxZ2mBExmm5WO1T0vRUA8F05qjcro/XzD/8Oyq8B8W22gVNAlsrec1BN7M/iATCFZ4wc35xX1D45aBIQKwVkK1Ujc+M+CbDbtV7np2YIHA0T2vj2AK9yq5CLC+5QxqBFh+Js54JjfJ2zaA94yM2JT0yM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694153438; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5NG6CVxF4Al3MmcBIBAkea24sVDiq9pdJ5O7crK3UWw=; b=I8Ds0GjQ6WYT3F6juDiGm2D7OwjI9PNynwSVcahMD5b1pYWU8tejOmT2zu/XZ3qE9NCVLYXsCeikWjytzHnyLKFZ30kxbtVHUvuBNu6AJvdS0zyJBnnn/27z6/8AWNH4yHkFh9mQgGjEj8ih2RhuiUiIWX0nNQmHdwYuhNjF0rk= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169415343872484.68170109477092; Thu, 7 Sep 2023 23:10:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeUfW-0005e2-HO; Fri, 08 Sep 2023 02:08:38 -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 1qeUfT-0005Dr-W0 for qemu-devel@nongnu.org; Fri, 08 Sep 2023 02:08:36 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeUfR-0008EA-9c for qemu-devel@nongnu.org; Fri, 08 Sep 2023 02:08:35 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bee82fad0fso14677295ad.2 for ; Thu, 07 Sep 2023 23:08:32 -0700 (PDT) Received: from toolbox.alistair23.me (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id q1-20020a170902dac100b001c3267ae31bsm715231plx.301.2023.09.07.23.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 23:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694153311; x=1694758111; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5NG6CVxF4Al3MmcBIBAkea24sVDiq9pdJ5O7crK3UWw=; b=H9zCxuTsK/umjtVJ9fqI39c3ZLZqbsecECKGnMZ45GKKs27mAR/dGQHm6OAdaS3gsJ /9Svmf6SrnGHw7L3cpxibX4otOxTvvnMyyDpDah5Dk96UMVggCOzJPrAQqzeVIal+5Xv VhWDKFEk0NwBPHrHpwW6OiPmyzxwUT/SeNrpZUG9oWeCl5na76QcuMlwidOljmpGlvSl wqF/nuLxnbD0SIB+AgyJufunJw6txeMLOY6v86hl80wfBYQHKGdSVAZl61oEdXdtJDeM juxV/s7CPfL4Pb6DJzONBQ5LWc8FH/2UvNG2KSu8lUOy3YPR+29jND/l+opu8I8NdXu+ DJ4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694153311; x=1694758111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5NG6CVxF4Al3MmcBIBAkea24sVDiq9pdJ5O7crK3UWw=; b=mVI31K1nfXz/+V79lYdnKm+NQ96YVvaRLvtqGu5yGi8pajdS2TdOPu6HUpLZiEqYt1 Avgm8TjKEcZyJY8gXNJBUNLBavbROx2pj+pxUkHpPoBTyIvZ8wXoBPUlMKkzZVh8mSXo vm+mNPBjMM/tmsq/Hwb2MaX/SaigTPcRoDI0EkKwQxGWRnsjS0LwFBxgfvrD+t2+ldAI 2zMaLwmmq3HZFUXI/LDlTqnwn7Cs69bnF68Y81zF3PiPGJIf4IQN05TUW1GOfK4V111e C+Lq0u5MRQEaEP72bjvlZoAl6I4SBxC/7GgKOTyPHhHLFqIbVel4qG/xZDaHjZX1N14e VJtQ== X-Gm-Message-State: AOJu0YycRKWNmPVO449kH8RXiWUQBjLwg7PCS/jhdcifcJWWzvhRCWEc vzkZTpRDXC4+Qth/JXa0HRFgOvTFoeJzH9JR X-Google-Smtp-Source: AGHT+IFUxgTpQQjkFGsQAoLwr0fOp6j/JtmXfgrvaYvu/KeOj3UIJMOY90bEfKN1ge2ib5Lq4d7IHA== X-Received: by 2002:a17:902:d505:b0:1b8:525a:f685 with SMTP id b5-20020a170902d50500b001b8525af685mr1831584plg.37.1694153311301; Thu, 07 Sep 2023 23:08:31 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Daniel Henrique Barboza , Alistair Francis , Andrew Jones , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 57/65] target/riscv: deprecate the 'any' CPU type Date: Fri, 8 Sep 2023 16:04:23 +1000 Message-ID: <20230908060431.1903919-58-alistair.francis@wdc.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230908060431.1903919-1-alistair.francis@wdc.com> References: <20230908060431.1903919-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=alistair23@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: 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 @gmail.com) X-ZM-MESSAGEID: 1694153439983100005 From: Daniel Henrique Barboza The 'any' CPU type was introduced in commit dc5bd18fa5725 ("RISC-V CPU Core Definition"), being around since the beginning. It's not an easy CPU to use: it's undocumented and its name doesn't tell users much about what the CPU is supposed to bring. 'git log' doesn't help us either in knowing what was the original design of this CPU type. The closest we have is a comment from Alistair [1] where he recalls from memory that the 'any' CPU is supposed to behave like the newly added 'max' CPU. He also suggested that the 'any' CPU should be removed. The default CPUs are rv32 and rv64, so removing the 'any' CPU will have impact only on users that might have a script that uses '-cpu any'. And those users are better off using the default CPUs or the new 'max' CPU. We would love to just remove the code and be done with it, but one does not simply remove a feature in QEMU. We'll put the CPU in quarantine first, letting users know that we have the intent of removing it in the future. [1] https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02891.html Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Reviewed-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230901194627.1214811-13-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis --- docs/about/deprecated.rst | 12 ++++++++++++ target/riscv/cpu.c | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index dc4da95329..694b878f36 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -365,6 +365,18 @@ QEMU's ``vhost`` feature, which would eliminate the hi= gh latency costs under which the 9p ``proxy`` backend currently suffers. However as of to date no= body has indicated plans for such kind of reimplementation unfortunately. =20 +RISC-V 'any' CPU type ``-cpu any`` (since 8.2) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The 'any' CPU type was introduced back in 2018 and has been around since t= he +initial RISC-V QEMU port. Its usage has always been unclear: users don't k= now +what to expect from a CPU called 'any', and in fact the CPU does not do an= ything +special that isn't already done by the default CPUs rv32/rv64. + +After the introduction of the 'max' CPU type, RISC-V now has a good covera= ge +of generic CPUs: rv32 and rv64 as default CPUs and 'max' as a feature comp= lete +CPU for both 32 and 64 bit builds. Users are then discouraged to use the '= any' +CPU type starting in 8.2. =20 Block device options '''''''''''''''''''' diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 365c2b3b56..0dae259e02 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1522,6 +1522,11 @@ static void riscv_cpu_realize(DeviceState *dev, Erro= r **errp) RISCVCPUClass *mcc =3D RISCV_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 + if (object_dynamic_cast(OBJECT(dev), TYPE_RISCV_CPU_ANY) !=3D NULL) { + warn_report("The 'any' CPU is deprecated and will be " + "removed in the future."); + } + cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { error_propagate(errp, local_err); --=20 2.41.0