From nobody Fri Nov 14 15:22:17 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1588242094; cv=none; d=zohomail.com; s=zohoarc; b=FR4qoCFmvoUQptp37DxVeCCMnKPChJROLvZhw8wx4ty8M01M4oWVEuIujU0UvPZGO+L7cLNQ7caxk04mXuX712LfecudVv3HfUfzw5N9cRkPD/+bwpoT3CzkRHbuh+AerivxzhjqNsbo8rsUie0liUqMBMM6JYkbMe61VZHhvFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588242094; h=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=opmkyJ2lt40WK/inlwbmCnCG1rqTZ+e0R6h7t3/vrFE=; b=B65Z+BIkUBKHmTC8Wg7f933wvZevy5EO0NompGm2ykhFZgJAlefv+8f2e9+AQBsia0YZvLIqpRSLSbqEjV++gGZeu+K7zPMVFS2FBK9wFnTlE2E1pyhdHMo4dBjUvD3DNCeig8fUwnDgUQiVmXkRgPRiYHqcX2LGITzTtQ6UDEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588242094117885.1523820703725; Thu, 30 Apr 2020 03:21:34 -0700 (PDT) Received: from localhost ([::1]:47760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6Jw-0001i5-QR for importer@patchew.org; Thu, 30 Apr 2020 06:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52418) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU6IV-0008Aw-BU for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU6IO-000172-4p for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:20:02 -0400 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:46271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU6IN-00011p-NN for qemu-devel@nongnu.org; Thu, 30 Apr 2020 06:19:55 -0400 Received: by mail-lf1-x144.google.com with SMTP id g10so734076lfj.13 for ; Thu, 30 Apr 2020 03:19:55 -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 d18sm3868549lfm.36.2020.04.30.03.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 03:19:52 -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 :mime-version:content-transfer-encoding; bh=opmkyJ2lt40WK/inlwbmCnCG1rqTZ+e0R6h7t3/vrFE=; b=k2uRwX9OwkMyYc6oTmZaYb0KThhYS3YQi198O1K+0L1kVRxxAK0SUCfsYVvgzUldR/ Z6sn5JiYJTv5dNxnBp7H3uncJQEQPmDV30syaVPfQFOOyjkAOxZsKMgqvRqnIaqzW0V2 72fj8AdxB3xs+qQTxE6ad88e19Xwy9VPcUQoz3fPYsEljmpNBhn7vH2tSYIn2bKYZCFb RB0Smm5wC5tMCNPouKAL9VxoHilG/PIS5yikifC++luNBpZeWzWUMWvVHvKCYvyvZ7kP 2CLyc00ZXIJPPjwg4qJzeZXJ0TPAz6eC/6kADUZ/XtSV777mv7Y3ALGQWNZbEwvbeG9k NDSg== 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:mime-version:content-transfer-encoding; bh=opmkyJ2lt40WK/inlwbmCnCG1rqTZ+e0R6h7t3/vrFE=; b=hSt4TYho2NvPEnr1XD8AN+TDzZGMOP73HPY8pppDtFaj2mLI1KGrBh+pHMqOqcVC5s x/Mk0G5O6KFtCYQYaSLXurEvU1k1Lazf9tj2UPZl2KzakWDNrK0BgKLSjRpe8AhvchQu qDO2UWUSlnkNYtDCVRsQhCnFjWm0PoDOw20ZZm1qflEx9ZXEkMv6RTUzwwwS6y2/g2Kt mf65DG0mNQksq+urScFfByMsfK9qS+A7QDcqY78/iE+ovEJ0FunLLEo+ZbXRAZb8xtVg 1YE2dzTKbJM8DVYOdy1o0NEGIQVidLzg2l10FqeOQvDI+G2fdCqEJUpz+dlZqQbD+Rbl nWvg== X-Gm-Message-State: AGi0PuYvbBa6I1OFarJjlatdZyaGBQ5+ToVAArjTLRc0gNtytRYUkw5T 89subk8ngc1MOutk8q9kRizFRRJmJR0= X-Google-Smtp-Source: APiQypLlRmQsqA5Ug7rxz2I9zKbOWmyWkc2mt26kAzfzUFlbE85QbiwwXwm++vAS6tQndP0B0WjQsQ== X-Received: by 2002:a19:c3c5:: with SMTP id t188mr1720815lff.199.1588241993402; Thu, 30 Apr 2020 03:19:53 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 1/6] target/microblaze: Add the opcode-0x0-illegal CPU property Date: Thu, 30 Apr 2020 12:19:44 +0200 Message-Id: <20200430101949.7754-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430101949.7754-1-edgar.iglesias@gmail.com> References: <20200430101949.7754-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 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=2a00:1450:4864:20::144; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x144.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::144 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add the opcode-0x0-illegal CPU property to control if the core should trap opcode zero as illegal. Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.h | 1 + target/microblaze/cpu.c | 6 +++++- target/microblaze/translate.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 1a700a880c..d51587b342 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -303,6 +303,7 @@ struct MicroBlazeCPU { bool endi; bool dopb_bus_exception; bool iopb_bus_exception; + bool opcode_0_illegal; char *version; uint8_t pvr; } cfg; diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index c9cf2364ca..418a0cd1fa 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -206,7 +206,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **= errp) (cpu->cfg.dopb_bus_exception ? PVR2_DOPB_BUS_EXC_MASK : = 0) | (cpu->cfg.iopb_bus_exception ? - PVR2_IOPB_BUS_EXC_MASK : = 0); + PVR2_IOPB_BUS_EXC_MASK : = 0) | + (cpu->cfg.opcode_0_illegal ? + PVR2_OPCODE_0x0_ILL_MASK = : 0); =20 env->pvr.regs[5] |=3D cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -274,6 +276,8 @@ static Property mb_properties[] =3D { /* Enables bus exceptions on failed instruction fetches. */ DEFINE_PROP_BOOL("iopb-bus-exception", MicroBlazeCPU, cfg.iopb_bus_exception, false), + DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU, + cfg.opcode_0_illegal, false), DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version), DEFINE_PROP_UINT8("pvr", MicroBlazeCPU, cfg.pvr, C_PVR_FULL), DEFINE_PROP_END_OF_LIST(), diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 37a844db99..222632b670 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1573,7 +1573,7 @@ static inline void decode(DisasContext *dc, uint32_t = ir) LOG_DIS("%8.8x\t", dc->ir); =20 if (ir =3D=3D 0) { - trap_illegal(dc, dc->cpu->env.pvr.regs[2] & PVR2_OPCODE_0x0_ILL_MA= SK); + trap_illegal(dc, dc->cpu->cfg.opcode_0_illegal); /* Don't decode nop/zero instructions any further. */ return; } --=20 2.20.1