From patchwork Sun Apr 28 21:49:14 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: 792912 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1417603wrh; Sun, 28 Apr 2024 14:51:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVzg7YhCc7ew7/cs1H1t/2u8AC1u11FAVvBKXM0b7xSMiQC2sbeKVujNoKif0h3z8DiUpsmg2w9MC9kdBiyo5pY X-Google-Smtp-Source: AGHT+IFtT6U/amxWpBXq2HixNyu3+861Icqb9CDdQ7lKetcQI/QyO2AA3i1/oOMPMyYvp2aKkIft X-Received: by 2002:a25:dc8e:0:b0:dcc:588f:1523 with SMTP id y136-20020a25dc8e000000b00dcc588f1523mr8470599ybe.49.1714341082066; Sun, 28 Apr 2024 14:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714341082; cv=none; d=google.com; s=arc-20160816; b=s97MgsUj+r+HVFXNV17bq64mVJzqBhLzC7d8VYgcl3krRd3Xc6KacoFFkIPCWZAS6A DsMqAZ1qZIFPdml2OqbpMs/pBEv395ArxvFRskru/I1kdOUaa+j74/yW3IvEXx0XXJdU NRteXy1HF5wXx+3yfskzav+abvylYb76sQ7F7U4FJWXAF7haJ6igFSL44fyQVs9taMno SXs7IbKEY5ZaWucZZquvFtlhVvu9Ily2wZElwdXSdm/YsEgJ2KdPsZVQP/xSSR1I7GSZ Unh55BKPDwfEnfMVZnlNKUyFkqHuVfZA/fSfrac0W2ZfAGHCRgQVLAqnA7v/b+PyGaWM xARQ== 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=aIL7R4VGtGNdBMyw/v1blPKio2LEB3YtucwdrTq80BM=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=lNwWPZDUUB23JehL1VJ3MY23BCRM88eKjAcuN2ynrOoYpKHZUTdVX7H3cqiZeogBDe +d6Oy8qTgOJ0+iIZn7KBW0xlBKUHjJ69c054jF9uQpLN/Eg2Ecphz3efj1QXBkcSte3r K/zCJ6UlCtjtZ91EZMT3sW0XAUcHOjPWWNmQ3VY9X16JFi2dwl2iF07qTvsa2lZMqloL fFIGrTaYaBcYgyjHKIOBW7HVJQg1ZCuB/wGtLU/WiYpmEQJzWUyIUz9Q3KOD+zd3CGxG PYUVrJdxhLvZPch6EEsMZosIRnW+lLUEO/ADqMhK19267eiXl1/TiUdAB7jKAiI5J1c6 7V8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HQcjzlnY; 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 z17-20020a05620a08d100b0079070165f85si17769928qkz.184.2024.04.28.14.51.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 14:51:22 -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=HQcjzlnY; 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 1s1CPm-0003JF-Ql; Sun, 28 Apr 2024 17:50:30 -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 1s1CPi-00035W-PB for qemu-devel@nongnu.org; Sun, 28 Apr 2024 17:50:27 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1CPh-0001LN-65 for qemu-devel@nongnu.org; Sun, 28 Apr 2024 17:50:26 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-41b79451145so20747665e9.3 for ; Sun, 28 Apr 2024 14:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714341022; x=1714945822; 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=aIL7R4VGtGNdBMyw/v1blPKio2LEB3YtucwdrTq80BM=; b=HQcjzlnYXIoeQuq/qWlDatlGX5cdNEA7nTjv9+xJx8Q+5d1BE0Q2ezZhNemUhvEBZB g90hJg7bzgWX63ifZ2QJ048FipQOPZ4gD0ntktjhgMMPEoB7hTSgMia/WbiXrCqEw+o6 5jB8+FgFY0midSVQjVeZwSES/fMIwFCk4lwCvCI8gNxG1YhGM2LbbBpaKXSAWA+7SXHz OJVq13iHAx85tWr5m+xY36lHWB00VyjIpDeM0fwlW5KX505NKxLzopQEgis5bpAJHM47 hm3iGtSI7p279nmdtuMW+VNwt17Km0h9bp95nqG58LsAotbNLmUAmVPC8spxMGejCqnT PdGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714341022; x=1714945822; 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=aIL7R4VGtGNdBMyw/v1blPKio2LEB3YtucwdrTq80BM=; b=qo+756e65GNIftMJFwb/ekUMc6Eojp7IW/QOflMwmg2LZ4RSa8uQ7jE3WsfwUwC2Yw 4/PXogT5AVwdLmjDQ/N3LpyhKeB8JNvCEQo9YU7tmQuvlk6FLRAvp9JvLQyn3EMGtnet UJMGhl3HAnOa3r8u3Xqhf1lCUHX2ACq6mL1pc5nBY1WYtNJ6j1aPMIVhM6RVU46OWteu Bv42JsK5dAk+y0eq++6eND5Tkax5T+vYZe1VgKHKe1Yny9MZD+f8NMZHoK5TtG4R9P+N gIBr1ZLi175dcCKYBtHRKaJU2hS1DAaKNCiOE37vUr/O9nQy6uq3YrdiUIYgTDyTBABM BAeg== X-Gm-Message-State: AOJu0YyeL66YBCZ78HU9azKwxE/MGJ6NCw1+vAtAuaLODAF3n4qZ5n7g a4tlSimtwV0w5CCpL19tHA/Jp3sQcI0AIXIvDz4J11mHaBv9VjTDRtsge0TcfGR/oDBvD9frw2r v X-Received: by 2002:a05:600c:1d90:b0:41b:e55c:8e14 with SMTP id p16-20020a05600c1d9000b0041be55c8e14mr3589908wms.14.1714341021962; Sun, 28 Apr 2024 14:50:21 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id n18-20020a05600c4f9200b004169836bf9asm42844248wmq.23.2024.04.28.14.50.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 14:50:21 -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 v2 11/12] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold() Date: Sun, 28 Apr 2024 23:49:14 +0200 Message-ID: <20240428214915.10339-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240428214915.10339-1-philmd@linaro.org> References: <20240428214915.10339-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Message-Id: <20240427155714.53669-14-philmd@linaro.org> --- 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;