From nobody Sat Nov 1 07:48:33 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 1526497047410415.8708839404385; Wed, 16 May 2018 11:57:27 -0700 (PDT) Received: from localhost ([::1]:34164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ1c6-00076I-Kf for importer@patchew.org; Wed, 16 May 2018 14:57:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ1Wn-0002tS-Hw for qemu-devel@nongnu.org; Wed, 16 May 2018 14:51:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ1Wm-0000h1-Fy for qemu-devel@nongnu.org; Wed, 16 May 2018 14:51:57 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:38488) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJ1Wm-0000gh-8v for qemu-devel@nongnu.org; Wed, 16 May 2018 14:51:56 -0400 Received: by mail-wm0-x241.google.com with SMTP id m129-v6so4229025wmb.3 for ; Wed, 16 May 2018 11:51:56 -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 x3-v6sm771515lfd.78.2018.05.16.11.51.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 11:51:53 -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=ljLm/P3KXtuotVcxYZkIC8rBjSbjNpabxPrdP4U0L6qajlo0+J9bOdSoPwtA/n6WIH it+1ocSbh0yeQsvSlh3gkfVQUHHBCmGgjdH6wdJIVe03qCbbFTglpOBE+XNhrsmQPLSJ aOQCA2KOd0SrYOU1H4PVWcjIIQurYqtHNb1D5miXb0t8YQV8AvlCd1nYEgcBUihGE473 Cqn/ymVxTlbJU0XwkV1csqAMCkQ8gmdBMd1o7iCgpMaYO2bVEk4eGCIZ+X++VNm2AzJM pjlZfCFLSwKK3MDkJCNmfMDx6UzDu1vpK5LnlcpNswYIzhxMqxpqj6+UwyjbJqiFQJN2 Mi6w== 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=Z5rfTfwx37vlBokjbni+D+cLrgXf6zAeF37k2f6/IUVvKay9dw+d9rEo9zwAR6L0CT 5ZcRR18NMtQYUhxuoYsB63G5LuBM4k/nCOaH19487+LuRa6T5tzFXODpyiKSqG5V+ldx hhhgWKdX9+8kSl6wNCUZMadoHFEDEvafKPm+5WazioKzTJWlrBjBVJHpDoGoMoJtuSPG V+dP937KXj8n5qN5eSbIYYHjHssJ1LXIzz2Bt7swpnkPpNCBc/ufFNfV+aoY4FmjRtIU 8dlRDmwacMhCjb/RqRhkZHeLEolpXudaD4FPE/JY4gnf08S4YQ/emVfNA/BBKcLtjLJf Qmjg== X-Gm-Message-State: ALKqPwesQfujlPQyzDP265Knn3wwgtw7cYXA5myFfJ+8f0RgiestsTNK xyPDgk2rSg9kwZvxH1Pru3btfA== X-Google-Smtp-Source: AB8JxZq8RWbvnSbe6atzBxxvJWQKeGKimFrw48C9otxW+5GnT8eHeE95wpO/SZKPYuf8t/smERqdWg== X-Received: by 2002:a2e:9248:: with SMTP id v8-v6mr1273252ljg.133.1526496714789; Wed, 16 May 2018 11:51:54 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 20:51:12 +0200 Message-Id: <20180516185146.30708-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180516185146.30708-1-edgar.iglesias@gmail.com> References: <20180516185146.30708-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH v3 04/38] 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, sstabellini@kernel.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