From nobody Tue Feb 10 00:23:11 2026 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1541680506615682.5699703409739; Thu, 8 Nov 2018 04:35:06 -0800 (PST) Received: from localhost ([::1]:56347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKjWb-0003pw-G1 for importer@patchew.org; Thu, 08 Nov 2018 07:35:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKjFQ-0005KB-Oq for qemu-devel@nongnu.org; Thu, 08 Nov 2018 07:17:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKjFM-0003zS-Qy for qemu-devel@nongnu.org; Thu, 08 Nov 2018 07:17:20 -0500 Received: from ozlabs.org ([203.11.71.1]:59959) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gKjFM-0003sL-C9; Thu, 08 Nov 2018 07:17:16 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 42rMj23N9kz9sNk; Thu, 8 Nov 2018 23:16:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1541679414; bh=+0OHv8tGkfc728eFVvbvp0gkPvhzsHhuWzgtwbkl7Ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ahgSJ9fUlhgOhgUShdxGgTRi9Y2w9AVxsi6m3odXU9RkIVK4BNPFVoBIXaoAc8+w9 udG2VsrD1mz1IPqPPVOUSEdUJjgqQpnvgDSPkXTVhgW7yfUW3RP0gavw4/4WuSHGrx CjEoKOHpPqPWYrmlzR0YaSvCk+MvNY76NuFa6cyw= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 8 Nov 2018 23:16:44 +1100 Message-Id: <20181108121646.26173-21-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108121646.26173-1-david@gibson.dropbear.id.au> References: <20181108121646.26173-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 20/22] This patch fixes processing of rfi instructions in icount mode. 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: lvivier@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, groug@kaod.org, Maria Klimushenkova , qemu-ppc@nongnu.org, Pavel Dovgalyuk , David Gibson 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: Maria Klimushenkova In this mode writing to interrupt/peripheral state is controlled by can_do_io flag. This flag must be set explicitly before helper function invocation. Signed-off-by: Maria Klimushenkova Signed-off-by: Pavel Dovgalyuk Tested-by: Mark Cave-Ayland Signed-off-by: David Gibson --- target/ppc/translate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index fb18cedcf0..2b37910248 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -3919,9 +3919,15 @@ static void gen_rfi(DisasContext *ctx) } /* Restore CPU state */ CHK_SV; + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_update_cfar(ctx, ctx->base.pc_next - 4); gen_helper_rfi(cpu_env); gen_sync_exception(ctx); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_end(); + } #endif } =20 @@ -3933,9 +3939,15 @@ static void gen_rfid(DisasContext *ctx) #else /* Restore CPU state */ CHK_SV; + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_start(); + } gen_update_cfar(ctx, ctx->base.pc_next - 4); gen_helper_rfid(cpu_env); gen_sync_exception(ctx); + if (tb_cflags(ctx->base.tb) & CF_USE_ICOUNT) { + gen_io_end(); + } #endif } =20 --=20 2.19.1