From patchwork Tue May 29 10:49:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 921964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hbzMwB42"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40w9dp60D0z9s0W for ; Tue, 29 May 2018 20:56:46 +1000 (AEST) Received: from localhost ([::1]:60112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcJ2-0005xh-DG for incoming@patchwork.ozlabs.org; Tue, 29 May 2018 06:56:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcCs-0001B2-W7 for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNcCs-0003mY-AX for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:23 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:55101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNcCs-0003m2-3X for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:22 -0400 Received: by mail-wm0-x243.google.com with SMTP id f6-v6so39200773wmc.4 for ; Tue, 29 May 2018 03:50:21 -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=hbzMwB42nyA4jvk247zEdZ/6N1SzdpB03sSykb3CyDn70nqt4aLgFBIk1gDQMl+0t9 s5HGiT8sHfXHk8mYSHhZyZNNzKe27dPSeQ4MwlYyKg+1oa7G7KNP35ZVrBb9lQzsX9Ph PkzN7B7ROq99v+BSRvrSudfnjKHB/KOHZQbfKWXGowj18b22hh7x3k5ebDkfpegX+FsD P/Hh78fBq4jjSKKxKmtAIDS7q8g/YQI7En6rX0U9eSxb2/X42LftcGHEsd8ZicY/vu6t 1MSKJF+Fg4ny/fufNxcYSwKBi17aSfla/cklRJje4c05p79uzWLUffPXMYPBzx6B0SlJ dKGg== 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=Gi32sxDzK/ibG29lQiNIMTKrzue1Kdg4F0TzR7VXdb9UiiN19IeR3nkrLBOS5d8uDq U1vplhvetvWbo90+ulDnh+U2TePcwQe83cjvJdItZobLLCoF8EKNqqI/Ebecl9NHSSL9 U0jXe1BvylxwQa0nKNTVFBeQ/zrEEAaTN7igInUcNnBDjpeXJwbnPhAWYBK8hg7SHwrM YpJTUZ4XLAT8YVWCED3xI5QGSrI9CXKeev7CGFWdo83OhaaftPg1ys2LvBYaq6kajf+i 9iJ7KZ1gDfy1O+Ltyp+kUDSIYUV/rDsG4noLs/F44/gle0ayOMj6eQcSwJ6wCSvxLumn aJRA== X-Gm-Message-State: ALKqPwe88bz4Ki+iTjdwhnX8iLiSorqmyvPVUV4WFbGQqM5leKThxYgJ kJyqgVWDVyrCA6iE7xmjfa2WHg== X-Google-Smtp-Source: AB8JxZq4PK55JL0OYJQIXxD1c8G1yBC2q0D75I0A5+aJ26/ef1e+t9cRkR3tNZQ7E93PVSsckIAQUA== X-Received: by 2002:a2e:9d41:: with SMTP id y1-v6mr10646914ljj.112.1527591020718; Tue, 29 May 2018 03:50:20 -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 j83-v6sm6331564lje.55.2018.05.29.03.50.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 03:50:19 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 12:49:37 +0200 Message-Id: <20180529105011.1914-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180529105011.1914-1-edgar.iglesias@gmail.com> References: <20180529105011.1914-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::243 Subject: [Qemu-devel] [PULL v1 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 Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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}, }; +/* 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 = MICROBLAZE_CPU(cs); @@ -141,6 +144,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); CPUMBState *env = &cpu->env; uint8_t version_code = 0; + const char *version; int i = 0; Error *local_err = NULL; @@ -162,8 +166,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) | PVR2_FPU_EXC_MASK \ | 0; - for (i = 0; mb_cpu_lookup[i].name && cpu->cfg.version; i++) { - if (strcmp(mb_cpu_lookup[i].name, cpu->cfg.version) == 0) { + version = cpu->cfg.version ? cpu->cfg.version : DEFAULT_CPU_VERSION; + for (i = 0; mb_cpu_lookup[i].name && version; i++) { + if (strcmp(mb_cpu_lookup[i].name, version) == 0) { version_code = mb_cpu_lookup[i].version_id; break; }