From nobody Sat Sep 21 01:08:02 2024 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 1529008122916222.29205123995462; Thu, 14 Jun 2018 13:28:42 -0700 (PDT) Received: from localhost ([::1]:42864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTYrK-0005EA-8P for importer@patchew.org; Thu, 14 Jun 2018 16:28:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTYnt-0002US-LZ for qemu-devel@nongnu.org; Thu, 14 Jun 2018 16:25:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTYnr-0006A3-KT for qemu-devel@nongnu.org; Thu, 14 Jun 2018 16:25:09 -0400 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:41736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTYnr-00069D-C8 for qemu-devel@nongnu.org; Thu, 14 Jun 2018 16:25:07 -0400 Received: by mail-lf0-x22d.google.com with SMTP id d24-v6so11380616lfa.8 for ; Thu, 14 Jun 2018 13:25:07 -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 d20-v6sm1086652ljc.62.2018.06.14.13.25.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Jun 2018 13:25:04 -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=p+b217Mls8oZCf/DyUUKaNN0Y2RWSSFUrqdGy7cYwDM=; b=F3GKRimZPm/acguMM4f93zGH84PmHZxUbrnpe3UBjkMcu7grV/Qr1Q9U+DNTdlvlvZ rw90tG8+V/ThZpX4pqgrgI+kt693cv1ekCkWNi5LPoBsfgPHA6kfdqHGJZlt1Hryd6Jb SX5egET9jZeHlbmFaYS8v1KOBpQ5zBXg8/hdOu/mXGB1v5N5Lznl1EqGt68WoI3mwY+N S6drCzmpokfM/HQ4XRdxCTY9OjaaTvIzU6hWKMv+GcHuMHRBYd96gNI/0AssoE1xZ8Vm vAnr8qYJ5Rl/fOTRbCcah2hGUUafhOTwJ5xmTjo5Rkm3gc8al6R5dEsm+fCJhBDJgTEG FgDg== 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=p+b217Mls8oZCf/DyUUKaNN0Y2RWSSFUrqdGy7cYwDM=; b=T/N9jpvLdt2bMwzXWh5ggsWkoIbu8vQh9g6xaQw2b4VIXfT0x7FT/1BUS2scxu/7oX aHaIC9y/6zdLkoJdz+ifgNb5oR2hiYWdTi0MwffQ0jt7b7CwZVVy3Fahscsazuw8NX9q HuuSX8OgAL60k/3dyIPaYYumH9lxZ/Q9JPpggzvhcjPO2At7graQnX2ldjPjp5vbG3kl iakXaD6QsXCfQTTyFKzIMZwh4i0Bx2B3fqAYkqLGjbjk1lbrnSkyRt+JF3LHkRf1SiMo J+2GAZ5XIIm+FmKj1eax+b7MdLO2EsNHGIVMzs/r3qYo6oK0wZIOXeVbeO2RnUmO7KEC mNsQ== X-Gm-Message-State: APt69E2YBPRFtGEP4e1ekwb20SCsLEy6mfm4qmh4EdFmTrGsNDU1ROMf 2p7Uijvu9jUDE0ZKAJtHU9P2ug== X-Google-Smtp-Source: ADUXVKIN6E2242Xbq2tOU6hJN6okj+qw8Uu0nFSJaXuucTpo7UjOBJESFtcBE+rUMHEOfc/MG8JuoQ== X-Received: by 2002:a19:920a:: with SMTP id u10-v6mr7237142lfd.33.1529007905857; Thu, 14 Jun 2018 13:25:05 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 22:25:01 +0200 Message-Id: <20180614202502.668-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180614202502.668-1-edgar.iglesias@gmail.com> References: <20180614202502.668-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::22d Subject: [Qemu-devel] [PATCH v1 1/2] target-microblaze: mmu: Correct masking of output addresses 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" Correct the masking of output addresses. This fixes Coverity CID 1391441. Fixes: commit 3924a9aa02 Reported-by: Peter Maydell Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/mmu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/microblaze/mmu.c b/target/microblaze/mmu.c index f4ceaea520..fcf86b12d5 100644 --- a/target/microblaze/mmu.c +++ b/target/microblaze/mmu.c @@ -159,7 +159,6 @@ unsigned int mmu_translate(struct microblaze_mmu *mmu, =20 lu->vaddr =3D tlb_tag; lu->paddr =3D tlb_rpn & mmu->c_addr_mask; - lu->paddr =3D tlb_rpn; lu->size =3D tlb_size; lu->err =3D ERR_HIT; lu->idx =3D i; --=20 2.14.1 From nobody Sat Sep 21 01:08:02 2024 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 1529008110414472.1001930496558; Thu, 14 Jun 2018 13:28:30 -0700 (PDT) Received: from localhost ([::1]:42862 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTYr7-00050s-Oj for importer@patchew.org; Thu, 14 Jun 2018 16:28:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTYnu-0002VW-5i for qemu-devel@nongnu.org; Thu, 14 Jun 2018 16:25:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTYnt-0006BH-7w for qemu-devel@nongnu.org; Thu, 14 Jun 2018 16:25:10 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:40432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTYns-0006AU-Vh for qemu-devel@nongnu.org; Thu, 14 Jun 2018 16:25:09 -0400 Received: by mail-lf0-x244.google.com with SMTP id q11-v6so11377417lfc.7 for ; Thu, 14 Jun 2018 13:25:08 -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 a67-v6sm1206667lfa.48.2018.06.14.13.25.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Jun 2018 13:25:06 -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=7JwRP7mYlf8afA3lslf6J5FrFC+NoixqaqyWvc31k5s=; b=q95n3dgUGYc85ujkDLFrmkOFlP9+ZBfcr1SQP7TnYoWbsTBQ9B4d+Iuk4s61l1gxs4 ckpfQW4JAlfisaziUM0q3ofzVtJSnF8QrGc9lJMveJBrC0gHMz3xyNHUMkE0Xo1jUFyO s+tsH80RTVAky07wmwb57izxacUQoZuaofddySZRk+X5ekSXNwM+acgBgMi1UOrTdcYe rLfQYq9ezJwu0D5LxW6FQR21ORJ3US4AXS1FEEgcc4X7jSWPBoxsJd3wcOgyLghaZoHI cEPveZkGGUTZ1XG1l4ArWwD8D8A3EwyAiVxPv+yjCppaberw+p4qRBIQrQiZSr1vJ+FG Qr5Q== 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=7JwRP7mYlf8afA3lslf6J5FrFC+NoixqaqyWvc31k5s=; b=TTKMVqM0Z2jKq24TmA64EwUFf/7ouZ4gVnx5tO/9DScryCVAOymLcUCUZmgKBZiuU6 wK5gzHLa6f2oH2Dg0Y8S6ivYiCK/JoN7DSNHbK/Jm1SMZLsGn0PnCCRSOSEpiHnEU/cB B4kd4z3xa+KG1uQe961szFh6mp53bYJWPrRE8qtqZY5/hK6fvAfBgJxEre7KRxCzeKEO KUUO5z8MGWrGiHLbAr4CwEuM7fBMvVpPfNH7LOislZVlam+qIfEkjtX95geTpWnSjOz9 qj3Xbjerav44HfdBrXs3DFsBZXx27sdQ34A57VTZvuJV3EJ/agBoKhIQGY6YZccDk5P/ z+jA== X-Gm-Message-State: APt69E2l2dYtoQIEzXpD9m/Cv5jcDhO7rBlq4bR1Gjj3Qq4GctIw3gvk ur8dRiHCYfpCWyB67iNla7JyDg== X-Google-Smtp-Source: ADUXVKLlpMhkNhNoANDuEIi0m5cLn4fHR0273HpAWlFZ4PUGDF0aCQE3k26XP+r/LGLsQekQLWKR9g== X-Received: by 2002:a19:c1c1:: with SMTP id r184-v6mr7274479lff.51.1529007907382; Thu, 14 Jun 2018 13:25:07 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 22:25:02 +0200 Message-Id: <20180614202502.668-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180614202502.668-1-edgar.iglesias@gmail.com> References: <20180614202502.668-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 v1 2/2] target-microblaze: Rework NOP/zero instruction handling 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" Remove the abort on a sequence of NOP/zero instructions. Always return early and avoid decoding NOP/zero instructions. This fixes Coverity CID 1391443. Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/microblaze/translate.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 6c64946398..78ca265b04 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -90,7 +90,6 @@ typedef struct DisasContext { uint32_t jmp_pc; =20 int abort_at_next_insn; - int nr_nops; struct TranslationBlock *tb; int singlestep_enabled; } DisasContext; @@ -1576,17 +1575,12 @@ static inline void decode(DisasContext *dc, uint32_= t ir) dc->ir =3D ir; LOG_DIS("%8.8x\t", dc->ir); =20 - if (dc->ir) - dc->nr_nops =3D 0; - else { + if (ir =3D=3D 0) { trap_illegal(dc, dc->cpu->env.pvr.regs[2] & PVR2_OPCODE_0x0_ILL_MA= SK); - - LOG_DIS("nr_nops=3D%d\t", dc->nr_nops); - dc->nr_nops++; - if (dc->nr_nops > 4) { - cpu_abort(CPU(dc->cpu), "fetching nop sequence\n"); - } + /* Don't decode nop/zero instructions any further. */ + return; } + /* bit 2 seems to indicate insn type. */ dc->type_b =3D ir & (1 << 29); =20 @@ -1633,7 +1627,6 @@ void gen_intermediate_code(CPUState *cs, struct Trans= lationBlock *tb) dc->singlestep_enabled =3D cs->singlestep_enabled; dc->cpustate_changed =3D 0; dc->abort_at_next_insn =3D 0; - dc->nr_nops =3D 0; =20 if (pc_start & 3) { cpu_abort(cs, "Microblaze: unaligned PC=3D%x\n", pc_start); --=20 2.14.1