From patchwork Mon Oct 24 23:24:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617897 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3036216pvb; Mon, 24 Oct 2022 16:26:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5iw6+g/2LK0KQDxMuWiSwKuKgDhpWG8rtmX7xoCWRcB0vQ/AkGnciih+yQKY5ln49n4Fge X-Received: by 2002:ad4:5968:0:b0:4b4:7d98:7ede with SMTP id eq8-20020ad45968000000b004b47d987edemr30147948qvb.130.1666654001319; Mon, 24 Oct 2022 16:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666654001; cv=none; d=google.com; s=arc-20160816; b=Wff7Knirkt2pnP73Gp66hQZReNZGS+fS+Ohv/VbkgW3Fvsp4ZL/+4m2eJK8NNLXSB2 BlJoGt+0pfdJ7lmnBYY1KhWnfHA6Srqd0fA2RBcV07hyugAOeyX363jjTH2HuINpy+xz w01r54d9RtLyz1f3kS6Qr6cnz2Wec5AuMrYMThBVuwl26YEBdm61+vi2drp21rqWY/Sr jXaTv202Zv797XANWtvBDHZifPU3xNYFp1i7N2Z2I5P1Rub+7qZSZ2y6vZ4G7dFMuyXc WmX1nGeKoLRTjjJWCMQFua/wqYyJvvXVkKRZZYQCkSlxPa4We08yUj3oetz1wrPLKbwI ETQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=qhqlCbK+Vyfuhw07z3L7AMoxj5A7y8nNEGzeS8BGSg4=; b=E9aUMC4R3UMXsPstl7MvVdQ/0G44IBJsMPbI2//FjR27wO3T/NcBarNfGlwOEemx0S HuuawFEM97JSXW0ZjicQtsDDtzJITIniahY4rLFD8sX2KfiNxV+0u4h+oLodc1BM8jPC rz5RLVHK6KyQHtaQx5mQzGxoTd0nYpRI5vrlXXoR+uGWinTi1H8llE34u8wUgF6P+rKt t/pH7mbQDg51Vkkd2KstoOsD2e7f3P9rFcgdyfOD/Mostq2sNQbtnFDb87IRy7zcYkb8 zRaloFn9TAsO9NPttefFQrRn/BUvlQ7gdROO5bz9As0/u2zq0tdECkwRvFtxzf2/NEaW Mx1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BuvzTWK5; 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 a14-20020a05622a02ce00b00397ab6a0413si1027470qtx.30.2022.10.24.16.26.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Oct 2022 16:26:40 -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=BuvzTWK5; 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 1on6oH-0007GA-Eo; Mon, 24 Oct 2022 19:24:45 -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 1on6oG-000707-2Z for qemu-devel@nongnu.org; Mon, 24 Oct 2022 19:24:44 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1on6oE-0000D1-HX for qemu-devel@nongnu.org; Mon, 24 Oct 2022 19:24:43 -0400 Received: by mail-pl1-x62b.google.com with SMTP id io19so4784550plb.8 for ; Mon, 24 Oct 2022 16:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=qhqlCbK+Vyfuhw07z3L7AMoxj5A7y8nNEGzeS8BGSg4=; b=BuvzTWK5X1qutaiB8mWsdfz9g5Ef1YwqgoWPzqTocosB66KVEzasgW9kbSAnhCD4rw z9EoXLatbit/MFo8kQwQBcp+hu6PTXHJFdWhxXUAwDhafQf1AvxHNOnwhV4AKbEtUGaO giZQ6owBIdWSnS5WiWG39sKyIMWemngFbChMjUUSDXQqJBSJJfu3X6fyy4XSkRdZCQ9P sJAaGaTj0sp/jkvLNBEQ9Yg5bWn/MgA0kMzM9jJYorqmncallTqGtVsYJ9zTzFjzsGXv y99YVdifjVLzV4ecoEzh6ANOnmqOvUUlKLNDw7LoIfCBlvtWyPcSuTFIG10aUIeA+rAs CAig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qhqlCbK+Vyfuhw07z3L7AMoxj5A7y8nNEGzeS8BGSg4=; b=wXDyDbRnGD3EI86mCN9z2pY6atO9nc10FvLWAJiwcedczNKjjmF8x+PBiCCA66uuNf JJ0a2eyeeVRe2KYXMmT6hjW4Y9j+6fMCNVVHq2NfnYgqVgi9Yv0SV4ItVucf4jb1mRf/ D2fTtOFITdjEK9lOHlOV/P06ljxM40mPrJ7CABxBhXLACduEqpYPAZktU3M7zZEgUOLP c2+xhW/z2ND3kb5+Oyyidv0103xDZk7Siq2SD26+gDp42REmXoGgZTQeLLLA2Y560NQs Jrg9wD9i2wbJM8F8FRKu32lebb69O4Hnizd8dV21I2mkKhqpLnlyExNzSzr93VziWIqn mZXA== X-Gm-Message-State: ACrzQf0M8vwTpGqFbMMcYBUPmWkPiUnAsrO4o2yLUjfH8LdJbDOqxKBK QzOT7sogdevHJXLsfAAXm4uMn4xWHTMylA== X-Received: by 2002:a17:902:ab8f:b0:185:46d3:8c96 with SMTP id f15-20020a170902ab8f00b0018546d38c96mr37315321plr.136.1666653881115; Mon, 24 Oct 2022 16:24:41 -0700 (PDT) Received: from stoup.. ([103.100.225.182]) by smtp.gmail.com with ESMTPSA id k3-20020aa79983000000b0056bfa2cf517sm324788pfh.3.2022.10.24.16.24.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 16:24:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 0/4] atomic: Friendlier assertions, avoidance of __sync Date: Tue, 25 Oct 2022 09:24:31 +1000 Message-Id: <20221024232435.3334600-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org The current use of _Static_assert, via QEMU_BUILD_BUG_ON, requires the user have #if conditionals to avoid the statement from appearing in the preprocessed file at all. Introduce a new primitive that allows normal C conditionals and dead-code elimination. Remove all use of __sync* builtins in favor of __atomic*. We have required them since 47345e71247, last year, and should have removed these at that point. My bad. r~ Richard Henderson (4): include/qemu/osdep: Add qemu_build_assert include/qemu/atomic: Use qemu_build_assert include/qemu/thread: Use qatomic_* functions include/qemu/atomic128: Avoid __sync_val_compare_and_swap_16 include/qemu/atomic.h | 16 ++++++++-------- include/qemu/atomic128.h | 8 +------- include/qemu/osdep.h | 8 ++++++++ include/qemu/thread.h | 8 ++++---- meson.build | 3 ++- 5 files changed, 23 insertions(+), 20 deletions(-) Acked-by: Paolo Bonzini