From patchwork Mon Jul 13 14:10:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 235419 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2885257ilg; Mon, 13 Jul 2020 07:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuIxMN760vACHP+kcU4HdhaJzrANL9feMzlFFwcuS+ooE2v4wB9iwkSS1FkG0rbBwF2Lq4 X-Received: by 2002:a25:df81:: with SMTP id w123mr379094ybg.428.1594650158587; Mon, 13 Jul 2020 07:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594650158; cv=none; d=google.com; s=arc-20160816; b=1C0wWOjk9P5SbGJm5pdyfp5h/uc0RRnmklkoiEHUlDIqyxHNju13RX0nUiBBo+2aqF QFSjXHpkAmwwcuQN1ZVqs2roZVgE1SQIuGBWzm32Kp7M/RfRta+7D0yAbpTHlJqFPak2 sOnylNFXirnS7/rZoMK/FlaFgLbKZLZmvSDElOYxts0z+Pmu68HWMz+iciDQhldPw4gM jgM2uCUUEeLvzSoepW34Biv+acQ7aDpXlIckiiQy0UDH4+aGlCyHDudFTh5AXu0ENwhp cG0WBCnzNaSROvs1ZT0X0o63aRZ82qpDQGh8c4h78bJ0Uws9hGVjgKM9AxLuMMaqKR94 QO5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=7RhrIfAtLKSoFSnxW6rvMNP1lUxxCGQ7DmZjmW38djo=; b=fpgUHUZHAeg7eFj8DgluANTTHkCFEBH4hsvWWsnOvl7ihvzNdxZyyynajwsOqycefa 6gWk/R3c0+7uJBp2l10+Ng4bZUqznsaffvpbfjBk7Qb6PrBeI3rWyDAAa3VOarsuqrsJ 3++NQaoBzUOkcqG/fnjt9tm8wKCHYgaMbdttTbdFzdcwd6RqyobdIYnpAmrg0iYhmMq+ TaePy5L7cX9TI0phTSJwc6tgdNKF+X+zhb+peJJYeO/j2JkVkT/2IJpS9SToXUlqeqSG 1MK3BL9lJeNhIVmaKekArKx9l4Noaa/LGI1YwFiJCmxEHDhydWW1zN77ublh66eZYI7V 7BAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VZgFqRnY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z186si8259412ybz.463.2020.07.13.07.22.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 07:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VZgFqRnY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juzLq-00006J-3O for patch@linaro.org; Mon, 13 Jul 2020 10:22:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1juzB6-0005d3-Rb for qemu-devel@nongnu.org; Mon, 13 Jul 2020 10:11:32 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:40778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1juzB3-0006fG-6Q for qemu-devel@nongnu.org; Mon, 13 Jul 2020 10:11:32 -0400 Received: by mail-wm1-x343.google.com with SMTP id f139so13315713wmf.5 for ; Mon, 13 Jul 2020 07:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7RhrIfAtLKSoFSnxW6rvMNP1lUxxCGQ7DmZjmW38djo=; b=VZgFqRnYD9pvepuDFTsWH7Jhh5Ci2x/CKRlhOwN7Suc80tWKhZY8EtmYj1mMs1L+TO V+jwSC34Opn9U443ml24ORyTcbFbrFGnxK8z1eSqgvn3f3ZthZQuVfjndTXnb+TQTwi4 DlbmNkqVfxdPzhDv1kh9FO4LXudh08aaEfRHG/9fYwlaH7i9WVNxIDuWa3HuzR6U/ipa BGlGbipVTLvojLPI76C0vxn3qc9O/CPAMo4nBZCn/oQ4uKiJzUPBg2MIiNUNni6e/yT5 agSEJG9O7DVecbh4eYyA74xibn3+Qv4i5o3kxmDo3edHsLMQlbRslzrIuNDQfzhE1cuL FRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7RhrIfAtLKSoFSnxW6rvMNP1lUxxCGQ7DmZjmW38djo=; b=kAAaezzfCi2OOmBcAvHYfVNnCk1HH5B/+UY9rvcdQLZu5C+8MloRD0uvsrccuPHyDj kKzdc931bHl1XuDWdA8r9Ew3aNSpPN9IlCTxROyp2aTz/tXXNH8DMm38315VtbyQ7B1u 6O7sfYSYFzUWJz6I77ylZNzH+aRpDOdhG57Rm9/5FKiFBYJWXwrehNx89bOjPX0JJ4Sk tta5VsoBdySMH7lifENS8RO0H24vcu8hcLXC9XRR6C6y+6reF8tnBfT40TndXLKboBf5 ettMMjNEGo+xAb1hhI9HsjvCOzD2xxzA+rBOf4WJ2xlMzNYvH3C69orzoCZ3n9eXsEIx cIwA== X-Gm-Message-State: AOAM531JGyJKEisURodRuMO3n3seDLlZqiqvLp2PQGG4lP34dO9xOEvr QxVDvzfYJ16iCIkYma8w4ZSdm/ZXToZtQQ== X-Received: by 2002:a1c:9a81:: with SMTP id c123mr172245wme.46.1594649487712; Mon, 13 Jul 2020 07:11:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c136sm24031297wmd.10.2020.07.13.07.11.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 07:11:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/25] target/nios2: Use gen_io_start around wrctl instruction Date: Mon, 13 Jul 2020 15:10:58 +0100 Message-Id: <20200713141104.5139-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713141104.5139-1-peter.maydell@linaro.org> References: <20200713141104.5139-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 'can do IO' state, so add gen_io_start around wrctl instruction. Also at the same time, end the onging TB with DISAS_UPDATE. Signed-off-by: Wentong Wu Message-id: 20200710233433.19729-3-wentong.wu@intel.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/nios2/translate.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.20.1 diff --git a/target/nios2/translate.c b/target/nios2/translate.c index c2a134f932d..9824544eb37 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" /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ @@ -518,7 +519,11 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags) /* If interrupts were enabled using WRCTL, trigger them. */ #if !defined(CONFIG_USER_ONLY) if ((instr.imm5 + CR_BASE) == CR_STATUS) { + if (tb_cflags(dc->tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_helper_check_interrupts(dc->cpu_env); + dc->is_jmp = DISAS_UPDATE; } #endif }