From nobody Thu Nov 6 01:09:05 2025 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538299053108104.088313117025; Sun, 30 Sep 2018 02:17:33 -0700 (PDT) Received: from localhost ([::1]:54588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Xqx-0002Ux-Mo for importer@patchew.org; Sun, 30 Sep 2018 05:17:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WsJ-0003CC-4r for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6WsF-0001Jn-9R for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:46 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:33702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6WsD-0001Aw-2m for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:41 -0400 Received: by mail-wr1-x442.google.com with SMTP id f10-v6so10512222wrs.0 for ; Sun, 30 Sep 2018 01:14:31 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.14.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5NwYs16EvK1egWDNLlwT0kONrHFoK0iovigdctT4HAM=; b=kmaaIeUYGuAGXXDWcJnatpYx82rWSeQLX9b7EBX1BtnQq5NPUsfx+6VBM3lRqe8jEX ohDAa/H4DpQR5N1xt6DDdNJ5t1QpCl2RxxVoZ5RRQMowK2uLElBFki8Ezjnn2pcAjqtS fCQuTfF0hsN4Ij16Y1LXqdzvJS0MPQFJfqqgoxJaLYeAT+QonCkeY8VW44WXHGCGxjvF LLvuQWizs/xcbEP5WamsxPMhNotEdTns0XsSqWRGuhpTKaJxPhWa9paveaNlh/+a7p/7 7iIAGEWjc4fiI7WlmjaSS6vdWo4sOgX++oM1aT6ChwGR13tE5f4escde1rGamF31Ilmo i1EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5NwYs16EvK1egWDNLlwT0kONrHFoK0iovigdctT4HAM=; b=bCRPQ/Ehch0RUIr9JS5Y94yu6iiEMqh5F5XZGe5Sblcf2weYlv2QMzmC3+1L1+LDbk BlhYnWuqwg604kjKf/xkbmTzdvWSvOqOxEwjFa2jaMWnyyepFTh4ryVtdvXqPZXPDoji 6d9FYmCCgglV+vbJkQfmA62YGmikFHvLdcNeQvEAZlEHuwhg2qXru3Ul4HgLfPscw/Wo pK7DG3RniAjpaf+ZzSRsAmucx9arEd8ukXPN6Pm6yLEK0p3xYmnV8H/bVt1xNK8LQ9Kl ziU1n2PmnnZJmp5jYb5OSmOEkUQOD58qJFCQN73ZWGn+WbtB0fgtszWAMqlIXKbfa96a nZHA== X-Gm-Message-State: ABuFfojaT+4waNezad6Tfh5+0uo4ZbtNMfwsHIg7EPIZ4ZSKa6eMLKhU iDsai3W4oHXUg0TaQMvbVCEEj9aa X-Google-Smtp-Source: ACcGV61Ga1MAcweztOqtUbv2wrF3VHQrb7DDtsctepGMAZHCyb5XnPmtRbKUzAugXGy2uT++iPyQ2A== X-Received: by 2002:adf:b243:: with SMTP id y3-v6mr3623565wra.90.1538295270269; Sun, 30 Sep 2018 01:14:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:13:06 +0200 Message-Id: <1538295197-23704-69-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PULL 68/79] target/i386: fix translation for 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: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 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: Pavel Dovgalyuk This patch fixes the checking of boundary crossing instructions. In icount mode only first instruction of the block may cross the page boundary to keep the translation deterministic. These conditions already existed, but compared the wrong variable. Signed-off-by: Pavel Dovgalyuk Message-Id: <20180920071702.22477.43980.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini --- target/i386/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 8fcd88e..83c1ebe 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -8538,10 +8538,10 @@ static void i386_tr_translate_insn(DisasContextBase= *dcbase, CPUState *cpu) chance to happen */ dc->base.is_jmp =3D DISAS_TOO_MANY; } else if ((tb_cflags(dc->base.tb) & CF_USE_ICOUNT) - && ((dc->base.pc_next & TARGET_PAGE_MASK) - !=3D ((dc->base.pc_next + TARGET_MAX_INSN_SIZE - 1) + && ((pc_next & TARGET_PAGE_MASK) + !=3D ((pc_next + TARGET_MAX_INSN_SIZE - 1) & TARGET_PAGE_MASK) - || (dc->base.pc_next & ~TARGET_PAGE_MASK) =3D=3D 0)) { + || (pc_next & ~TARGET_PAGE_MASK) =3D=3D 0)) { /* Do not cross the boundary of the pages in icount mode, it can cause an exception. Do it only when boundary is crossed by the first instruction in the block. --=20 1.8.3.1