From patchwork Tue Mar 19 15:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1913649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JLVbFVuQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TzbfZ2MPbz1yWs for ; Wed, 20 Mar 2024 02:45:58 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbeF-0000Zk-Tv; Tue, 19 Mar 2024 11:45:07 -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 1rmbdr-0007kC-Kq for qemu-ppc@nongnu.org; Tue, 19 Mar 2024 11:44:46 -0400 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdj-0005Fj-7Q for qemu-ppc@nongnu.org; Tue, 19 Mar 2024 11:44:43 -0400 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d109e82bd0so75745781fa.3 for ; Tue, 19 Mar 2024 08:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863073; x=1711467873; darn=nongnu.org; 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=3lvebIFUNGxL/tpQGaVwXk03NyH8W0xBvPYOuRzOi+E=; b=JLVbFVuQvyTWpqOjNGhS1mdR4Eb7u9ILbUVxcONSzcRy7xc0qnQm4knfbPtXCXn1lX nIyo5ABEDCuZQFfQsMkDWSKZrKeYx66KZvrjnwGcVGb0RHP47BL2NEcE1HsYtz81NmuB LrIZAwjX/U9GQ9pUuj1UF/CKrpeEvlpEJ8KpaQR0R4w3q9eJNZm7PFQp7uqokzv5XnG3 bKVUO4pn7y+IuL8zff2s0RWyrFvecoIaN3tCpPciHWtTtwQKdxFrSEsE4IBVBrW7gZBj nUGAtg6YaYtQW+C8d+8RW84Okdqsxf7vxtqvnaogGSidp23DZK9tq6ma4Q12TJIZmw3c doYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863073; x=1711467873; 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=3lvebIFUNGxL/tpQGaVwXk03NyH8W0xBvPYOuRzOi+E=; b=J5iyewDVRj3cp21kqpz/E37dmG08OVUl9HOLRzQIzJQVtS+eUbP4/pAqAMNeJLM60u oswJlv316Pec6ZUxyKVfUKcFIuxUV4pPP0TV/6eJltbgh6hFEXYQykuY+55J1L4FGQbZ /mJmliBJMGOS/v10/2lat8KwLRY/YV6uz/XzBd3Eeb6ddOe3GfWmJifJk79xLqzfttOM s28AtWc6hk6Y8yiUYJSUIF8y+EnEl3bSDAhochyWjiCp2t1dZZyaOmew8sG9/CkbLWNw VQA+zaFvgcUtVwfq2xA7DyicAUiXiRNjN1T44dVbv3t/2Iy7Wt0CyyOJgOrc659rN3D0 p+mg== X-Forwarded-Encrypted: i=1; AJvYcCVJvtfYnluFy/FIv3j1UW2IhTZKU7ucJBOduHW9GMEI+zoAo50kkTEckyL1h5QABoizRdA2ig1gr21a6jeLvEwp5zTk X-Gm-Message-State: AOJu0YwGOmY1trhJyG9ig3qi9tOwh04YSv3lNwIGCHFuclQz9TbLlJ81 e0h5+UVe7dCI9yC+TVoSKVRjKNSIl+OSB19SK5rpF2A9zHek78yycUyxezOP/hs= X-Google-Smtp-Source: AGHT+IEpajiD9qxxbtkv05Ua+J05mfm0t+kemyVFtmrEfAGspXNdnYq1S8DkETH+IrACmYvE4EYSow== X-Received: by 2002:a2e:88cf:0:b0:2d4:b153:57ab with SMTP id a15-20020a2e88cf000000b002d4b15357abmr1777709ljk.47.1710863073392; Tue, 19 Mar 2024 08:44:33 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id i13-20020a05600c354d00b00414612a43a9sm4000401wmq.28.2024.03.19.08.44.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stafford Horne Subject: [PATCH-for-9.1 16/27] target/openrisc: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:45 +0100 Message-ID: <20240319154258.71206-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=philmd@linaro.org; helo=mail-lj1-x22f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.h | 12 ------------ target/openrisc/cpu.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index d42800242f..6997c7534e 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -351,18 +351,6 @@ static inline void cpu_set_gpr(CPUOpenRISCState *env, int i, uint32_t val) env->shadow_gpr[0][i] = val; } -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - *cs_base = 0; - *flags = (env->dflag ? TB_FLAGS_DFLAG : 0) - | (cpu_get_gpr(env, 0) ? 0 : TB_FLAGS_R0_0) - | (env->sr & (SR_SM | SR_DME | SR_IME | SR_OVE)); -} - static inline uint32_t cpu_get_sr(const CPUOpenRISCState *env) { return (env->sr diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 33c45dbf04..ce44ac0316 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -62,6 +62,16 @@ static void openrisc_restore_state_to_opc(CPUState *cs, } } +static void openrisc_get_cpu_state(CPUOpenRISCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + *cs_base = 0; + *flags = (env->dflag ? TB_FLAGS_DFLAG : 0) + | (cpu_get_gpr(env, 0) ? 0 : TB_FLAGS_R0_0) + | (env->sr & (SR_SM | SR_DME | SR_IME | SR_OVE)); +} + static bool openrisc_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | @@ -229,6 +239,7 @@ static const TCGCPUOps openrisc_tcg_ops = { .initialize = openrisc_translate_init, .synchronize_from_tb = openrisc_cpu_synchronize_from_tb, .restore_state_to_opc = openrisc_restore_state_to_opc, + .get_cpu_state = openrisc_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = openrisc_cpu_tlb_fill,