From nobody Thu Oct 30 15:21:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525801032894955.9189370183368; Tue, 8 May 2018 10:37:12 -0700 (PDT) Received: from localhost ([::1]:52577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG6Y4-0003QX-2g for importer@patchew.org; Tue, 08 May 2018 13:37:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG6T5-00084A-C9 for qemu-devel@nongnu.org; Tue, 08 May 2018 13:32:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG6T4-0005HS-J2 for qemu-devel@nongnu.org; Tue, 08 May 2018 13:32:03 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:44876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fG6T4-0005H0-B3 for qemu-devel@nongnu.org; Tue, 08 May 2018 13:32:02 -0400 Received: by mail-lf0-x244.google.com with SMTP id h197-v6so47004403lfg.11 for ; Tue, 08 May 2018 10:32:02 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id y132-v6sm5386556lfc.56.2018.05.08.10.31.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 May 2018 10:31:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qYAZaF+5C1T/BAubKp0rEdGatli7l5tJiNqFkqUH0e8=; b=eAUEK1EjQxqoToInyCk6VoRftEJCiLS9fKkgPkcVHp6YQw46+Wx8ItYYPpBGBNT/o2 8Y9ZC1d/tbGQNh2CvFZ84uyxguIKuwfPc3HGQFXY0CqMYa/7yWLY5vQrcQ9gabmwiTk5 iNe0FxHeng7UhDp0E0zon58pt5H5kZCkiSSv1Emxzsx3CQdEDDzrBX40aE8+sVDSsj07 z1h3aXK4z3gDyjSYx+4PNm53mXGvDfVn21neULXLvCquP7e2Yr6Rr7XeyuwY/w5Mbp4V RlJES+2DaDhfXmpOYDztol1QXvVtTTmTqLpLN/5q5e0xSgOxEBfRiIdEPuS0YvoM7zAl tfWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qYAZaF+5C1T/BAubKp0rEdGatli7l5tJiNqFkqUH0e8=; b=FST6TShVIMd156fCLhGSKf7fXUb0VS/Bk5yB7ULCHjuM1ujmEF50kfQi3rLI9v0Lop k+Mu5UAyRrki/TskCKL2dqlqhq6itH+uEjGjpvEiiQsQ3ZLXs6Aq1bU8OMBRk7Bc3sjr YSeuS+Iru9VwhHc0yJmk7JV6HEXk3sH4iTG5ahMfrMgm4DJuDvvx/20EN1NWE8pfYg5E zp044HuKVPLu2/q4RHMHx3XWrwaQXuJ4AeL75UBk7l+JkQN+ynf3gFhaodJZb4iUgQ6M w18Dek/78NExX7PyNzxTLAxtAqIS9NOFcfGW8tUQYJ5G7+j5bK37pZ0x9jetA7rEdjbM HWhw== X-Gm-Message-State: ALQs6tDFjI+SDNeCrwcqoPVYSN8WdSnHf/4ZSpjwL/fBcsQzt/ezgqOH 1v5tMequMo2+RA5hJscN0DA3OQ== X-Google-Smtp-Source: AB8JxZpHTzG6ZLEze23eGWO8VyntGP4vYdGxd5OXQy2y1LmvJ3+pfHmnRntOkuzuvauxu+Yv7XSESg== X-Received: by 2002:a2e:95d6:: with SMTP id y22-v6mr8570212ljh.90.1525800720796; Tue, 08 May 2018 10:32:00 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 19:31:20 +0200 Message-Id: <20180508173152.29327-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180508173152.29327-1-edgar.iglesias@gmail.com> References: <20180508173152.29327-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PATCH v2 04/36] target-microblaze: Fallback to our latest CPU version X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Today, when running QEMU in linux-user or with boards that don't select a specific CPU version, we treat it as an invalid version and log a message. Instead, if no specific version was selected, fallback to our latest CPU version. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 4dc1404800..06476f6efc 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -72,6 +72,9 @@ static const struct { {NULL, 0}, }; =20 +/* If no specific version gets selected, default to the following. */ +#define DEFAULT_CPU_VERSION "10.0" + static void mb_cpu_set_pc(CPUState *cs, vaddr value) { MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); @@ -141,6 +144,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **= errp) MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(cs); CPUMBState *env =3D &cpu->env; uint8_t version_code =3D 0; + const char *version; int i =3D 0; Error *local_err =3D NULL; =20 @@ -162,8 +166,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **= errp) | PVR2_FPU_EXC_MASK \ | 0; =20 - for (i =3D 0; mb_cpu_lookup[i].name && cpu->cfg.version; i++) { - if (strcmp(mb_cpu_lookup[i].name, cpu->cfg.version) =3D=3D 0) { + version =3D cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION; + for (i =3D 0; mb_cpu_lookup[i].name && version; i++) { + if (strcmp(mb_cpu_lookup[i].name, version) =3D=3D 0) { version_code =3D mb_cpu_lookup[i].version_id; break; } --=20 2.14.1