From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 265C3C4338F for ; Thu, 5 Aug 2021 09:52:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1EAB6104F for ; Thu, 5 Aug 2021 09:52:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1EAB6104F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:44210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBa3O-0001Nk-OF for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 05:52:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBa2V-0008OB-Hy for qemu-devel@nongnu.org; Thu, 05 Aug 2021 05:51:47 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:42669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBa2T-0007tG-KY for qemu-devel@nongnu.org; Thu, 05 Aug 2021 05:51:46 -0400 Received: by mail-io1-xd2d.google.com with SMTP id h1so5902715iol.9 for ; Thu, 05 Aug 2021 02:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=MZhRgnPJXAtFNBok5myzWjWpvaesAZ+OeCYJKAiWYcY=; b=Oai+J8MITqRoWXSSv1SvpBND0nqsrDIHQV4jMUql0q1ErrPqrM3YomXS1cy3UA47PM voaeuoef5Jqk6mrK0MuyBKxuP9U6sZjXVQ+FVnFznknQNmkeUAny2FH4YSI701ZL6mHF wtxLuuN5niKWhnZG0K0n8sDnQYF9qHl47wKmXCbjlTYHM3ti/gyD5Dj2oFPiIzNk9QE+ U5ibYNv13Ihv2TcZ11gcwqTbSZSqbUZxv+txd7pJ6MbRUvafxWVLhQABOWw1fUiGtr7w 2abJL4x12z0+CpJcjirrNHKEoD9RuVoHrFOGYjStgIbje8ERnBUXLMWAYoURFH+p0Vy4 ROLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MZhRgnPJXAtFNBok5myzWjWpvaesAZ+OeCYJKAiWYcY=; b=B+2tMkVOOJvddtNxysmxhlmegmHHl/K4O41vVO2EBDT2S8oo26WFPvT7KeCzZlUIP5 XunmdjKnR0webknGbq+zbr/f0XNQbBOtV+Ze/cJ5TNVa0gXEqrA2AXHepm51lyKpHyOP poGH6RUQc0wx5mEHND6LKah1Ttn4JykSua9MFYhILkocrdpHFacE8hiYgw4TBa0QoKDq tE+R5r76mamTvgMLZnk2UBfYAOxrFTelPyjJT86ceHRd714tgpI6/UzWrOwvH8OyYw3f OXeCKKjj42jkxIlmf86J62RkMROMfARmUBuxmAiM92S1ZuseGAG0ByM56EMYjMESY8b3 KIKw== X-Gm-Message-State: AOAM531B9RluMFbVi7nLwg80as5eMFLp+28RnyWYl9xn1S9hJYc3QlEe /oDq0QKj/kAVKwmC42e7lthI58JbcrkZQW2qh0KlhaEKfMYIeUsz X-Google-Smtp-Source: ABdhPJwlitNmwUvJDaDX8CHXfR87tIXC9Pj5DjFG1Kqs8GcHBBOb4viCTqb8aR6fp2+Zxc7C4GynPlabsO41q5pN5nA= X-Received: by 2002:a5e:d918:: with SMTP id n24mr1154946iop.173.1628157103146; Thu, 05 Aug 2021 02:51:43 -0700 (PDT) MIME-Version: 1.0 From: Stevie Lavern Date: Thu, 5 Aug 2021 11:51:32 +0200 Message-ID: Subject: [Bug] x86 EFLAGS refresh is not happening correctly To: qemu-devel@nongnu.org Content-Type: multipart/alternative; boundary="000000000000c5881105c8ccdd02" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2d; envelope-from=stevie.lavern@gmail.com; helo=mail-io1-xd2d.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000c5881105c8ccdd02 Content-Type: text/plain; charset="UTF-8" Hello, I'm posting this here instead of opening an issue as it is not clear to me if this is a bug or not. The issue is located in function "cpu_compute_eflags" in target/i386/cpu.h (https://gitlab.com/qemu-project/qemu/-/blob/master/target/i386/cpu.h#L2071) This function is exectued in an out of cpu loop context. It is used to synchronize TCG internal eflags registers (CC_OP, CC_SRC, etc...) with the CPU eflags field upon loop exit. It does: eflags |= cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK); Shouldn't it be: eflags = cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK); as eflags is entirely reevaluated by "cpu_cc_compute_all" ? Thanks, Kind regards, Stevie --000000000000c5881105c8ccdd02 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I'm posting this here instea= d of opening an issue as it is not clear to me if this is a bug or not.

The issue is located in function "cpu_compute_ef= lags" in target/i386/cpu.h

<= /div>
This function is exectued in an out of cpu loop context.
It is used to synchronize TCG internal eflags registers (CC_OP, CC_SRC,= =C2=A0 etc...) with the CPU eflags field upon loop exit.
It does:=
=C2=A0 =C2=A0 eflags |=3D cpu_cc_compute_all<= span class=3D"gmail-p">(env, CC_OP) | (= env->df & DF_MASK);
=

Shouldn't it be:
=C2=A0 =C2=A0 =C2=A0eflags =3D cpu_cc_compute_all(= env, CC_OP) | (= env->df & DF_MASK);
as eflags is entirely reev= aluated by "cpu_cc_compute_all" ?

Thanks,
<= span class=3D"gmail-p">Kind regards,
Stevie
--000000000000c5881105c8ccdd02--