From nobody Thu Nov 6 12:12:20 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 1540929232812820.4372521012232; Tue, 30 Oct 2018 12:53:52 -0700 (PDT) Received: from localhost ([::1]:55222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHa5H-00033j-HD for importer@patchew.org; Tue, 30 Oct 2018 15:53:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHa28-00082P-VT for qemu-devel@nongnu.org; Tue, 30 Oct 2018 15:50:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHa25-0002Hl-M9 for qemu-devel@nongnu.org; Tue, 30 Oct 2018 15:50:36 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39022) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHa25-0002Dt-CX for qemu-devel@nongnu.org; Tue, 30 Oct 2018 15:50:33 -0400 Received: by mail-wr1-x431.google.com with SMTP id r10-v6so13975942wrv.6 for ; Tue, 30 Oct 2018 12:50:26 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id g76-v6sm17480094wmd.25.2018.10.30.12.50.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 12:50:24 -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=Uw0478a/NZuYiRTAYy5+GpCx7zq4hCEZS8oy5z4+WYw=; b=bCv1sp2OA6lFGutGuuxDvlCIu1kMIrE2gScy9xYUSrgfl4Bff6YrqCu09vHRmz3Mhj FY+lJ2e2TdzmhHYMJLaNfdHoBlkG7WhN0u2hduJuBNbpm67RZoE/LfF/XmLqfxLS10Y/ mFC73o/eBBt8EagMzKvLuFgMad8Fg/pSWvBlgN8Zqpz7Im7HK6nF/vJlutpTXj3JUE9g n/RZIqlexEOHxBb9dLsMz2fGCVAs2nH+nvjwN3g2vH8UQTMFNYgnAQuHdFOM+VWnmo4P zoJtDGIj39G2ZwxpaZmfxcQp0b+/yG7xMOyn+Q8OfHAg1Mnlxaj8+xQBlDcBHQJx/zlp NbOw== 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=Uw0478a/NZuYiRTAYy5+GpCx7zq4hCEZS8oy5z4+WYw=; b=Wzsuu9pW0ei1/sKRGksM9BNxxIAFdpYC8d/6d0WYesn4B2GiTUk+cOL4s72RZJxCAc DQGoo4l/V3S3b9sUj0LVJsfr4WPO5QLzk/+c7nXcgRDbL7e3QJ5ttKWPZ0vsNZG7EqVZ P5GbdvhGX+0jrV/+0U4ZuNiHXkg4YpEJ4A4R5i0XeFYn1nGP7deQzf2/ZkFlkbt+Oa0z QsHQRgaHRHegAwq9wF6Fv4oRVc6/UbqFm5klCtXCBHwan5UoaQLXKEDn8mFBUbvzxVlL 1c6BJVbWJKI8FebHnOfYTepHVoIi49Z81JuJuKISBZYnFd/uxtDWrAi3crEDWDKiYyG2 A6gw== X-Gm-Message-State: AGRZ1gJeQiBdimmNPxoTn/h9gmQj02+fVUUrELt0Yk3SQ38m3fC9Q+JH mv7i299om6ydyl1zYp/jOIJ3RLHP X-Google-Smtp-Source: AJdET5f+6qiYGr4FM5aKv8CfEUas7xsziKkn2+WIfYBs4Bi6UT6RsbBxej4OSUIPjUG5u+za5/Ua8g== X-Received: by 2002:a05:6000:10c4:: with SMTP id b4mr69237wrx.135.1540929025567; Tue, 30 Oct 2018 12:50:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 20:50:06 +0100 Message-Id: <1540929011-19894-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1540929011-19894-1-git-send-email-pbonzini@redhat.com> References: <1540929011-19894-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::431 Subject: [Qemu-devel] [PULL 05/10] target/i386: Clear RF on SYSCALL instruction 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: Rudolf Marek , Roman Kapl Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Rudolf Marek Fix the SYSCALL instruction in 64-bit (long mode). The RF flag should be cleared in R11 as well as in the RFLAGS. Intel and AMD CPUs behave same. AMD has this documented in the APM vol 3. Signed-off-by: Roman Kapl Signed-off-by: Rudolf Marek Message-Id: <20181019122449.26387-1-rka@sysgo.com> Signed-off-by: Paolo Bonzini --- target/i386/seg_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/seg_helper.c b/target/i386/seg_helper.c index 33714bc..63e265c 100644 --- a/target/i386/seg_helper.c +++ b/target/i386/seg_helper.c @@ -991,11 +991,11 @@ void helper_syscall(CPUX86State *env, int next_eip_ad= dend) int code64; =20 env->regs[R_ECX] =3D env->eip + next_eip_addend; - env->regs[11] =3D cpu_compute_eflags(env); + env->regs[11] =3D cpu_compute_eflags(env) & ~RF_MASK; =20 code64 =3D env->hflags & HF_CS64_MASK; =20 - env->eflags &=3D ~env->fmask; + env->eflags &=3D ~(env->fmask | RF_MASK); cpu_load_eflags(env, env->eflags, 0); cpu_x86_load_seg_cache(env, R_CS, selector & 0xfffc, 0, 0xffffffff, --=20 1.8.3.1