From patchwork Fri Dec 20 16:15:33 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: 852438 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp2148418wrq; Fri, 20 Dec 2024 08:24:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXrBiMB9dqab87ikS/Wu0vAMzguhhR9QJJm5NHz3JygwBXV/RtXee1qis/Jk3AZ8zu0elhB2g==@linaro.org X-Google-Smtp-Source: AGHT+IEjOGZhjpdWzQH3TuZVOXIihi055+cLXtjo1xw1Wf0XWdvaAKBEqIE0tOt1di5686nLpWR8 X-Received: by 2002:a05:6102:50a7:b0:4b2:cbe5:fbc5 with SMTP id ada2fe7eead31-4b2cc462478mr3757707137.20.1734711873777; Fri, 20 Dec 2024 08:24:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734711873; cv=none; d=google.com; s=arc-20240605; b=Gz5SKLEkEp+HbLsewNMuGf5wMvl5RRwy0xIbcr822iAQgXE8a50ZVDuPfUVih8mg5/ 9JLyL8FeKbok9s3uZ0umTY08wpqBqAQTUcRUCiZz7XkOSIFfkmq/O4IZAR2LwPjeHnnw bJL4bTUxwFSUkwb5+K/LKoUP63CZX8YIdORILtzg+mi2bBM48BwVNDGeVT6Rj2NYkDt8 TzKo5dBMP7KWkXaAdSzDoXFt7qQ/JU/g02teV5oxHEZXaPoCCdQPAX2WDhiWFYX3WQnM nTSM/O1aZsaj83WfD6ZZNH96cJHhl68vT5CdTvDBtkL3M0r0cYkXdaGQjImYR0y4azI/ hc4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=ObB9h5ClA82vSBh+n3DvAS5J1rT6h/dh6ysnz8owrU4=; fh=+kTJNlX4d/Ktp/5WO5d77IkVGYcQ7tiev+NqB54rN/Q=; b=SnsNlQwQgew6uAG0EltHExN6jDxskEBDdYzDrg8mm7irVX+zvuF6t0anpQ8jNyHgNB PdPoplrt/O7ZCM7Cp4q4G3e94LiKA4dGYc9oz7nxZQsTdfCNj47nCTRRfTmOXUlFEe18 m0KbRXn/P83Jk9eZR8aP982Eh/yfKXg90BXUfN2NxG0SMUh9Rky0Nmki64bjbQ/Koxi2 tic4zJhdU163/pd7TgLiQhWUdJsfW1fyajmHMmVMBcGOaiWje7TxDES+5AI8UCBGVJtt jXjxK/l/MwOfu/RkOkkZF24AGXmxz0nx4vQ5/ihIpg7llhwz7U0N5tatjq1D4xZUBSd8 pgeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TJKYjpqU; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4b2bfb76293si1410086137.492.2024.12.20.08.24.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Dec 2024 08:24:33 -0800 (PST) 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=TJKYjpqU; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOfil-0003nl-30; Fri, 20 Dec 2024 11:19:23 -0500 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 1tOfiW-0002CW-Ik for qemu-devel@nongnu.org; Fri, 20 Dec 2024 11:19:09 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOfiU-0008EP-Qu for qemu-devel@nongnu.org; Fri, 20 Dec 2024 11:19:08 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3862ca8e0bbso1610480f8f.0 for ; Fri, 20 Dec 2024 08:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734711545; x=1735316345; 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=ObB9h5ClA82vSBh+n3DvAS5J1rT6h/dh6ysnz8owrU4=; b=TJKYjpqUv6zTaAgIZZKAkwC8Ufegn5+m+Wg/fYDhg+lfGXLYkLMee5eZjACZvqZ9Tn Ig0WbLfNc+oYftu70X0x7Qyo8BmcS5euIG5eVQmWHgbYsI4zFdUIJlyTpIjJb7pbsYDB YvAkw7u4zFOQnzob/z9Eo+cRAcKt1RqEO4V9ssP1x1IgoUFJJ9Sch4iR9cfLn41AI9Kf haT7V3Rm7N3oqAlRHbxBO7rBrGgZ6iAnX3GtsiyiC4V6gFZ8EjYTuqW7D+bFIMYfei4C ydoJ4uMoev9M88pA+6vv4R9dBMksMQw0xCVfB+c6/bM26cEZDAdOzhlSn5Q6dmA+w2qc x1xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734711545; x=1735316345; 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=ObB9h5ClA82vSBh+n3DvAS5J1rT6h/dh6ysnz8owrU4=; b=Ea8D44YLH4s424OtppKKojKcmCXpAwYsPi1ebI/KiaODViCGcJTsvKF3c9UBj0kax5 GWSDRZTglf8ZUjWJjfuGOBjMCX4kpCIAonNxYsVnI0KMz1VVpON0a+730FwIFbK003ym e2zG1b3CP1P7g5fXSaENKklQG4jMl0stYsqe+f9WeoFk+t7v1AbmgXLrN6B+jmmP6lFM OxcvTL2s/4eNVUZcBT8to9knHIuO0pLheEF4aU6RFgjTBWBJ+lG4sb+ZyqJahtrzoK+A G5zsESNzEHc71esde9Qf4gP6x/orHVEUb9riZx2dWBm5jeaMR2D/MGg9HJeUNtL/PM0z P2aw== X-Gm-Message-State: AOJu0Yw1fWnTdaHShAf4PZwKD8NZmkbnl3qg3SZZ346pNygcSpeoCKwR I486ML34cJhSM4sr0R3QmFo/bFpT1WZvEaCdESwaejU/bMTde1YKjwPe+Cb2DOE0XVgi2J1TJ18 r X-Gm-Gg: ASbGncu+Z3V6Yei67Y0aOe6Rt+F8cMTUmNBk0U7c3gWF4JgaM9zyPZw/2Kvk/aLY2qs TqNs6qPW+kE6s9zNLJNYdJwNl25P4NNafn+y3RtgpnINWDwv/7y91DB3wW8b3cgQQ54vT1v7D4h L64N0i2QQ2aAwEl5XpIDLZZVylQmro6BZtVwe0jfCJ8f9AghSrNJEsWW/cmxoNG/tJ0fV8PTO7r UfjLLw/hES33N2RBD78sToOFxSS4NNEVxarT6YSCgSfFHwoJBv/oEqDGthHl93chDvycZpaWNY= X-Received: by 2002:a5d:6f16:0:b0:382:40ad:44b2 with SMTP id ffacd0b85a97d-38a221fadadmr3791555f8f.34.1734711544863; Fri, 20 Dec 2024 08:19:04 -0800 (PST) Received: from localhost.localdomain ([78.196.4.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366120086bsm50474225e9.12.2024.12.20.08.19.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Dec 2024 08:19:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Anton Johansson , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 42/59] target/sparc: Uninline cpu_get_tb_cpu_state() Date: Fri, 20 Dec 2024 17:15:33 +0100 Message-ID: <20241220161551.89317-43-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241220161551.89317-1-philmd@linaro.org> References: <20241220161551.89317-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Anton Johansson Required to compile accel/tcg/translate-all.c once for softmmu targets. The function gets quite big for some targets so uninlining makes sense. Reviewed-by: Richard Henderson Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-14-anjo@rev.ng> [PMD: Only take SPARC part] Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.h | 39 ++------------------------------------- target/sparc/cpu.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index f517e5a383b..e9ccec6175f 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -747,43 +747,8 @@ trap_state* cpu_tsptr(CPUSPARCState* env); #define TB_FLAG_FSR_QNE (1 << 8) #define TB_FLAG_ASI_SHIFT 24 -static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - uint32_t flags; - *pc = env->pc; - *cs_base = env->npc; - flags = cpu_mmu_index(env_cpu(env), false); -#ifndef CONFIG_USER_ONLY - if (cpu_supervisor_mode(env)) { - flags |= TB_FLAG_SUPER; - } -#endif -#ifdef TARGET_SPARC64 -#ifndef CONFIG_USER_ONLY - if (cpu_hypervisor_mode(env)) { - flags |= TB_FLAG_HYPER; - } -#endif - if (env->pstate & PS_AM) { - flags |= TB_FLAG_AM_ENABLED; - } - if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) { - flags |= TB_FLAG_FPU_ENABLED; - } - flags |= env->asi << TB_FLAG_ASI_SHIFT; -#else - if (env->psref) { - flags |= TB_FLAG_FPU_ENABLED; - } -#ifndef CONFIG_USER_ONLY - if (env->fsr_qne) { - flags |= TB_FLAG_FSR_QNE; - } -#endif /* !CONFIG_USER_ONLY */ -#endif /* TARGET_SPARC64 */ - *pflags = flags; -} +void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags); static inline bool tb_fpu_enabled(int tb_flags) { diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 8f494c286ae..b11f3248d82 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -713,6 +713,44 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs, cpu->env.npc = tb->cs_base; } +void cpu_get_tb_cpu_state(CPUSPARCState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + uint32_t flags; + *pc = env->pc; + *cs_base = env->npc; + flags = cpu_mmu_index(env_cpu(env), false); +#ifndef CONFIG_USER_ONLY + if (cpu_supervisor_mode(env)) { + flags |= TB_FLAG_SUPER; + } +#endif +#ifdef TARGET_SPARC64 +#ifndef CONFIG_USER_ONLY + if (cpu_hypervisor_mode(env)) { + flags |= TB_FLAG_HYPER; + } +#endif + if (env->pstate & PS_AM) { + flags |= TB_FLAG_AM_ENABLED; + } + if ((env->pstate & PS_PEF) && (env->fprs & FPRS_FEF)) { + flags |= TB_FLAG_FPU_ENABLED; + } + flags |= env->asi << TB_FLAG_ASI_SHIFT; +#else + if (env->psref) { + flags |= TB_FLAG_FPU_ENABLED; + } +#ifndef CONFIG_USER_ONLY + if (env->fsr_qne) { + flags |= TB_FLAG_FSR_QNE; + } +#endif /* !CONFIG_USER_ONLY */ +#endif /* TARGET_SPARC64 */ + *pflags = flags; +} + static bool sparc_cpu_has_work(CPUState *cs) { return (cs->interrupt_request & CPU_INTERRUPT_HARD) &&