From patchwork Tue Mar 19 15:42:44 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: 781129 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997972wrs; Tue, 19 Mar 2024 08:50:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVEC4sao3HmpN5sw43FSnu3mRXOzfKqKWXGOVApV/vPCChAN1xzQpJScYDi0mf4yIVlCun+s9S6yvfiuJRACR0e X-Google-Smtp-Source: AGHT+IEyDI9LLA1fKYU+/NGM5q4R3VkC0vbHIgJjrFEsnzehdGAfW9SztnwxVvW1pyIIZQMYE61D X-Received: by 2002:a05:6214:16c9:b0:690:d4e7:1374 with SMTP id d9-20020a05621416c900b00690d4e71374mr5141129qvz.13.1710863429907; Tue, 19 Mar 2024 08:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863429; cv=none; d=google.com; s=arc-20160816; b=QXhhwraZ7SCWrX+SX6Qt/z7YSBziExadYj/ZurGVObLL9VbalcdSDwTrmMfuKhaoc8 jxE4c1dpXn5cKx+SbGUfMdqE12GPcgx4zLAdQ9SP1vaoasTv0ympT8sCdLUbg/FEXyLb I4MNi09fBG1oQW6Xq/kiaKzZaQuAU5Om3HPTQvHLc9+kSw2SNR7NNMiQxK0XDNA6ZL7x IzVwcnbJLleLeh+gx8Pqz1qsyuAyw0V+Zy/miW7wINHyrkNsUhPak8jJccQzVwg9Ea8s 3QSqDHbZILC0Z6e7zQiEbIYqCbgJtkM1ezE9Kz9q5p6KuMpWk6xPLdWGDdeRc50Mautp k92Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=goVPZjhGsrNSLmW6IZIplIeGALKCmKT21+JRh5OPT4g=; fh=p4hGACrHX2X1GiLaiJq9g2IPatQnGX5Ighpc0+KkQYA=; b=jeJttUan/9XscueUY/bqlYY7sfdJr4WiGHRakURF4xm+kCv3QoIuyRPUC6IUyDWCo2 b3uNNW2Rt1EmaEJDg7SOSZ+Z6UZIoCJaI0YC9+bIxfmquAslFcHFSbXRw6b+YdJKPPo8 aqhKukl2+ei5fSd25j9/r2smGWVuyg2lbdHqjK5rToH+bcmk/cAKq+Ik7FVDVAXwMnro 1P5hMgPHyI/TRXv+0oVDhAlWBiX5D5ipBPT/lB67ADo/yrzbEMNy6xDzB/cFozKaOiZN TMu1rXKr6/O3ZB10DYtYs/2eHtupjz9EQ7d+N1y0NeugwJsCmL2wdLFKOuqm82xVETHt EAiQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RF89ge2M; 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 ke8-20020a056214300800b0068fe276cf6esi10828629qvb.330.2024.03.19.08.50.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:50:29 -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=RF89ge2M; 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 1rmbeE-0000OT-0Y; Tue, 19 Mar 2024 11:45:06 -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 1rmbdn-0007Uw-Tr for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:40 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbdd-0005EA-J9 for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:44:39 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41461c256c4so9418585e9.0 for ; Tue, 19 Mar 2024 08:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863068; x=1711467868; 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=goVPZjhGsrNSLmW6IZIplIeGALKCmKT21+JRh5OPT4g=; b=RF89ge2MZ0jHRN0KR97wC/9dNKrOWqZ5vxM1+bvJ3kk78z1eRgfNk6GmenC7ohxWES GHcgFnzAm8Jx34p0plVoWm4BjvSojifDphY+U/zubykc+9Q7pOLhmbLxURSY7HPliMGm nInSFUdVY0T0mbO+Rpqr6NyumiHbHD9IcPsGCUTFUIf/t1u9IS9vLAWHlJ2M7j6zKfRs PilbfkICYH12MtRjOe3UtVLp0j+XhWb5n+38peOWDHAw09MnDDxOF7ksyvR/t9DBpl2j 4XcVAyTnNEokZkCkG0Q3UUYu5/9A9kXTBI9m0857V9JRisLR0PV3/M1WIOLtt6eHLZUh 4n7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863068; x=1711467868; 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=goVPZjhGsrNSLmW6IZIplIeGALKCmKT21+JRh5OPT4g=; b=JmbrClUXmmFGxm+A2qH7X2vMTieX3Jrqtc0HwpViQXj5X26Hh0Nij+TYXKuBrvWTIr UW+4cDeyV/Mitc2lAUchHnvsv8xwQuap3mle9h5lhFE+VEl8DWpY6KEdTpC0v9bxhVqP xeRP8Wf3aywgp3HpOlmiVMb0bl+wDLU7CT521oMByaz8IFHbpqG1ZDkU0Tj1/MCahFIj hEStS/H6LcvtMoRZEVxbRaEwfiH4PoXuCt0GI9xzPnEzcSpvI1ugbUSnyyaa+bNR8zYU wW1auD/S+jPvlHuyn28kn0dZauEvTv88Fh/69xTy8avzN+b8GaSvm9KuL46WeMEkCBB8 UO8g== X-Gm-Message-State: AOJu0Yxtzq4ghJewbYj1s+twZUPStjfzUGckVYJLMgo70p61w8kO474Z Jv8yxQwO0IYMfBH54P7dUprKWh02MZReFWGr3ZmPcUd6FLgyCsO6HtVj4Xilc4dSlDvCmkY9yih p X-Received: by 2002:a05:600c:314e:b0:413:ee58:db7e with SMTP id h14-20020a05600c314e00b00413ee58db7emr2335980wmo.3.1710863067825; Tue, 19 Mar 2024 08:44:27 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id u6-20020a05600c19c600b0041413546e5bsm5695602wmq.0.2024.03.19.08.44.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:44:27 -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?= , Chris Wulff , Marek Vasut Subject: [PATCH-for-9.1 15/27] target/nios2: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:44 +0100 Message-ID: <20240319154258.71206-16-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.h | 14 -------------- target/nios2/cpu.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 32002b819a..d0616723fe 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -286,18 +286,4 @@ FIELD(TBFLAGS, CRS0, 0, 1) /* Set if CRS == 0. */ FIELD(TBFLAGS, U, 1, 1) /* Overlaps CR_STATUS_U */ FIELD(TBFLAGS, R0_0, 2, 1) /* Set if R0 == 0. */ -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUNios2State *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - unsigned crs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, CRS); - - *pc = env->pc; - *cs_base = 0; - *flags = (env->ctrl[CR_STATUS] & CR_STATUS_U) - | (crs ? 0 : R_TBFLAGS_CRS0_MASK) - | (env->regs[0] ? 0 : R_TBFLAGS_R0_0_MASK); -} - #endif /* NIOS2_CPU_H */ diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 679aff5730..d1a98c47ad 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -43,6 +43,18 @@ static void nios2_restore_state_to_opc(CPUState *cs, cpu_env(cs)->pc = data[0]; } +static void nios2_get_cpu_state(CPUNios2State *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + unsigned crs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, CRS); + + *pc = env->pc; + *cs_base = 0; + *flags = (env->ctrl[CR_STATUS] & CR_STATUS_U) + | (crs ? 0 : R_TBFLAGS_CRS0_MASK) + | (env->regs[0] ? 0 : R_TBFLAGS_R0_0_MASK); +} + static bool nios2_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; @@ -354,6 +366,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = { static const TCGCPUOps nios2_tcg_ops = { .initialize = nios2_tcg_init, .restore_state_to_opc = nios2_restore_state_to_opc, + .get_cpu_state = nios2_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = nios2_cpu_tlb_fill,