Received: by 10.213.65.68 with SMTP id h4csp756923imn; Tue, 27 Mar 2018 08:13:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELvTIL4hEMcpfm8kJiUvAyK0E3WyLqHh+zEfaVcRTOOSm/06P57jLTEuSqFnsZWzHd4C0GOc X-Received: by 10.98.159.200 with SMTP id v69mr20672229pfk.230.1522163612094; Tue, 27 Mar 2018 08:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522163612; cv=none; d=google.com; s=arc-20160816; b=Lb3pA/G//7EaaDwjCKpHrSpkOjEi9L7m1aLPM23GadddclYulACaTypGF7HEXwNCPD dOMeRRgf7dj8Z0Jk7rADr/Fhen3URjJ0R3ojlhcTVuSFCMET98PJ34mddmC3z8e4u5fi ZOcTjniLbQIj85SlYwAgjqfjkUEdQd3RYjhNj/gIjXyPIqQV18VoMAO+1ZAKX5A/jA6h BUOHHrI4oRecwD5MztzBPR3T3AwAayIPxRgTPdeVO6nLn3MUH+sQecRl2HObq+IicSt4 lJuX8LpiB2FXViv5C6LK8qpjESSnvdHVQhL2A2u6FPTNcFzM4xjbQv1G9M5+IZjgK2KF IevQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:to:from:subject:message-id :arc-authentication-results; bh=/Bb7d/YswT7XMg/oSGGP/zHCzQ/wZmOcIh6xEN1/VCU=; b=Hn6u29H2Ter+nSFGV1AyoUefuu5VZGcWx5q9vPIYTxkpmC30bcTuNrBZiJzJKMtTGF q8sN0G/l1YvqPWZhNDGcvkYDvpZop8qGB9gkLCUF7h7PlinQFwwNC2hZEmfymmouYHm3 xFdk96f6r+WOg/0uhDRFwwcptGKaRpGuL2Nhx+8pYpJPV5dEXIPa70ZwcNQ8AoYs4FdM eNiRy4MP+Tfzrl2UrfCeU/OoBASALpVig0DXd9uCsDznnK5y3uov4fNgMT2mKiOzAAoG b016Mx/X+/6s9GoH+/0jUCQBQaoOnmv6jPxJ4Y2ih200JERbGB/Zb3K6XRWEBwDhy4i2 +mAA== ARC-Authentication-Results: i=1; mx.google.com; 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 31-v6si1455009plk.674.2018.03.27.08.13.16; Tue, 27 Mar 2018 08:13:32 -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; 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 S1752782AbeC0PKe (ORCPT + 99 others); Tue, 27 Mar 2018 11:10:34 -0400 Received: from mga05.intel.com ([192.55.52.43]:22290 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752342AbeC0PKa (ORCPT ); Tue, 27 Mar 2018 11:10:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 08:10:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,367,1517904000"; d="scan'208";a="215114295" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga006.fm.intel.com with ESMTP; 27 Mar 2018 08:10:27 -0700 Message-ID: <1522163426.21176.24.camel@linux.intel.com> Subject: Re: [tip:x86/urgent] x86/io: Define readq()/writeq() to use 64-bit type From: Andy Shevchenko To: hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, lkp@intel.com, sohil.mehta@intel.com, mitake@dcl.info.waseda.ac.jp, linux-tip-commits@vger.kernel.org Date: Tue, 27 Mar 2018 18:10:26 +0300 In-Reply-To: References: <20180119143322.16555-1-andriy.shevchenko@linux.intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-02-13 at 08:58 -0800, tip-bot for Andy Shevchenko wrote: > Commit-ID: 0fc8483b698620ea3d8cc6635b54eccc613c23a3 > Gitweb: https://git.kernel.org/tip/0fc8483b698620ea3d8cc6635b54ecc > c613c23a3 > Author: Andy Shevchenko > AuthorDate: Fri, 19 Jan 2018 16:33:22 +0200 > Committer: Ingo Molnar > CommitDate: Tue, 13 Feb 2018 17:14:41 +0100 As of today I don't see this in linux-next % git tag --contains 0fc8483b69862 next-20180214 next-20180215 next-20180216 What happened to this change? > > x86/io: Define readq()/writeq() to use 64-bit type > > Since non atomic readq() and writeq() were added some of the drivers > would like to use it in a manner of: > > #include > ... > pr_debug("Debug value of some register: %016llx\n", readq(addr)); > > However, lo_hi_readq() always returns __u64 data, while readq() > on x86_64 defines it as unsigned long. and thus compiler warns > about type mismatch, although they are both 64-bit on x86_64. > > Convert readq() and writeq() on x86 to operate on deterministic > 64-bit type. The most of architectures in the kernel already are using > either unsigned long long, or u64 type for readq() / writeq(). > This change propagates consistency in that sense. > > While this is not an issue per se, though if someone wants to address > it, > the anchor could be the commit > > 797a796a13df ("asm-generic: architecture independent readq/writeq > for 32bit environment") > > where non-atomic variants had been introduced. > > Note, there are only few users of above pattern and they will not be > affected because they do cast returned value. The actual warning has > been issued on not-yet-upstreamed code. > > Potentially we might get a new warnings if some 64-bit only code > assigns returned value to unsigned long type of variable. This is > assumed to be addressed on case-by-case basis. > > Reported-by: lkp > Tested-by: Sohil Mehta > Signed-off-by: Andy Shevchenko > Cc: Hitoshi Mitake > Cc: Linus Torvalds > Cc: Mehta, Sohil > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Link: http://lkml.kernel.org/r/20180119143322.16555-1-andriy.shevchenk > o@linux.intel.com > Signed-off-by: Ingo Molnar > --- > arch/x86/include/asm/io.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h > index 95e9486..365f5ba 100644 > --- a/arch/x86/include/asm/io.h > +++ b/arch/x86/include/asm/io.h > @@ -94,10 +94,10 @@ build_mmio_write(__writel, "l", unsigned int, "r", > ) > > #ifdef CONFIG_X86_64 > > -build_mmio_read(readq, "q", unsigned long, "=r", :"memory") > -build_mmio_read(__readq, "q", unsigned long, "=r", ) > -build_mmio_write(writeq, "q", unsigned long, "r", :"memory") > -build_mmio_write(__writeq, "q", unsigned long, "r", ) > +build_mmio_read(readq, "q", unsigned long long, "=r", :"memory") > +build_mmio_read(__readq, "q", unsigned long long, "=r", ) > +build_mmio_write(writeq, "q", unsigned long long, "r", :"memory") > +build_mmio_write(__writeq, "q", unsigned long long, "r", ) > > #define readq_relaxed(a) __readq(a) > #define writeq_relaxed(v, a) __writeq(v, a) -- Andy Shevchenko Intel Finland Oy