From patchwork Sat Apr 27 15:57:13 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: 792677 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp973801wrh; Sat, 27 Apr 2024 08:59:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVjZeEZ8gIaX+TDKyZqZR51SjqZKBHNROnPgVIhGprnqcfCqj8M1vJi3kKuvmd5hBdKa2dpCvI1g1vucb1Mxl0y X-Google-Smtp-Source: AGHT+IEz47NglKY+5ADGng7OKD4DLChs+y9TnOkSaiV5JaVlNX87GGCETsK7mjYNsYhukpGC514K X-Received: by 2002:a05:620a:1271:b0:790:a7d3:fe57 with SMTP id b17-20020a05620a127100b00790a7d3fe57mr6444075qkl.34.1714233574643; Sat, 27 Apr 2024 08:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714233574; cv=none; d=google.com; s=arc-20160816; b=cBiP4PdfGGo9yOZpMVse9VO7RQLDp4VzvpuGvcVZevKCmKzcWJ1nljYUWUbUOuVEtS 9HtJEpuuyMbBYavGflesxFRVjdWEjAAHDRNEGbZyruDAfLwhy2o+0peLIMPxGVmyZfQ8 aX+LayqRLYfLyx8tmLqKuEX7s98NM2LZSZmFKWto4wm04gvAdo2ZGWmYRqwE12snxaDI A+tujYyWvP3gja302hfEwPsuUHwX3BJcaNhgdwWIvt9npmWSf0bZ2KwpGpPWQ1VdvwVn IrlYnOcHUsK2hEJeaQhUlF8zbkxFiWU8PAblfXCF4rybE76xjXTzS62Wtc4RnO8sI4ta 0ToA== 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=sL6dJhw+HNdXHaNBh4cOmuPi/pd0h9a+XY1hEoCa0Ns=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=OCwuj9CYsdkyelxd/tN8p09wPMGCx2KL9QfW+BHsD2BtGNDF8OR24xNv0MXS4UMt2B 51KuWI4PZveTavm++lapHPDTdCABL50I02LWslElpMPTrZSa9ahWnuWy6HG9y20boofW jQr5LZyA+nmxuoOXh5cIBYvG9pH1e+4o80du1wEueVjqYxZKlsneSEleYOMxLA6jFUpi HCuZS5JOOvop3/91UMr7Q6kDIlCDn5N18W9/gU3w5V4s+VjLQGU8ONPSzb+4/rIGSz+p 5eVLXp9nlB+gn1180IfapLvLEcjwHU2ozuUEegkJHC52OhnPQM9x+qeObz58AXymUIjI 5djw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T+8GVxZp; 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 oq40-20020a05620a612800b007905fcdb143si17782124qkn.193.2024.04.27.08.59.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Apr 2024 08:59:34 -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=T+8GVxZp; 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 1s0kRd-0003pu-J2; Sat, 27 Apr 2024 11:58:33 -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 1s0kRb-0003jD-HS for qemu-devel@nongnu.org; Sat, 27 Apr 2024 11:58:31 -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 1s0kRZ-0005b8-Se for qemu-devel@nongnu.org; Sat, 27 Apr 2024 11:58:31 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-34b3374ae22so3404731f8f.0 for ; Sat, 27 Apr 2024 08:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714233508; x=1714838308; 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=sL6dJhw+HNdXHaNBh4cOmuPi/pd0h9a+XY1hEoCa0Ns=; b=T+8GVxZp4+a9BIRCEOu/kqE08xA+dgwfDqVtaBMy3S5P66mL3S2wX2IFN2fMleM0gX HG0xY5TeOXq45j5eZYig2JfxDtn0Wg+wTOZIGhzxTY2gHiZhGb2tKOoLhaeCsYVuJvOQ bm1NXtwFwMYaGJcKdTCRnteF0OMZehT1h1DIm8P7tAxDUrlnDKw+Nb9HKFX8M61vpqmV Rn/pOKReAqjBC08gIcCPjNf4A4pEJtwcp7PcQnQxxydXXhio6q4PhYbLceeXYmoZu91l +HuY3mOok/oNYv73mtys1Uaq7aKCTmFMAe81L4XuYrxQkRaWme219DNVpdyt0fsJKEW+ xHkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714233508; x=1714838308; 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=sL6dJhw+HNdXHaNBh4cOmuPi/pd0h9a+XY1hEoCa0Ns=; b=NwFUECMoZ3c9qkyxIUeqcCLDK62M8m4rkWFh9LeQ+A/WtiJS0LlHhMudXZSxYDl+U5 ipcmv+ZttzhqHINzdh6sUVj0FreCrJf1Ve/jzO/nFkkbOVQTpZi6X4BFUnRlzEaIv0iH xSJIk+NuNDfem/lEhxGo4gsBdNQ0YqZhhhJ9KWZ4UGQqVh8ZNw0d4dFu0T0CXN2k1pRA +wNLvmS1dRv7r8kQTYwYdEOd9OOFVycxNqyMF2Bs8GU54B+TaeZOwE753Lj3UKp3x9mV XGjkB8PBSapJ2e0/WpsRXm0yIwaG5BfRvm9AOSElODdugzSydqsc+OP/umPWeePYm3aX JNxA== X-Gm-Message-State: AOJu0YyJjwRBcqQ8QXFgdOg765zUMOpxFaUi4gALDoLTymtArq+fwAOs OaszFCAMLgEoPkiKmZJvcDMTkDdzbQXFgwbTqv69oVpHCe+KTW1yiGJWqEwoL1mbadK8H/nthqc tVy0= X-Received: by 2002:a5d:46c4:0:b0:347:f26d:c183 with SMTP id g4-20020a5d46c4000000b00347f26dc183mr5207045wrs.45.1714233507990; Sat, 27 Apr 2024 08:58:27 -0700 (PDT) Received: from m1x-phil.lan ([176.187.209.2]) by smtp.gmail.com with ESMTPSA id z7-20020a5d6547000000b0034c9fa2c964sm1902228wrv.23.2024.04.27.08.58.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 27 Apr 2024 08:58:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH 13/14] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold() Date: Sat, 27 Apr 2024 17:57:13 +0200 Message-ID: <20240427155714.53669-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240427155714.53669-1-philmd@linaro.org> References: <20240427155714.53669-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 Rather than resetting TCG specific fields in the common cpu_common_reset_hold(), do it in tcg_cpu_reset_hold(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/tcg-accel-ops.c | 3 +++ hw/core/cpu-common.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 2c7b0cc09e..be99105ac5 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -85,6 +85,9 @@ static void tcg_cpu_reset_hold(CPUState *cpu) tcg_flush_jmp_cache(cpu); tlb_flush(cpu); + + qatomic_set(&cpu->neg.icount_decr.u32, 0); + cpu->neg.can_do_io = true; } /* mask must never be zero, except for A20 change call */ diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index c4175cc4b9..9b3efba82f 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -127,8 +127,6 @@ static void cpu_common_reset_hold(Object *obj, ResetType type) cpu->halted = cpu->start_powered_off; cpu->mem_io_pc = 0; cpu->icount_extra = 0; - qatomic_set(&cpu->neg.icount_decr.u32, 0); - cpu->neg.can_do_io = true; cpu->exception_index = -1; cpu->crash_occurred = false; cpu->cflags_next_tb = -1;