From patchwork Wed Oct 26 02:11:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 618777 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp115281pvb; Tue, 25 Oct 2022 19:24:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BVbgUmz+9+yFZxdnWNq42QwXkw4h0Rabd9bvmb81dUUWCJFpXzPYyZm0VmNokyJrjMgH1 X-Received: by 2002:ac8:5705:0:b0:39c:fe03:5ee2 with SMTP id 5-20020ac85705000000b0039cfe035ee2mr29982249qtw.344.1666751063649; Tue, 25 Oct 2022 19:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666751063; cv=none; d=google.com; s=arc-20160816; b=kXZDCO112+Ikyf+jZmE/ViVlOUp8RXYQs3TkqWPfUn45k1WV9AUDPr60kNuMqH7Gu1 LnOfYo6XLbJVTd3lBlPYUcgnNElXB4vxUIHhMFbF2fVtqA72tx3+Jh9DZheVGuh62p8u zBf6znN4ay4GvAZ+/PsITZXdhcH/XAr7bAIAFMh1rXYxQ5Y9f7aZIRwdVxacm83/jNZZ Zzez+y42+uwvidX7x+SOaOKJrgKgYMkZgKgKBz/hADNySDH38/3LN05H2nv8ChlhbRhd CZrpWoc+zwVyhit/I2H7KQvkmHTp1183ytIx0ge5d6IxDUd/gU0zwW5/4sDyHXnlCj/3 SO3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sCi48ZqO6AkPMJ+ZyF18T2s297T/4zk3YpQYq8qyJcQ=; b=rh/2wgRoqihZfsPx/FHvLevNX0/Q6OX96eMfvqy65QhQCoa3XCNKC5/LXJAnBQiuSK Q703VLz84cn1X5RqHUkgR1mdwkFVoMLL6icYRSyIWA0wrbx3XAEA8fZ+1b4JZ3c07PFw 8QRM+mxoWHP6EczeaDgsHCm4d8sMpEw4qly74GnBMG8Q/RUh36xouDxNXc5plDaxNDpz pfRQ/krvX4CWlaMSk0WXAPnaoPA8nsS1JOzT5Dgx5P6VRs04oVFx1i6KL5pjE9lf7YF2 hPaRHcwubO8zZCsw0rW97g7tQuesPixUB7fy36wIAuPwNC5idiLhLjLxYESQDc9nyW1c qoBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MRRBpFJL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f7-20020a05620a408700b006e67781989csi3236464qko.375.2022.10.25.19.24.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Oct 2022 19:24:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MRRBpFJL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onVuZ-0005Ki-NP; Tue, 25 Oct 2022 22:12:55 -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 1onVuZ-0005Ka-2i for qemu-devel@nongnu.org; Tue, 25 Oct 2022 22:12:55 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onVuX-0001I1-GB for qemu-devel@nongnu.org; Tue, 25 Oct 2022 22:12:54 -0400 Received: by mail-pf1-x42c.google.com with SMTP id k22so2219873pfd.3 for ; Tue, 25 Oct 2022 19:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sCi48ZqO6AkPMJ+ZyF18T2s297T/4zk3YpQYq8qyJcQ=; b=MRRBpFJLTkB1PUXL4scR8hNxrtJjCJfIAmF5CzC95ImTIe2BoE818XksIAjNPMWRy9 clxQgb/nkMp7AcwdSq6ChaJAI1/Wg1GwmvBTx0g41Wv6FkRKaVCbdeP52QDo7vQrsPbo xXY4ivL3Kuc0ng9J2uLsyNLng7eZ41siFWWlAExe46X8LpOOF0e9Pst7uKscyedo6td6 NH1aC7jNAOfpCCC/T/6YuAeAk9hjAS2ifzaVNgukPg6hDntuIHrFNxWBcb+HYYj7WkOG 7yB6kzvOAR5zK0cdAA5UbynCI+Rnz/7ryWbInbLTLBIm83PhtI1ZvF+Qdfm/nlsFjtGT 7D1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sCi48ZqO6AkPMJ+ZyF18T2s297T/4zk3YpQYq8qyJcQ=; b=wQ1l5ZqC6rF8qQETLXvpCiy0OWy3tm9srf3/I9LsjfSG4tsnZqZWjNVW0BLcMxXQ6L 1tW6sm2/iqwzPS79/37lx8dWxqHLz3KIcksZux15eYxhvHf0NPG1uZRsgppsN7qNFC3Q PbXabisAYH/26YG5scKmW0eALzFFrz8YQEYsQkQu7UnXjcEKt3/n6JcoUP+dYcjh4J6u DJeOGAcGR//dSfb6hmZE4Dqn5A5zdmM2LzK+TQeq3RFHidZVMQi3fak4zdY9ck1yFdKm qElTeBt+tfJI3kNyuhAtQY3Qb2+pWkXCJUtVEHTjwBsPJsRZlqMQ0NPBP8nVSg1ju+Ee /ATQ== X-Gm-Message-State: ACrzQf1sByna46VURTxb4Eh1roN3rewxUvHMjuyT1vDmrjhVFtcP3MdS uT/vzuQDAdCNLKSyh6kc6BYjNpPfsxqY4bWp X-Received: by 2002:a63:e74d:0:b0:440:6c50:eab7 with SMTP id j13-20020a63e74d000000b004406c50eab7mr34930607pgk.308.1666750372199; Tue, 25 Oct 2022 19:12:52 -0700 (PDT) Received: from stoup.hotspotlogin.services ([103.100.225.182]) by smtp.gmail.com with ESMTPSA id o29-20020a635d5d000000b0043c9da02729sm1897833pgm.6.2022.10.25.19.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 19:12:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 32/47] target/i386: Convert to tcg_ops restore_state_to_opc Date: Wed, 26 Oct 2022 12:11:01 +1000 Message-Id: <20221026021116.1988449-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221026021116.1988449-1-richard.henderson@linaro.org> References: <20221026021116.1988449-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/tcg-cpu.c | 19 +++++++++++++++++++ target/i386/tcg/translate.c | 15 --------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 828244abe2..79ac5908f7 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -56,6 +56,24 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs, } } +static void x86_restore_state_to_opc(CPUState *cs, + const TranslationBlock *tb, + const uint64_t *data) +{ + X86CPU *cpu = X86_CPU(cs); + CPUX86State *env = &cpu->env; + int cc_op = data[1]; + + if (TARGET_TB_PCREL) { + env->eip = (env->eip & TARGET_PAGE_MASK) | data[0]; + } else { + env->eip = data[0] - tb->cs_base; + } + if (cc_op != CC_OP_DYNAMIC) { + env->cc_op = cc_op; + } +} + #ifndef CONFIG_USER_ONLY static bool x86_debug_check_breakpoint(CPUState *cs) { @@ -72,6 +90,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs) static const struct TCGCPUOps x86_tcg_ops = { .initialize = tcg_x86_init, .synchronize_from_tb = x86_cpu_synchronize_from_tb, + .restore_state_to_opc = x86_restore_state_to_opc, .cpu_exec_enter = x86_cpu_exec_enter, .cpu_exec_exit = x86_cpu_exec_exit, #ifdef CONFIG_USER_ONLY diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 85be2e58c2..546c427c23 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -7023,18 +7023,3 @@ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns, translator_loop(cpu, tb, max_insns, pc, host_pc, &i386_tr_ops, &dc.base); } - -void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb, - target_ulong *data) -{ - int cc_op = data[1]; - - if (TARGET_TB_PCREL) { - env->eip = (env->eip & TARGET_PAGE_MASK) | data[0]; - } else { - env->eip = data[0] - tb->cs_base; - } - if (cc_op != CC_OP_DYNAMIC) { - env->cc_op = cc_op; - } -}