From patchwork Tue Mar 19 15:42:54 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: 781123 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1997026wrs; Tue, 19 Mar 2024 08:48:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWil5t7Bc0QxciKAB1nhutlf6wSzbbArJkB7As2XLeAJoYOZsgtHTuD0RFDkDjxcPfbWLnQgD22bCGAvbDHweXq X-Google-Smtp-Source: AGHT+IHHl2jJmYWSIwM3dACdjm2fk86tBdKaVSyWFZaR1ADBPes6EDRZoi2LH+mMt+k3RhDZGTqm X-Received: by 2002:a05:6808:2087:b0:3c3:6dc5:c1a1 with SMTP id s7-20020a056808208700b003c36dc5c1a1mr18665036oiw.41.1710863284945; Tue, 19 Mar 2024 08:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863284; cv=none; d=google.com; s=arc-20160816; b=Rra4v+LjoIQ5A39+/Zv1b8ZqNpJz+mLM2s1dMjFfIJj+vDnyKxYCbraeWaXHWUotIq mz9Niwb1NIXgrffsaedi+KpgrmfkxYEVqIiulzzKxp+9kFYRgp8LfbR31+hQplreGEgN F2g/eHjTXRERTHC3Vt/s1k/X6Cc5aJ9lrYxLGcwl+3mKEfk8gPreEr1y6hpQ4cQDgcDd I0F9K0h9vtXwOdUklH0g8CcddgcIJ1SjS5tJaPlftUSZWly/w6D45v+6kPmFnlNpJuGA W/J8d6N7VHXJU62FzHxfyICxaxFr8w5QxcOqK5FYdaZgjMP/jdIB+EiqzYplf7d+jRQx +yGA== 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=cuDVEU6xu2/Is+40NdFmTs6boTjeWsn71DRjetsl+yM=; fh=PnH/izz3MAsDSl6BnpnG4uXAuLuXCIaBKLWo6Q2UO7A=; b=GelytcqoAzWjx9s6D7HRcB3ffHNQfgdcNDz7YmPaoNEtB+jcZwsq6Q51LP+XJE1j9a LLKzhqPVuYLZYInCPtI/7Ei/QGLYQpkoVI6+Atngi+nMh5818x6v3GxGjx0k3xAWUwXs M7ACXaW2+i9iUN/RpVBOjIrRmzTYvFrKiOdaFgk6A3ShrdpVTRldQz6c4HbLTf4J5wER Fe0TFT9XhoTUGvn3ujjLEYk4PV08okR+9qy22zWLHrydfoFbcFAWv2Ltrvde3zEB/CSW DmxFzDiOBEzw9tlKeaKkfYy7k7OtRpFsk5bxe20ql/eTYC3OmyLQYyjfRsF+HLx883Qv RwvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w4dAN8yZ; 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 fq2-20020a056214258200b0068ce5582563si11302785qvb.263.2024.03.19.08.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:48:04 -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=w4dAN8yZ; 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 1rmbf4-00030n-DD; Tue, 19 Mar 2024 11:45:58 -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 1rmbed-0001mc-5q for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:32 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbea-0005qN-CY for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:30 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4146178270dso8472855e9.1 for ; Tue, 19 Mar 2024 08:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863124; x=1711467924; 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=cuDVEU6xu2/Is+40NdFmTs6boTjeWsn71DRjetsl+yM=; b=w4dAN8yZnbe9OQi8Q5jpt9VuXwPdpincDvfrUkJG2ny8jJnZ2CkyG7Mgfr0rf8rrMC ZwZlO2SIR8xwkf0EYV6k1/ZE36N4MyZiFmFeeKigce+rNyYaLok+1hReEuyukCNmTEjl YY2QYAdaRPwbQKjvnJuGm3RIQkZxkuPophsayJ787RA0HvNamuSE/piBxbSvIZ28MOaF 0sHm4mcMTYViEVWlgWjARkffUMSah01nqL9TLElfaPy1zzV+18R5WieJc18nq+ITuMuL rMVNePWAT0XUOqvhHvRH3LHnD0N5bTW6t6hKBHVNaSdz0HDZyAQ1gdG8+K2TmNLFvAsM 3ILg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863124; x=1711467924; 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=cuDVEU6xu2/Is+40NdFmTs6boTjeWsn71DRjetsl+yM=; b=NyTFemnQAziHwXISY31rVWaipCzTsHxNve+IVETv7LWcf/aKvdEAQhsRsN/GJAD309 He51cYxwKmcBaPDiY1Sn3LZwTc5mNX61D3y676NGgDqvXZAXRUbSH0YshZyTMrx+wXzM xM7nc3qtsv4R2GjWGLwZwnYDddefSrcD9//rl0uChhgcaqQ6kHR4LzZ4/o6THdADbvY7 o+V9titF5Qx1LdtAgBVBwWCLKSJdZbqcS8ZLVycm6Dn1EAtJSpJ4BLS2XpH1tfS+3DcW fCKJDlfz3M3LXL7QKG0mTNZHzEfvSiXVDYgus/BOqg2mTlPxLaCtCQlR6N97L1VkJxna 2ZsQ== X-Gm-Message-State: AOJu0Yzt4M81L6ze62PLYCZlkWdx/8i0wgFSsSeYP2OurO0unR8PJ3sJ k35VB+Tgcws6bjz+DERB7xxoH5mb48Mklihm51/uYWXmYXaW/6q/bO348KV6bKH2jH9Rcw+DTNJ t X-Received: by 2002:a05:600c:35ce:b0:414:5e9d:ad31 with SMTP id r14-20020a05600c35ce00b004145e9dad31mr2871529wmq.13.1710863124688; Tue, 19 Mar 2024 08:45:24 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id dw11-20020a0560000dcb00b0033b66c2d61esm12578388wrb.48.2024.03.19.08.45.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:24 -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?= , Bastian Koppelmann Subject: [PATCH-for-9.1 25/27] target/tricore: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:54 +0100 Message-ID: <20240319154258.71206-26-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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é Reviewed-by: Bastian Koppelmann --- target/tricore/cpu.h | 12 ------------ target/tricore/cpu.c | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 220af69fc2..9537fef2b9 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -253,18 +253,6 @@ FIELD(TB_FLAGS, PRIV, 0, 2) void cpu_state_reset(CPUTriCoreState *s); void tricore_tcg_init(void); -static inline void cpu_get_tb_cpu_state(CPUTriCoreState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - uint32_t new_flags = 0; - *pc = env->PC; - *cs_base = 0; - - new_flags |= FIELD_DP32(new_flags, TB_FLAGS, PRIV, - extract32(env->PSW, 10, 2)); - *flags = new_flags; -} - #define CPU_RESOLVING_TYPE TYPE_TRICORE_CPU /* helpers.c */ diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index a9af73aeb5..d6ac07a488 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -58,6 +58,18 @@ static void tricore_restore_state_to_opc(CPUState *cs, cpu_env(cs)->PC = data[0]; } +static void tricore_get_cpu_state(CPUTriCoreState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + uint32_t new_flags = 0; + *pc = env->PC; + *cs_base = 0; + + new_flags |= FIELD_DP32(new_flags, TB_FLAGS, PRIV, + extract32(env->PSW, 10, 2)); + *flags = new_flags; +} + static void tricore_cpu_reset_hold(Object *obj) { CPUState *cs = CPU(obj); @@ -168,6 +180,7 @@ static const TCGCPUOps tricore_tcg_ops = { .initialize = tricore_tcg_init, .synchronize_from_tb = tricore_cpu_synchronize_from_tb, .restore_state_to_opc = tricore_restore_state_to_opc, + .get_cpu_state = tricore_get_cpu_state, .tlb_fill = tricore_cpu_tlb_fill, };