From nobody Mon Nov 25 09:21:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716538350; cv=none; d=zohomail.com; s=zohoarc; b=VWucWSt6XG4GCmXSJXy5/7MC1rIol554uHC/B3VL/xKCwkt+OPGt2M/+YOREWBHJdUHeXf8Mb+OejMa/yIB5z3Qqf9x/IVqSK/wSr2lwg/DfbJTTVQ4WrTBcmTUn3tLSCFIMVcOccRdE3lNU8bSMDDm67ql6CyQq4a3kq0Hrt1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716538350; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=72PbcHRv/pFHTWTtQDS+C3T5q7MCkz97s7uPdQE0p0s=; b=BMoyaPQ31Tf5a4ITJhPYbFFuckVO4kFiol+0vWubvN2tkk+5Z8cDP9PxR5Jqg1fV0Cvfm8/UEoxG8HSRvGdP7IYWTDepLFD6oQ7xhpjCCk4rHfS2FH3PbYdDpSF2dOMFCqEwrAEtOVACSkkp5KcUeW/AGUst26nQB4RpDKtXEXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716538350075163.34162431964046; Fri, 24 May 2024 01:12:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAQ0a-00053h-9U; Fri, 24 May 2024 04:10:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAQ0U-0004yd-O8 for qemu-devel@nongnu.org; Fri, 24 May 2024 04:10:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAQ0T-0000Kk-8d for qemu-devel@nongnu.org; Fri, 24 May 2024 04:10:30 -0400 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-k4kATvNQNva3TXGFF9Gxjw-1; Fri, 24 May 2024 04:10:26 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a6269ad7288so23368966b.2 for ; Fri, 24 May 2024 01:10:26 -0700 (PDT) Received: from avogadro.local ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a626cc8c287sm89414966b.162.2024.05.24.01.10.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 01:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716538227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=72PbcHRv/pFHTWTtQDS+C3T5q7MCkz97s7uPdQE0p0s=; b=X12wOEFrzSirl9TMVUMcdbYc+zP6tDTPWtdaTSd62YjYiuotuetic7BEY42ANSk9K6xXV0 wFRiXL7jsbgbO/FnnkRUqcxQO/fDIXq4X/Nh5BTgpD4outEsf3vfeUDIB0kztSQ9B66bHK Y6EX2u/crUjDGew//nexWCsy6Q6/c+M= X-MC-Unique: k4kATvNQNva3TXGFF9Gxjw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716538224; x=1717143024; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=72PbcHRv/pFHTWTtQDS+C3T5q7MCkz97s7uPdQE0p0s=; b=A1nzt5j3HZZDypg0toBVYJQaEUGi7zr181eQATCzr+Xtre07D151S0jj3vi88P0vFx yTu3xhqDFEoZ+NanCUq4HYDLq0QGoPY5XKbDr3YmYsGdNjRF7OSzTeSYtwo5HA7od7+n dUGqR1x7WpRBQoiTebMbLPYDsSfJQKeST1dhEFfnsN6h/E/6W8uB6lAt21ADTcPbBr2l j553BrQeMuPhzseUtOaXlHtYx4ffd11oMguJF6aQKdFUEICnzw/+wOscwS/ZVf3ogEHL kpUCwFNU1j1/6hrA6lPGpzPSXygbHzw20BXSoamNlkY0I2A7g5KVhNCqBdIp07o2UxQr edRA== X-Gm-Message-State: AOJu0Yxm4BNoAzp6pP8xSZTVUS8MOQ/QXo4QAsk/Evg1AZHyG7LhHVdd 3XlhLNsXSSCsSL/aiq8vB/BDybXxBuldTDq0zrCOcuyH2Dfyu2Bily9MWQ9JgodOyW4+ivX7rCQ Dbh1lRMAvCcHaYrqAhR7bAt89Wc2KL2fGGNLZv0++GG36K9Ywiru8pC1cXHrO+r6rlX4nEmAJDp T8kZOi7jA/rK7r94s4WUUZd1D8MsVwIjgR5Cqy X-Received: by 2002:a17:906:2b82:b0:a62:2cae:c10 with SMTP id a640c23a62f3a-a6264f1600dmr109627566b.47.1716538224433; Fri, 24 May 2024 01:10:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVe1dL0yunhUsZRGQ99Cw800q/hFGYEbQ+PG473cDCldXlnmQ5EkE3CLVzZ91/CxAnN8E13w== X-Received: by 2002:a17:906:2b82:b0:a62:2cae:c10 with SMTP id a640c23a62f3a-a6264f1600dmr109625666b.47.1716538224009; Fri, 24 May 2024 01:10:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 02/16] target/i386: cleanup eob handling of RSM Date: Fri, 24 May 2024 10:10:05 +0200 Message-ID: <20240524081019.1141359-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240524081019.1141359-1-pbonzini@redhat.com> References: <20240524081019.1141359-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716538351096100006 Content-Type: text/plain; charset="utf-8" gen_helper_rsm cannot generate an exception, and reloads the flags. So there's no need to spill cc_op and update cpu_eip, but on the other hand cc_op must be reset to CC_OP_EFLAGS before returning. It all works by chance, because by spilling cc_op before the call to the helper, it becomes non-dirty and gen_eob will not overwrite the CC_OP_EFLAGS value that is placed there by the helper. But let's clean it up. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/tcg/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index f44edb3c29c..3c7d8d72144 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -4488,9 +4488,8 @@ static void disas_insn_old(DisasContext *s, CPUState = *cpu, int b) /* we should not be in SMM mode */ g_assert_not_reached(); #else - gen_update_cc_op(s); - gen_update_eip_next(s); gen_helper_rsm(tcg_env); + set_cc_op(s, CC_OP_EFLAGS); #endif /* CONFIG_USER_ONLY */ s->base.is_jmp =3D DISAS_EOB_ONLY; break; --=20 2.45.1