From patchwork Tue Mar 19 15:42:52 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: 781122 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996970wrs; Tue, 19 Mar 2024 08:47:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwJ6uDqWLUpAR/1lT10ePmZi4cTgrzuEPZ6Vx8jbYeFPTp/kNbBo7xo2KQiWHNGcxXfZgZVE9ODSRar5xCEpIP X-Google-Smtp-Source: AGHT+IERD/KOlloOPE+py584sCw+21d9qLMlAausiDVaTkcRTIVqtBzDZMtF+xmG4ilkK4BMil0T X-Received: by 2002:ac8:5fd3:0:b0:430:ef95:4927 with SMTP id k19-20020ac85fd3000000b00430ef954927mr1407392qta.2.1710863276228; Tue, 19 Mar 2024 08:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863276; cv=none; d=google.com; s=arc-20160816; b=aYV4BVJ9QZZ+nQkXcH+WLk1ARQQxvcQ8PXLhZQmuXpOOmVOcbmr82ngP3YXFY1Ow6O MPOe37BkvxRfe6cOUZuVA4Nc0KZWR/BrD+aLKD1NLRboQTjhZ/JVDqw4/40Gqn96qLic 2HXR+3Wp4gvjIBKGaYfdBHwgpYpjh/bolvn1OUOrBpWrKEfPfuumtoaRWSewlgyK0SxV 5uGeHmi8LCLoaZemF82Y/trait7EPMCMCbm65TY+51FBpOrT4qegf3lLBWN6Kb9vxjg5 OJES4Ov3QYj6IwvsbbKl/GWBAfPO9p8FSeXIz9x+c1EWiq5mCLwEGIuf2OJNUObnJQKV +64A== 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=UywTiyuwpzYSJP7ec90xP7SAWTKz8NCufjjlUtL7sy8=; fh=UJGwpiD1w94kNq3h6+bjqd48VbgrymaKe6Q+Ls6ZRFA=; b=Wm535cCn3QSxtG0DtrO4RXiclJYslUl5gm9j1OvSaq4iVyf6g/cOXBjaLzrd95nucV PsBG4qe+27dn8pRCpmjKkgJYAcxwVkz3Dt/UBD/D2y5radgeu+PgYG416B+Tzm+53Bat 1L9frHaHDUrAlxy2ZZ9Gyhqdo0/bsLE8ZmDT34vT2hoQLziV5CX7CTK0rZoFRp+3Ufe7 TDvHVnz8H8pZYB5xeDDO6rb6sTqPRu8+BNYANCXNggapI7AtuFf5GrUNcjIAlBCKKvSJ z0BdG6eH5ZqEFdyDym/PED7x7xYfkW5HxAbdQR2x9CsGavOrI5g/NhihIqPOEzW34lRP MEYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhvMKZ00; 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 l13-20020a05622a050d00b0042ef8934be4si11389959qtx.339.2024.03.19.08.47.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:47:56 -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=VhvMKZ00; 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 1rmbf1-0002OO-90; Tue, 19 Mar 2024 11:45:55 -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 1rmbeT-0001UJ-Hr for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:22 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbeN-0005gh-Ex for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:45:21 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3417a3151c4so1615948f8f.3 for ; Tue, 19 Mar 2024 08:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863113; x=1711467913; 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=UywTiyuwpzYSJP7ec90xP7SAWTKz8NCufjjlUtL7sy8=; b=VhvMKZ00oWQCsZlXDW+CDjJhc+7HBvAAuL6u++pQTXOZS25GtXqAHUNqbv3W2yGeaH 8a5299KXs/HOHHuCh9xkuffcmnIP+jTfFQm2SxygBezDnvohumbyBbASnRzIa4dZ6GRv 23zDdDyRAurinokrGNwRTY+mqimy2BLhn2x2Sf5XAzUsO/r9PyTGyKBQb+iIPIxcORx7 iqBS1icQtaL3gA3AH2j/0+lyyFtqBOzNfs5SEHM9IgkUBgL+EEdgGg9ygcMkQzcqKOy3 YHA8T8JC5Es5TdjBI9FVYbpKwyiVAzYCR8DVk53ZwhqWKLr08HHrBWOOLYb48aRGbrtZ DqhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863113; x=1711467913; 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=UywTiyuwpzYSJP7ec90xP7SAWTKz8NCufjjlUtL7sy8=; b=E3hG9DxPqruKzLJtg4hpz8qKvwzzpn9kJgh+/HPSDznd/LhOSj+hRBnRul7LRGqWZn KItKXKeaKj+FJH+9l6z9vV7SU29BaJguIewekgW1LeALjJe8p0vSrcZ0yy0/wGvwpm4n WUJ1+NK/M3/MLyMTuc9s4vALUKrvICUloDTiq5LIvavuaXngFKle2X6URznMba4IcQyT tkTURPCEYKqky2Kuqu69UnZ4JyVoagtEDEhfELFQJXV+n2P3bKF3bjqkTapVCZIXHgh9 5ntZ859Rh8tbf8bwgLte6JwhATfobpWg5Ox/qepVc3tbScsl5joRYUOsUvRaX2CWKeav l/Mg== X-Gm-Message-State: AOJu0YyCsVgBEcTyyN4uRU+CBsA457pN/G2ie+Kzy1RvN21l/XwsPa/0 A2FUerh9kMocFsVRjWFRHwwOtqsc2TTyJaXdhQekzDuFopg4Ct5clSacrbhgaFt3z7jg0djibhy t X-Received: by 2002:adf:f3c2:0:b0:33e:bb67:9596 with SMTP id g2-20020adff3c2000000b0033ebb679596mr11018901wrp.64.1710863113462; Tue, 19 Mar 2024 08:45:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id o9-20020adfe809000000b0033ec6ebf878sm12573736wrm.93.2024.03.19.08.45.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:45:13 -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?= , Yoshinori Sato Subject: [PATCH-for-9.1 23/27] target/sh4: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:52 +0100 Message-ID: <20240319154258.71206-24-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::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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/sh4/cpu.h | 15 --------------- target/sh4/cpu.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 9211da6bde..36aff035cf 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -370,19 +370,4 @@ static inline void cpu_write_sr(CPUSH4State *env, target_ulong sr) env->sr = sr & ~((1u << SR_M) | (1u << SR_Q) | (1u << SR_T)); } -static inline void cpu_get_tb_cpu_state(CPUSH4State *env, vaddr *pc, - uint64_t *cs_base, uint32_t *flags) -{ - *pc = env->pc; - /* For a gUSA region, notice the end of the region. */ - *cs_base = env->flags & TB_FLAG_GUSA_MASK ? env->gregs[0] : 0; - *flags = env->flags - | (env->fpscr & TB_FLAG_FPSCR_MASK) - | (env->sr & TB_FLAG_SR_MASK) - | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 3 */ -#ifdef CONFIG_USER_ONLY - *flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; -#endif -} - #endif /* SH4_CPU_H */ diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 4f5a4a3d98..9b2b377e29 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -67,6 +67,21 @@ static void superh_restore_state_to_opc(CPUState *cs, */ } +static void sh4_get_cpu_state(CPUSH4State *env, vaddr *pc, + uint64_t *cs_base, uint32_t *flags) +{ + *pc = env->pc; + /* For a gUSA region, notice the end of the region. */ + *cs_base = env->flags & TB_FLAG_GUSA_MASK ? env->gregs[0] : 0; + *flags = env->flags + | (env->fpscr & TB_FLAG_FPSCR_MASK) + | (env->sr & TB_FLAG_SR_MASK) + | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 3 */ +#ifdef CONFIG_USER_ONLY + *flags |= TB_FLAG_UNALIGN * !env_cpu(env)->prctl_unalign_sigbus; +#endif +} + #ifndef CONFIG_USER_ONLY static bool superh_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb) @@ -250,6 +265,7 @@ static const TCGCPUOps superh_tcg_ops = { .initialize = sh4_translate_init, .synchronize_from_tb = superh_cpu_synchronize_from_tb, .restore_state_to_opc = superh_restore_state_to_opc, + .get_cpu_state = sh4_get_cpu_state, #ifndef CONFIG_USER_ONLY .tlb_fill = superh_cpu_tlb_fill,