From nobody Sun Feb 8 22:43:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1592452298; cv=none; d=zohomail.com; s=zohoarc; b=PbURHcG//O8zdkHK3HfzLc0666AV85598FNQcTIcRg/V0TLXb2pNWYnBWu5yjy/W2SeWpLevGwFoilnBnqjz+g3k5Ef3GqoGUwp5Dor6S3d//OTJJn0Ku6BFH3LLe/98HEF+Ht+Zn5sgDcyFxgA6zGL9h8p1pRD6afSfRa2xLR0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592452298; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=/R1jwO8WTsgSu8zGt8GPcd/XjGIvi7ABlLG6X6AzE7Y=; b=LcDHLNYx9Mc4SDURYbc6/DLVy7sIx2NhI1oboSxFuEyRV5xjCdNJu58v7KxuLYdABdw824GAS07kGPRSpb/W1KEtjACr63VXJJi20TTn/BhOmEmj5dRE7wuBHccA1HoUJXR2zoBDLdpthIJLYAE2p+TU/3ZjfwR40zjVFFONdPA= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1592452298674223.70640810272846; Wed, 17 Jun 2020 20:51:38 -0700 (PDT) Received: from localhost ([::1]:39738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jllaT-0005li-7W for importer@patchew.org; Wed, 17 Jun 2020 23:51:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jllZq-0005CK-GO; Wed, 17 Jun 2020 23:50:58 -0400 Received: from mga01.intel.com ([192.55.52.88]:53511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jllZn-00059E-SJ; Wed, 17 Jun 2020 23:50:57 -0400 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2020 20:50:52 -0700 Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.153.142]) by orsmga007.jf.intel.com with ESMTP; 17 Jun 2020 20:50:50 -0700 IronPort-SDR: fo+KaZzuyzjO+/a6dM9Vc2vl6xIyetpUJsPLSn35gRdYNOiWdOff+g1OkjZIFOoD/YAHksCRza mvkrzzOj1gEA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: u79IcDOItKp/UTcYXS1JEqid2fwLWQcEEqYlV+h8sVFIkRWMelZGuVDse0mFXnx1V7+uKM5pRu MzGwJiat2xNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,525,1583222400"; d="scan'208";a="262786990" From: wentongw To: qemu-devel@nongnu.org Subject: [PATCH] target/nios2: Use gen_io_start/end around wrctl instruction. Date: Thu, 18 Jun 2020 07:41:29 -0400 Message-Id: <20200618114129.5636-1-wentong.wu@intel.com> X-Mailer: git-send-email 2.21.3 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=192.55.52.88; envelope-from=wentong.wu@intel.com; helo=mga01.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/17 23:50:52 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -49 X-Spam_score: -5.0 X-Spam_bar: ----- X-Spam_report: (-5.0 / 5.0 requ) BAYES_00=-1.9, DATE_IN_FUTURE_06_12=1.947, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: qemu-trivial@nongnu.org, marex@denx.de, crwulff@gmail.com, Wentong Wu , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wentong Wu wrctl instruction on nios2 target will cause checking cpu interrupt, but tcg_handle_interrupt() will call cpu_abort() if the CPU gets an interrupt while it's not in a 'can do IO' state, so around wrctl instruction add gen_io_start/end. Signed-off-by: Wentong Wu --- target/nios2/translate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index e17656e6..deaefcaf 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -32,6 +32,7 @@ #include "exec/cpu_ldst.h" #include "exec/translator.h" #include "qemu/qemu-print.h" +#include "exec/gen-icount.h" =20 /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ @@ -518,7 +519,13 @@ static void wrctl(DisasContext *dc, uint32_t code, uin= t32_t flags) /* If interrupts were enabled using WRCTL, trigger them. */ #if !defined(CONFIG_USER_ONLY) if ((instr.imm5 + CR_BASE) =3D=3D CR_STATUS) { + if (tb_cflags(dc->tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_check_interrupts(dc->cpu_env); + if (tb_cflags(dc->tb) & CF_USE_ICOUNT) { + gen_io_end(); + } } #endif } --=20 2.21.3