Message ID | 1538295197-23704-14-git-send-email-pbonzini@redhat.com |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IysgHivw"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42NJN31VbSz9s4V for <incoming@patchwork.ozlabs.org>; Sun, 30 Sep 2018 18:23:47 +1000 (AEST) Received: from localhost ([::1]:54255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1g6X0y-0002i3-Nb for incoming@patchwork.ozlabs.org; Sun, 30 Sep 2018 04:23:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <paolo.bonzini@gmail.com>) 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 <paolo.bonzini@gmail.com>) 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 <paolo.bonzini@gmail.com>) 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 <qemu-devel@nongnu.org>; Sun, 30 Sep 2018 01:13:32 -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) 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) From: Paolo Bonzini <pbonzini@redhat.com> 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: "Emilio G. Cota" <cota@braap.org> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
[PULL,01/79] virtio: Return true from virtio_queue_empty if broken
|
expand
|
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 = cpu_get_icount_executed(cpu); cpu->icount_budget -= executed; - atomic_set__nocheck(&timers_state.qemu_icount, - timers_state.qemu_icount + executed); + atomic_set_i64(&timers_state.qemu_icount, + timers_state.qemu_icount + executed); } /* @@ -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 UB */ + return atomic_read_i64(&timers_state.qemu_icount); } static int64_t cpu_get_icount_locked(void)