From patchwork Mon Oct 24 13:24:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617879 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2750705pvb; Mon, 24 Oct 2022 07:14:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6TrYdRTbd4bJs1z6bVxtp0jbh0SDOfOOJ/bQGeEa5kkw2UUVnNdP+q0h6/5v5l9TF4UyNl X-Received: by 2002:ac8:7e91:0:b0:39c:ca6a:e482 with SMTP id w17-20020ac87e91000000b0039cca6ae482mr27496871qtj.507.1666620887813; Mon, 24 Oct 2022 07:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620887; cv=none; d=google.com; s=arc-20160816; b=SdYUv9vVzcMP+VxkHi7SvPaYxnMxCC9RTFNC6Mhb2wfiYSgdrO8MB2cr87YA8RvHQl 2ft3ZpEXQvGkqRCpeXFaqziLRbf/9NvJszm4vo5Qp+w50y9eNYbpcgE2IRGMPkxXLv+g jabltxv8pM5LcbgKtHNr58qgvA/qL+//aTka8W0udG0RUsaLMk6FnrsrzffpH2a6pekO zJeSEAV/HbCL9C7cgQ2JUsGKjkr5z3Rbe3+DFzwAO7zl3gwUgKy3/huPZAf69ToX0GK3 +0QEqZPAF9D9qso9UBfIenscaN5KnUb2ax/g1DM5Zyx29ogQLdyXL8QTnhOJZ7W93+8s n+4g== 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:to:from :dkim-signature; bh=FZc9mr+Lj/5v+/f/s9nBwTEyh4pQeC09vzywJopn5pg=; b=RbgLK3v3wUbUkv8H1xWRZ8U6jXNf/tt8T00FsVNMyZzm/IQftijdEB5WAavXu6cAOg pIpNS2UhjLLkmqLmpLq5DitErPRs6+8oKTddCAtM2AeyHZanfo1zBlsyRnZAmBUHuORs atFn0ihXmPGJ6PC1Q2o4DfKv8zyB4VtmZ+LSuzSJKXGOXZPunDirkPlNm5H9laK3QLVs 7KK9c0+pKxwWV22wP+OSydDQMmm2hVc+xZA2w937FocHcgRObxXXAvpPa8zU5deoai1I Epuwf9PFjOWi8SesHTTFuzD9DvT97eDDCKyXX+oPgoFe5iE03B/LpUw0LVWumtlNFkfj GxdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bzq+lTPh; 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 fc24-20020a05622a489800b0039a2242a68csi17181689qtb.645.2022.10.24.07.14.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Oct 2022 07:14:47 -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=bzq+lTPh; 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 1omxSK-0003FI-60; Mon, 24 Oct 2022 09:25:28 -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 1omxSH-0003Cz-3U for qemu-devel@nongnu.org; Mon, 24 Oct 2022 09:25:25 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omxSD-0003tv-Rp for qemu-devel@nongnu.org; Mon, 24 Oct 2022 09:25:23 -0400 Received: by mail-pl1-x62b.google.com with SMTP id u6so8408504plq.12 for ; Mon, 24 Oct 2022 06:25:20 -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:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FZc9mr+Lj/5v+/f/s9nBwTEyh4pQeC09vzywJopn5pg=; b=bzq+lTPhnonF8y1A5z0S/iaWskTTjwoelDSoVgOvk3fPddVSF3CfYmDIw0x8n42zDD cpPhp/g9MVj3QhOu1qer09JHsh/UhYA7OyaAH/TRUEp6WabOpHa6wtUDFUgQw1/TRS6x onF8JlLOUtpUwgDQop95o1jSQeo/Hb2Hln+PgguyENlW6fAXcWy3AWYtB4hYTRuzhnXr hbvUb3c/ESvNYTqeLNqzdIGBHTK1JdqW7wYG7sTFKk1Pm2R35HOu/AzfDFcaOs/pffAc RZDHokDFS4C6WrIvltN3ZE3D1IHcuH8sgpdzR+0tIWOPoENwHCqhhUxZytc2a+uITmw2 /RIw== 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:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FZc9mr+Lj/5v+/f/s9nBwTEyh4pQeC09vzywJopn5pg=; b=OhJeM5KqjtrTix+dNVGTESCXShcXRp8rWNBoWVE36679Rr1SYRcYF08sc/rloTqOVi wNZDIw4vvPP/fDjTsoIb718k8sJAu7k33oNPlHORZ/oPYPwK/qI9/3uV1VI3RuAIdQtH IkiHYgon7KgDJlaJrQCa5YZbBdMKCmcbKxt3HfzABF4ioVUNz6dU5XO90exw/TwzRVZm P0iLV/MQKxgRtmgiAmXJQ+SJ9o/z6g/+ZwOApUvibdKAeKfInUm55ReUZv7JemJSdhXs RI4p0IDuRALgG9fE2MleNsYVb8IjeCs2Y4GHgh3WNHinIwlXicTv/wkB9nmRolBND7CN sUKA== X-Gm-Message-State: ACrzQf3xrtezeZqxDVEj75SDt/zsGJmgRoOfXs1GiH3sVR5BgmKi5T31 qI9YO01wWJ15LAtCpco1n8IN0YOkQrqYmw== X-Received: by 2002:a17:90b:1e46:b0:20a:f9d8:1ff7 with SMTP id pi6-20020a17090b1e4600b0020af9d81ff7mr75993021pjb.34.1666617919406; Mon, 24 Oct 2022 06:25:19 -0700 (PDT) Received: from stoup.. ([103.100.225.182]) by smtp.gmail.com with ESMTPSA id b12-20020a1709027e0c00b00178ab008364sm17009216plm.37.2022.10.24.06.25.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 06:25:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/29] target/arm: Convert to tcg_ops restore_state_to_opc Date: Mon, 24 Oct 2022 23:24:33 +1000 Message-Id: <20221024132459.3229709-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024132459.3229709-1-richard.henderson@linaro.org> References: <20221024132459.3229709-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 26 ++++++++++++++++++++++++++ target/arm/translate.c | 22 ---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 0bc5e9b125..0a7bfbf999 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -90,6 +90,31 @@ void arm_cpu_synchronize_from_tb(CPUState *cs, } } } + +static void arm_restore_state_to_opc(CPUState *cs, + const TranslationBlock *tb, + const uint64_t *data) +{ + CPUARMState *env = cs->env_ptr; + + if (is_a64(env)) { + if (TARGET_TB_PCREL) { + env->pc = (env->pc & TARGET_PAGE_MASK) | data[0]; + } else { + env->pc = data[0]; + } + env->condexec_bits = 0; + env->exception.syndrome = data[2] << ARM_INSN_START_WORD2_SHIFT; + } else { + if (TARGET_TB_PCREL) { + env->regs[15] = (env->regs[15] & TARGET_PAGE_MASK) | data[0]; + } else { + env->regs[15] = data[0]; + } + env->condexec_bits = data[1]; + env->exception.syndrome = data[2] << ARM_INSN_START_WORD2_SHIFT; + } +} #endif /* CONFIG_TCG */ static bool arm_cpu_has_work(CPUState *cs) @@ -2152,6 +2177,7 @@ static const struct TCGCPUOps arm_tcg_ops = { .initialize = arm_translate_init, .synchronize_from_tb = arm_cpu_synchronize_from_tb, .debug_excp_handler = arm_debug_excp_handler, + .restore_state_to_opc = arm_restore_state_to_opc, #ifdef CONFIG_USER_ONLY .record_sigsegv = arm_cpu_record_sigsegv, diff --git a/target/arm/translate.c b/target/arm/translate.c index d1b868430e..74a903072f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -9939,25 +9939,3 @@ void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_insns, translator_loop(cpu, tb, max_insns, pc, host_pc, ops, &dc.base); } - -void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, - target_ulong *data) -{ - if (is_a64(env)) { - if (TARGET_TB_PCREL) { - env->pc = (env->pc & TARGET_PAGE_MASK) | data[0]; - } else { - env->pc = data[0]; - } - env->condexec_bits = 0; - env->exception.syndrome = data[2] << ARM_INSN_START_WORD2_SHIFT; - } else { - if (TARGET_TB_PCREL) { - env->regs[15] = (env->regs[15] & TARGET_PAGE_MASK) | data[0]; - } else { - env->regs[15] = data[0]; - } - env->condexec_bits = data[1]; - env->exception.syndrome = data[2] << ARM_INSN_START_WORD2_SHIFT; - } -}