From patchwork Fri May 3 09:16:56 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: 794365 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp642459wrr; Fri, 3 May 2024 02:18:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVoAWzkZ/mw75sCUnse4aJa2hrBfLpHGuHsY0sb9dKbmH/wWgTAIy4KSpaZ+E+klUmIMvd2TYePIt2sjl5XCyGC X-Google-Smtp-Source: AGHT+IF1pnPcFo6a1JLcS0JVXT/g3FJRhT7UXcpOSfrE4bKpvday3Mh5E5EjgHy94zFiCU7ROL1E X-Received: by 2002:a37:e315:0:b0:790:9648:850e with SMTP id y21-20020a37e315000000b007909648850emr2197092qki.48.1714727906042; Fri, 03 May 2024 02:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714727906; cv=none; d=google.com; s=arc-20160816; b=F3Xr0C888u+//P4XER3Dtbcew/Fch0ON/PJaBTleDdr4tHkocenmsm4wCP8aNHWSuq LCtlyTHEzokkBBtQPG6UMVKnF7PWn8GrwYbG/MYRl2a9GFV1WfzhqL2AImwMWkFkbV3y yW4d9wSokZWqBoBFqYxi7gMsS4cm7FmOJowFt+XPHFnjqafo8EyisM79DCtZE6dXHOmU ZNCX+4Sd6ph5SBez9gzOv+fJDLyZJuo+wGJqwx8uJMfwBhCUZjcl1cwqaOHcYauXeQAD 2AjhJ9NgXzZKoGX1R9CDHYg/0+3T+wJ214Bv/OIZN1j4sJ8GgbU/3atyIaUN4v0hy4uT b/0g== 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; fh=Wz5tv+q376m1WnuXLGinc1he4hBXyNhLC9q3oZt2ig0=; b=W40ej4mfZqQfFly9eSH1MBsK41fhg0CrBbWCt6YuB9FtZ1J+kyRMqzIT5+fYa7b9H5 wtrxkAhqwhoH3UYUN8fobD+uVCSlmsuSMyXGmvqSFIotfKO4YwL4zIQmnvLbM+wm6rd6 nDFQ3F166KV4Us/hegYydgKXjQG2oEp+bAsfzXlsHL/ax3lOa7R1nWUl/SfoRrYTZxvu Z/ZT8HBHfUbT2T2Wsi4CATsXmHqjmf6IBXc2eiZx7YeNGU1A0NSUrlm87CkMJSF2AYOx g4LKNCRwLx1tVRWXZjerqOOUKlyEmSC9ydbq5uMHU9o6ydYIQ19B8i/Rs+sxScUtaQlW kIRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jbnHbEvs; 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 vk51-20020a05620a70f300b0078f0532cb9esi2737823qkn.436.2024.05.03.02.18.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 02:18:26 -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=jbnHbEvs; 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 1s2p2m-0001ih-7E; Fri, 03 May 2024 05:17:28 -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 1s2p2k-0001iX-Pd for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:26 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2p2j-0003ak-5x for qemu-devel@nongnu.org; Fri, 03 May 2024 05:17:26 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-347e635b1fcso6635329f8f.1 for ; Fri, 03 May 2024 02:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714727843; x=1715332643; 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; b=jbnHbEvsR0Xd7fBy4Vykdq9w6HG2xt09h722ooiDUBJR1EO+cdTQFvCDP0hDjMIo1B 90zba+/17477kCJAZE1k46/PKspjaRHbZ+OaV80XiiYwhYYxEL/PAG7uoNBdzmJSjcqQ 3ISTkbOkDN8LdNAD4lzCNrBVap3B6pq5veslO0LwuNlLue0jIJ9jUZyVWDNawXrcjdqv wZf+Y6RNv4Y1Yg4RYjdpYuUejiM4lpdJ3O8HzAECUAaxmHNXg/7WjJo4u2OHfyb4g9dH jmNQ5D64OaJbVf5w+YlNfP6pD93RbcBD+kTHJIbQd9DazMNYb4PEc+IW0vuYjmqN437R 2Qaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714727843; x=1715332643; 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=L9C79ZCDN03MmjjHQ6TSF486EGxB4sAu8CtoKMbncco=; b=U8WIC5VqW99Oht5xqbo+PjTiuLL4ka1QNazGqwN/rpHARxxMCFFqsKnE+2y7ngO79z u5xMSaAkEY/flUj72PXOsqql16NTLOKlgRMjO5U1LxxtoY57mHk0o+0/HJr7jk3yy15G KTtCVk7xLqml0+s1iwIHXVpxRpoMKT6jAUEJf2pJ7yvtPhC6NYMV80Z/IjQXeNrgxCZk xkMFVBZT8foeQyxziqjOB07XCoeCPeDw/vIBwMbAva4gSgGnMu0mXIVglcEevn+91z4c 3B+3TtENvZx7oeOHkic6ZLbAtPOC6vAdGx+Vo0VPuNWcvIg4RdTvvXsa5Fa3lPLQDPWJ m91g== X-Gm-Message-State: AOJu0Ywnla8nnSugbYYWVLIxbtZ/63DrmpQGBOPZF3h3IQo0PdpasJUd AxCvAPf8bcDi2oHWpTiSbvaD1JukCvzOOrzR9AT6fO3lz1f4W+9LJMcZdZHZgBhu/2Rr69TeX4a o X-Received: by 2002:a05:6000:36f:b0:343:7b6b:dcc6 with SMTP id f15-20020a056000036f00b003437b6bdcc6mr1352192wrf.30.1714727843314; Fri, 03 May 2024 02:17:23 -0700 (PDT) Received: from m1x-phil.lan ([176.176.179.187]) by smtp.gmail.com with ESMTPSA id p18-20020a056000019200b00347f6b5bb6dsm3256568wrx.30.2024.05.03.02.17.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 May 2024 02:17:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Warner Losh , Paolo Bonzini , Laurent Vivier , Riku Voipio , Kyle Evans , Ilya Leoshkevich , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 4/5] accel/tcg: Introduce common tcg_exec_cpu_reset_hold() method Date: Fri, 3 May 2024 11:16:56 +0200 Message-ID: <20240503091657.26468-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240503091657.26468-1-philmd@linaro.org> References: <20240503091657.26468-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 Introduce a method called by cpu_reset(), common to both system and user emulation. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 2 ++ accel/tcg/cpu-exec.c | 4 ++++ accel/tcg/sysemu/tcg-accel-ops.c | 3 ++- accel/tcg/user-exec.c | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index edefd0dcb7..b85285e2ff 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -23,4 +23,6 @@ static inline bool cpu_in_serial_context(CPUState *cs) return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs); } +void tcg_exec_cpu_reset_hold(CPUState *cpu); + #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 225e5fbd3e..1bf85c324d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1096,3 +1096,7 @@ void tcg_exec_unrealizefn(CPUState *cpu) tlb_destroy(cpu); g_free_rcu(cpu->tb_jmp_cache, rcu); } + +void tcg_exec_cpu_reset_hold(CPUState *cpu) +{ +} diff --git a/accel/tcg/sysemu/tcg-accel-ops.c b/accel/tcg/sysemu/tcg-accel-ops.c index 2c7b0cc09e..82c8368f87 100644 --- a/accel/tcg/sysemu/tcg-accel-ops.c +++ b/accel/tcg/sysemu/tcg-accel-ops.c @@ -36,7 +36,7 @@ #include "exec/hwaddr.h" #include "exec/tb-flush.h" #include "exec/gdbstub.h" - +#include "../internal-common.h" #include "hw/core/cpu.h" #include "tcg-accel-ops.h" @@ -82,6 +82,7 @@ int tcg_cpu_exec(CPUState *cpu) static void tcg_cpu_reset_hold(CPUState *cpu) { + tcg_exec_cpu_reset_hold(cpu); tcg_flush_jmp_cache(cpu); tlb_flush(cpu); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 6a108eb212..85e92ec8f2 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -39,6 +39,7 @@ __thread uintptr_t helper_retaddr; void cpu_exec_reset_hold(CPUState *cpu) { + tcg_exec_cpu_reset_hold(cpu); } /*