Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp292753imp; Thu, 21 Feb 2019 01:24:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IbtSBzAwz33myWwrE4O8e4FpilACU/w6R4a7dQ7qc2MtnU8PcQfmO69MyBNOevgmSFfjHwX X-Received: by 2002:a17:902:9691:: with SMTP id n17mr42568379plp.9.1550741063942; Thu, 21 Feb 2019 01:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550741063; cv=none; d=google.com; s=arc-20160816; b=oJv7pMsredEKYBSj9IboCv6CoRQxAqeCPIr5PpUL96TKLmzdaZax9BJtD2IH9CfCwg w4Aujxfra8ysbAr3QQWey/u16VlfkOCYKVR0UOtXDNvvxdNg0pDr9L/qFb7UEsNtO1r/ +W5qXEFnLScsW5oQPaGS8HVbCoKITA4GwKgbMjunUXsc4qHoejUx9G5+cyQQw0EBnNJs iXAJc3KCZjkdJGNsOZCaRPBthlo/5kxau2f+Oryrb+z/Lq7S+b7gJBEcpeRElOHepNYw 0Dput2epab2mcFv6IvD+RJBhzoUeTi9L8MTqkqhqM6aJaG41cgsiC3E6xM5ALK2tYiWV ieBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=A/k7bLzhrnBjgT6dL0l8NBEApWOmh2MHGEi3b1csrjk=; b=S/bP1GSJANiBod9l6h5e7mqsO7Cte9KA4SWs7YqoCJmb2mLISk0WvskjmgZTwhAoAw wu0hDc5qAZmvJxDSd5s3auiAKQAohXe3aAJQdpZs1yY8h3CArMVZ4dKeU4s3w6+/SLvm 2ciYrp4LvD1ookqCAKI7sjmmYdH1/mkt2dmG3k0WBMhq2f7/0wooXykb3BKzgGXz+X/M Bgsrvqcfkv4K+pYr7r+vmOLSsCQCFlStWoGxoyXXcPKyocmj0fywwWSraHzLUkC4NvKy 7hm4bPyf6ThQLmGnEGHeHisf0OyrsJtG+I+jrt53mK/cXf7K2SNOvmfXlm59b4eOBL5U 4wjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=IWw1qKAg; 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 t2si18552339pfh.52.2019.02.21.01.24.08; Thu, 21 Feb 2019 01:24:23 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=IWw1qKAg; 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 S1727552AbfBUJW3 (ORCPT + 99 others); Thu, 21 Feb 2019 04:22:29 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:46000 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbfBUJW2 (ORCPT ); Thu, 21 Feb 2019 04:22:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=A/k7bLzhrnBjgT6dL0l8NBEApWOmh2MHGEi3b1csrjk=; b=IWw1qKAgnJTCWENPiNp/vDeDJ SY1jC1nzMLG6/JvDuMG59++Is+z1Wkd97ua5O2zsOJC9dQBZYscyV6LOrHZre/3NrDUNFWGstgmXp txRzuVzh/uGAkwsEvnOCn+2VGtHzfsQq4WS9uKSwMnD8+LEoxmFTD36T/f68IquOpQR/HhtRewwzT Y1RHRwuGX9hm7j5k2BKbCTug1i4cEDlXuvyv58U/yBw9v5c9kZpQqOR+RRv9pl+WZfZ5AU+Xkzexn tKVYlxRdKMr+WgCC8GWrcuYAH4XbychIwlxxda/1IouQI99mfeuneuMydVQBmAzJf8clNrF1ybgus 19h4sJm8w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwkYY-0001pX-P0; Thu, 21 Feb 2019 09:22:15 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3F53C2139CDFF; Thu, 21 Feb 2019 10:22:13 +0100 (CET) Date: Thu, 21 Feb 2019 10:22:13 +0100 From: Peter Zijlstra To: Andy Lutomirski Cc: Tao Xu , jingqi.liu@intel.com, Thomas Gleixner , Borislav Petkov , Ingo Molnar , H Peter Anvin , Andrew Cooper , Ashok Raj , Ravi V Shankar , Fenghua Yu , linux-kernel , x86 Subject: Re: [PATCH v2 1/3] x86/cpufeatures: Enumerate user wait instructions Message-ID: <20190221092213.GA32477@hirez.programming.kicks-ass.net> References: <1547673522-226408-1-git-send-email-fenghua.yu@intel.com> <1547673522-226408-6-git-send-email-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 10:37:27PM -0800, Andy Lutomirski wrote: > On Wed, Feb 20, 2019 at 7:44 PM Tao Xu wrote: > > +static ssize_t umwait_enable_c0_2_show(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +{ > > + return sprintf(buf, "%d\n", umwait_enable_c0_2); > > I realize that it's traditional to totally ignore races in sysfs and > such, but it's a bad tradition. Please either READ_ONCE it with a > comment or take the mutex. Note that when using READ_ONCE(), the other side must use WRITE_ONCE(). Mixed usage is not valid.