Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp269804ybi; Fri, 24 May 2019 03:37:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd70uFDrldazQEnFC+2z6J/bhBPschl0SOUFxd8GWRlfhhCxsg/JiMNApEp1DT39IB7SAv X-Received: by 2002:a17:902:c85:: with SMTP id 5mr31273837plt.172.1558694275135; Fri, 24 May 2019 03:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558694275; cv=none; d=google.com; s=arc-20160816; b=aQOLdBWsalWNdSJjhIy2iKLQgAtBOSFEIJWq3SmoGLNq79WQOWzT9TK1B1d+7FRd9I jJe/0zRc2tBzT3aDaZ1xbuFF7k7PcBQ/t9Y9WiRfitPhEm9ObhJVH8chOm7c4uuzLPQM 7Z0r3rEo9zH1u+6+DCtSkpf/z2nQDaqqpQIpyG+WOuwIUgHtTZJvtDf1RBeauVBMqUg7 hFNvSgkGFpMCY6O09kGGcrYnIudb5TIRw/qT6NSG6/D40Kj66GOqv/HWcmpe+2SYJRJD C5lsLQSMsmRblrmzyJ6GRS5JytjUYe1aTdJlhejCTLg5I+pbres/W2PDx+OiWUX8EQ7n ETpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=njauMCJ2o1/GsnZ2mPeYOiP+YI83chYuXOrhyQtPV2M=; b=p/OZNT08PswIG9WJ8jvuIp6zsEoc8WVN1xQakM6OBTwZBtHVl4P8FhBWHPTaQjfRgC NyfBKK1fPDbpQ2mp9+Z8VzyoABK71vR557AP+JlCop+eb7INvrrYNjaK+lA5fiqap4Rj LVpYtZfra/jw9cWj5JVUqaDY0/KDd92Y1Fbgf78+2tjFi8CeR0hQ6DimWb9A0Y4P1Znl j6IISzraUa18UFQMBC2TCbUNXsgJ+8NkdZ6WCEwUCvgs6hX5RC7sL5tqcDOD6wxIymJd ky0Rq7+h85kSrGVs6QPdAALSJ3CwEGgJH0ewzCLcyEOLz51yponk/94ZR/k8WE2VgLNp mY1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Hru5M1+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si3578340pfq.169.2019.05.24.03.37.36; Fri, 24 May 2019 03:37:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Hru5M1+b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390505AbfEXKf4 (ORCPT + 99 others); Fri, 24 May 2019 06:35:56 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33281 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389448AbfEXKf4 (ORCPT ); Fri, 24 May 2019 06:35:56 -0400 Received: by mail-wr1-f65.google.com with SMTP id d9so9492152wrx.0 for ; Fri, 24 May 2019 03:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=njauMCJ2o1/GsnZ2mPeYOiP+YI83chYuXOrhyQtPV2M=; b=Hru5M1+bFuLqBXipwVL2/tEtOL/OtEx3FfYSgOWmgjXRA6dLOeH7ftsHBfQvooSUhW wOktU1Vsg7mrFiljLdYvYKym6cUf2gXXkBYQQghCH0Qek2YnYyzk65DxP/TLjWfClk2z d8QYG7bXQwnPbdm+nWcEhHjzEhyGYCbHF+UKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=njauMCJ2o1/GsnZ2mPeYOiP+YI83chYuXOrhyQtPV2M=; b=Rj/BHauAMMWRNPl3XLKZ/Crsff5urySQBKxB4rDvCTA+mEL2p2ql1oruWl1a/EMNUv 3RFm+Fr4s7Cqg4JlLxhA4R+V/PisnI6z6qV2KYxAsZzUg3iLLRAJiovz93OFIDHdQXfB KRzq/WfADnzi7r+I15ACk0xEIJcEe3KaUWXMrF7E6cc77bynoDwFVATZGXKVhccAzYZc WA7YOi3ISn6n5Q8aWqmJr1ja2LpRONCcE2tblQexunmnvJi/w3MOtr8JbdlIY17MxhsW ZI8P4vfXdwDTkgDW0gvoSj+EFvvVLQD9wXx8h5zo3ouovmuDuD1u5pB/H9pvav/oNcEI OOnA== X-Gm-Message-State: APjAAAX8UoT2FeZtmnktFF/yFpKlIjIH8Y4wyutcu/PpWEsF8S7LO3gh c35ufi7CRpP7znpE5uyVMY6nUAn0/k2ojw== X-Received: by 2002:adf:f292:: with SMTP id k18mr37384267wro.321.1558694154076; Fri, 24 May 2019 03:35:54 -0700 (PDT) Received: from localhost.localdomain (86.100.broadband17.iol.cz. [109.80.100.86]) by smtp.gmail.com with ESMTPSA id n4sm2111272wrp.61.2019.05.24.03.35.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 May 2019 03:35:53 -0700 (PDT) From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Andrea Parri , Arnd Bergmann , Greg Kroah-Hartman , Jorgen Hansen , Peter Zijlstra , Will Deacon , Mark Rutland , "Paul E. McKenney" Subject: [PATCH 0/2] Prevent evaluation of WRITE_ONCE() Date: Fri, 24 May 2019 12:35:34 +0200 Message-Id: <1558694136-19226-1-git-send-email-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This all started when we realized that atomic64_t v; ... typeof(v.counter) my_val = atomic64_set(&v, VAL); is a valid assignment on some architectures, but not on others [1]: in particular, the assignment is valid on all architectures #define -ing their atomic64_set() macro to WRITE_ONCE() (which is currently evaluated). Mark suggested to clean up all non-portable users of atomic*_set(), and to prevent WRITE_ONCE() from being evaluated [2]; this resulted in this first attempt/patchset based on Mark's atomics/type-cleanup branch [3]. Cheers Andrea [1] https://lkml.kernel.org/r/20190523083013.GA4616@andrea [2] https://lkml.kernel.org/r/20190523141851.GA7523@lakrids.cambridge.arm.com [3] git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git atomics/type-cleanup Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Jorgen Hansen Cc: Peter Zijlstra Cc: Will Deacon Cc: Mark Rutland Cc: "Paul E. McKenney" Andrea Parri (2): vmw_vmci: Clean up uses of atomic*_set() compiler: Prevent evaluation of WRITE_ONCE() include/linux/compiler.h | 5 ++--- include/linux/vmw_vmci_defs.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) -- 2.7.4