From nobody Thu Nov 6 01:10:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538295907794465.65596194020566; Sun, 30 Sep 2018 01:25:07 -0700 (PDT) Received: from localhost ([::1]:54261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6X2I-0003th-NY for importer@patchew.org; Sun, 30 Sep 2018 04:25:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WrA-00027z-At for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6Wr7-00004x-Dk for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:36 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6Wr7-0008Tx-3r for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:33 -0400 Received: by mail-wr1-x443.google.com with SMTP id n1-v6so330274wrt.10 for ; Sun, 30 Sep 2018 01:13:32 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.13.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fcF5h0iU4YN3YeWekEC1e0az9RXWJHBl0Gat56wJHHM=; b=IysgHivwwTxUM/cJcnkMY5ow8UQkHo7biEUK2o2QGWNA2LYYeKv8e5bVYgVYTtDDF6 Ti36NUkluAGbH/wDYR1n1bbVYpftgYHn4mh3Aqxax9ilcJmb3qKccalNdpMCeWd0tMRY x0oy8dBY2I0T9QcxGx+PzRQxQ2gBQKzMCGGmMtdK3uqlhTrv7p+VVkGV10rdPsSkhjQ3 znz2HSKTtALB80wCET0JsVurLtynorD8e682vZ4eVuBHCrkKtDSfd9bi2bpL9L7ch9Pq zsgvjLMapEkrMqlKqxqKCsxFhLBZYf8RuKLD9tIsJdZyBhKF+H2OPG3HhvVhBFpilFXu qfQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fcF5h0iU4YN3YeWekEC1e0az9RXWJHBl0Gat56wJHHM=; b=ji+dWTxFY4MfQ3X2D/1ezMNhvO1v0tMMAWP5JUsf91LUaqZgEK6nTGuwPVRtaq4+UD k9YznBSu9+xggSUKJFlXSRxwxwUVeo9I01qUjidO3ZFxHT70rel2jvuuPTNomSARnVJz KTs+MIZsSZ/Qv13jB2eCg54zX6hfQWaozj0JbNem6kOxDcM8Nb3xQlz4pdtRygWsdjmA iqg7mtiMBrLd8g4jEB0SgEsyvTrL4X5rcq/IhjelrvrYa3WsTIjxx/2zGsF+hiaT9ZUm Y1YEqzQFfJUrYYH5aK2iFTUoB5wGCqKDfs5ULA7ogZIsS5K37KAxRNmCWLzIDgD2Gfu/ 4bmg== X-Gm-Message-State: ABuFfoitPbVsPahDetX3lP1Kt+4pE9NOKedas2vsacQltu9HKyhOFVgV lgPHTysjb3qfacxvPreaCsvTIPkj X-Google-Smtp-Source: ACcGV62lK9Ko6m38VOxk63/xRoP2Ifnwg75MvModWtQfQlIjZTWFmtcFd+UcIxvPcVDf+uyH4/epGg== X-Received: by 2002:adf:bb02:: with SMTP id r2-v6mr3769710wrg.24.1538295211547; Sun, 30 Sep 2018 01:13:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:11 +0200 Message-Id: <1538295197-23704-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PULL 13/79] cpus: access .qemu_icount with atomic64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-10-cota@braap.org> Signed-off-by: Paolo Bonzini --- cpus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 6e1a892..fed8ec1 100644 --- a/cpus.c +++ b/cpus.c @@ -250,8 +250,8 @@ static void cpu_update_icount_locked(CPUState *cpu) int64_t executed =3D cpu_get_icount_executed(cpu); cpu->icount_budget -=3D executed; =20 - atomic_set__nocheck(&timers_state.qemu_icount, - timers_state.qemu_icount + executed); + atomic_set_i64(&timers_state.qemu_icount, + timers_state.qemu_icount + executed); } =20 /* @@ -280,8 +280,8 @@ static int64_t cpu_get_icount_raw_locked(void) /* Take into account what has run */ cpu_update_icount_locked(cpu); } - /* The read is protected by the seqlock, so __nocheck is okay. */ - return atomic_read__nocheck(&timers_state.qemu_icount); + /* The read is protected by the seqlock, but needs atomic64 to avoid U= B */ + return atomic_read_i64(&timers_state.qemu_icount); } =20 static int64_t cpu_get_icount_locked(void) --=20 1.8.3.1