From patchwork Wed Oct 26 02:10:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 618765 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp113205pvb; Tue, 25 Oct 2022 19:19:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nrDUVkJXy4WlBemzgME3tlmsRvFwQtczfVdexlPv85dmMIXazeIq+rwT/GNKItT8IWZqq X-Received: by 2002:a05:622a:15cf:b0:39c:4c04:107d with SMTP id d15-20020a05622a15cf00b0039c4c04107dmr34096858qty.122.1666750775531; Tue, 25 Oct 2022 19:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666750775; cv=none; d=google.com; s=arc-20160816; b=tQ0yYltnWXJq/Q4wnEOMqSyXkDFtuPlrM0QKlBzwDzfdw8RPHJZeFp3x0YJMvwXI5q BjwyW6uwXVLCdDuvaAodJnCAApbe5+d3Hfoz72FZ8w+FY7OnTWuAgKIh9ulMeaCusZnn FnteGTcCdVVUhT97NL+mlWhxxHHTTDI1Zq4dYy+1gnzgDHuiP7124VZ7k/8zy3NJkGHg eJTaUgrXTkwTj77840f3fU0AdsQkGvG+l+ac73thLX87Px6YtD9ywn/Kc0dtyL7yLymF 23zl9HpkXjIgY/QQ7Ii9y+Uw+9wcDDLn2R+wD2ioccl378FLeN/AveM+o93VgZwFcYCG 12bA== 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=MTYhZzWqH75b7i9XrWtJz4ZdUurs/QeXSrqfR/Rb3bI=; b=WU79ntRwTnSgWBinq3iYReqvOBPHVRU/PUkX98HdQw3MXC+3ZK1Q6fnvlTXO5jF+2b GBMFdBMpKN43HN+zMk2CvI9uVlIs5JnFi/rqic2CFlfsd6lb+NE1oWkO131o7+GTXlpK BPAt2DkIH2nNdufMtJaGKRKsGKC0hgQN6isr/7fRaU0K6odk9dEU/klUzE5XcUAGTbSr Q8ZX2Iu5wQMSeVlp7RWVEYEMAyZ4jdjvB0vJw70XmzJQX31JOGR0SyNuevGA5Ys8dDLo I9Ch8nNxhFaXZOwyoi4rZeq+lbW8woXQxN9Q7wLAi6rLn46dh4+zy65ttomf2M7JNp2M MnOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x57iF97J; 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 m21-20020a05620a291500b006ec5380ce5dsi3081490qkp.421.2022.10.25.19.19.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Oct 2022 19:19:35 -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=x57iF97J; 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 1onVuN-0005Ig-SD; Tue, 25 Oct 2022 22:12:43 -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 1onVuM-0005IC-5d for qemu-devel@nongnu.org; Tue, 25 Oct 2022 22:12:42 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onVuK-0001GX-5H for qemu-devel@nongnu.org; Tue, 25 Oct 2022 22:12:41 -0400 Received: by mail-pl1-x634.google.com with SMTP id j12so12691537plj.5 for ; Tue, 25 Oct 2022 19:12:39 -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=MTYhZzWqH75b7i9XrWtJz4ZdUurs/QeXSrqfR/Rb3bI=; b=x57iF97JFvN3DSTb0St8pnhXCIkcaaYcobsabfcMAX+V6/JooA78tvAiEZPja8M9ws gPlZnXNpVXJZ3MMSZTf8oxH1p9mTE1e1Tp1581atlYu1kZw84i3XDsH7bUJRLRkHiMBj cbB/dFxuHq6u6S6X7S/yGVBMrbxneDMK+/hf7M3rk0vyb8HO5vFRX3FgIgaHlhYfQO0b 8To5uQiykNbXEnpbj7lqPPkUQ4ihqqxiGzP0jxLdvH+yOJsG/Cg9T9X4Fl0GjPda+GTa WqqXL7mM0VQohgh6A2XQcSuAXGKaEO9cc/xJwBA1dnbFccJct+DXOlqgtpEKUCtlpnGl oS0A== 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=MTYhZzWqH75b7i9XrWtJz4ZdUurs/QeXSrqfR/Rb3bI=; b=Xs65re/Xe2Ea92wdYz4LZgA23tMYA8gE2lgx6W2z4CrR3X3reshYwc+Ukjdh6FMnZk lAnrpqMR4+1FtdqWK+fGHS9xovP1tbMZ/JhvvULyWuCxsMRqHimfgHGERqVQTLYnLafZ ZSUJQNvJ6kRbvt/2xmljBG3fTq72RHs4Oo3xnC5o6v/jqIYZTeeDDBH8p3762t52Z7aE 4U0eBhh8QmcLIxqM9//3oL/P6IitUs9c4n6oYcflWUovbwAPxF6bOSs/KUREGzuQ7Ur+ 8lQcj11cO+BIH005Y8Zdte7GO/bw1cCpdQiAE+5EuqyM3E5ognD0IeKXPY8ZtFErEwRq VdhQ== X-Gm-Message-State: ACrzQf2/eW5zbx0noCPM6Awd4BoHtxnBPnNcfEATBir8LOj2h4xOI6uR mk5VUeoQDfcNZ6sD2h3yWpXLRlPwnmN3QQUM X-Received: by 2002:a17:902:edcd:b0:17a:6fa:228d with SMTP id q13-20020a170902edcd00b0017a06fa228dmr41411096plk.29.1666750358751; Tue, 25 Oct 2022 19:12:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 19:12:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 27/47] target/arm: Convert to tcg_ops restore_state_to_opc Date: Wed, 26 Oct 2022 12:10:56 +1000 Message-Id: <20221026021116.1988449-28-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::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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/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; - } -}