From nobody Wed May 1 22:56:51 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 1529077621106729.3226453302665; Fri, 15 Jun 2018 08:47:01 -0700 (PDT) Received: from localhost ([::1]:47698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTqwG-0004ho-72 for importer@patchew.org; Fri, 15 Jun 2018 11:47:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTqGU-0001m0-5n for qemu-devel@nongnu.org; Fri, 15 Jun 2018 11:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTqGT-0007CJ-9C for qemu-devel@nongnu.org; Fri, 15 Jun 2018 11:03:50 -0400 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:35982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTqGT-0007C0-1Q for qemu-devel@nongnu.org; Fri, 15 Jun 2018 11:03:49 -0400 Received: by mail-lf0-x234.google.com with SMTP id u4-v6so15111101lff.3 for ; Fri, 15 Jun 2018 08:03:48 -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 y5-v6sm1546272lfg.74.2018.06.15.08.03.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 08:03:45 -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=o9kmceSO8XMrWXGmg8zHmSyxY8YWRvoxCYD5Vvw2P18=; b=N3ORqygiIWCLOpWsniR5/ulxfJalHMzSPnEHMmuJl4d1yJD2G0rVWy7VPV8EYlAT4/ Y7PiCR7zMdvdDEhDkJw7lmnSf4VbtWalTS8PYY9cWU7zY9Ab+quhGYrbszUPfj2JHQ/j 434UYnSAmALTOcv5Ol5kM+EMMV2xGkMtHJMYuK3R0CZMzs8dwXuDZsFlhCzLNlNnhOwK maEnCGOGLBqWDVOaCNHdZ0HaLfSq1XHWULnjhgDgWl3uyTC+lnh9cuELTHd1Q9di7lj+ ncNWU94vDQCHJv8xdh9e2xN7s3lpiYoyfJU4e7XIn9rnPhIM3gz+QeRxLXQghsngQia/ f6sQ== 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=o9kmceSO8XMrWXGmg8zHmSyxY8YWRvoxCYD5Vvw2P18=; b=iB8GXfLjo/HZyjbyOr39nWCNwTZTbE73vNvU+gHSx9BeyXiYHfJ88gV/Gg2mwVLYHD RT/ThsIj4hUh8YbGleKUIsLlbiEriY+m0U3ZTeA+kkRU03JWuZ7l1ZzDllpn1FaVClZK D8iFTgvBFI+4qhbIbtFPy/yvM6HBpGTusfCj+2Cja1cbCn5n0ZJHj6kBmURDRz7Nv6x4 mrdUX2m2WZdFPCGOqJpbhAmCL3fNDJACVFr601m0cdFDlQZERyKje9TlbkxpNcqZIdLY 7KJsg+BL4tlywTVSnW1Mw8StnqGdGYmK6sKLJWRmxqV2SD+D50xMx4gxPVeI68y1vvgg Lkkw== X-Gm-Message-State: APt69E1xP+Y7qTZfyTFE/aCBlZQDqMEesCBlz0ZjDdVZNgQOdJ5NbWce 0Eu5q5sTzAH0WZdBhHOPZlocYA== X-Google-Smtp-Source: ADUXVKJTPDUjrp6BRoUujXs/DDumJ9duPq82+D0igVItEvKwtMwjEzvIQPFz1Xcd/Ydj/YOaGuRUDw== X-Received: by 2002:a2e:3810:: with SMTP id f16-v6mr1702263lja.25.1529075027311; Fri, 15 Jun 2018 08:03:47 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 17:03:42 +0200 Message-Id: <20180615150343.4937-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180615150343.4937-1-edgar.iglesias@gmail.com> References: <20180615150343.4937-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::234 Subject: [Qemu-devel] [PULL 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 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 From: "Edgar E. Iglesias" Correct the masking of output addresses. This fixes Coverity CID 1391441. Fixes: commit 3924a9aa02 Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reported-by: Peter Maydell Signed-off-by: Edgar E. Iglesias --- 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 Wed May 1 22:56:51 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529077389163694.8308771120785; Fri, 15 Jun 2018 08:43:09 -0700 (PDT) Received: from localhost ([::1]:47641 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTqsP-0001EN-B7 for importer@patchew.org; Fri, 15 Jun 2018 11:43:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTqGX-0001oy-BJ for qemu-devel@nongnu.org; Fri, 15 Jun 2018 11:03:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTqGW-0007Da-Bc for qemu-devel@nongnu.org; Fri, 15 Jun 2018 11:03:53 -0400 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:35399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTqGW-0007D7-4q for qemu-devel@nongnu.org; Fri, 15 Jun 2018 11:03:52 -0400 Received: by mail-lf0-x244.google.com with SMTP id i15-v6so15120526lfc.2 for ; Fri, 15 Jun 2018 08:03:51 -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 g14-v6sm1510456lfb.36.2018.06.15.08.03.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 08:03:48 -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=k/DL3yGeNj2rxkHmTFdHoFfjXKsNS/Ylj4+CW4YnHg4=; b=h9Rwj0n9z8Xwkhjf9xqfxYhT3KLEdyZ5tPd5040phCWzw4rm7OrnWz+hYm996BU7+G FzUERUIylKRsVQiR1f79ADv0xXlR6A+5AoX5Dp3Rp4YTOpbyHwAJsINp6V+8sravegbu KGzaZPU8pfhdFfNULdJeRiT3AKWkwyCfXSGZNxK0gjCEB4ovUuryBbz8L0XGBIjEl+UF 3zywxi934emJWY/c9QrpvUMDeAnORTGGSUO1s2ZaMp0RdxiUNa1iMBzuwxz8u+UgostT nGrsHQZabpR53QSm4nx44j4aIGuOwYCePAtWzog62b50Cxjbgmk5JgunRYP6vOzWz6nX 3PEQ== 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=k/DL3yGeNj2rxkHmTFdHoFfjXKsNS/Ylj4+CW4YnHg4=; b=pDEwUKGor0rIZkYy7yzaVTWKPsdeD3o6YcUvOIKbHMIUVvtII1YOF7+pILHWJChALW GmCfiI4Bi7AySLu4YZmdqMjIS37LOXkn6KoQogdofY379nn8yscn9hRTj2RZc8sOqKkc M3depeiyuff5nP84G/QOMIPmTGKlkwZqsyX8u2rbxXuzZAXBirY/sn/GGPF5/UQUWGJY 9c8PVAPKBJXKky+LuLQk2un7Xzo6Ep+8RryEL39v5udlLiEVKHtAMPsyblg9s7OxAaei mS4BHp0K70U8O+QYRJMwX9teISW1uahSoUDh2B3V4pIV3ndWZ5tS16rl6wQTqcwQQpM7 XHxg== X-Gm-Message-State: APt69E1wPSfWhZwTAG93Lb3SL5t9OPyrkhpJX4ZZ2USyyH4LNxiiDzz3 0+q9TDt3xTBYNEqoz8S9b7ehNw== X-Google-Smtp-Source: ADUXVKL1LnRaKGqUWMEgKt3QhArNK3ejgTRslFbJgzzDk8f46D2dYJsNDf9rkir1aNThTk3063oG2A== X-Received: by 2002:a2e:9c04:: with SMTP id s4-v6mr1572820lji.97.1529075029910; Fri, 15 Jun 2018 08:03:49 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 17:03:43 +0200 Message-Id: <20180615150343.4937-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180615150343.4937-1-edgar.iglesias@gmail.com> References: <20180615150343.4937-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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] [PULL 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 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 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. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Edgar E. Iglesias --- 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