Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1127675pxu; Wed, 6 Jan 2021 13:06:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyofiFW4UFhuMSEKINW3TD5uRXuxl3m516wHm4kaMrL9JA+hrlbx5NouPuMWJG7EJAebkow X-Received: by 2002:a17:906:7146:: with SMTP id z6mr4043820ejj.379.1609967190940; Wed, 06 Jan 2021 13:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609967190; cv=none; d=google.com; s=arc-20160816; b=mOGNBXmMS8g9x2qMfmpV/yMhZ0wrefrO8Rp06VPybveVfVU/vZautOzGEpN9vdV9dP Eafu9GUewYI32hbTUS8weJQFpWR4cHRNl+9jW2a75adTt1vWCTzcK4XJfjDdpeF9sUZH DgwswyzYLjnWgOosYlE7s8wjjiBo90k/B2mtOk20ndROlJPyNROA3kisLNp2O+1d0Liu kziicx0QlWge4TmtOVE5vvM2DpNSwbTInzRh9ghCpPphhr7xvGZn9OJTxmilROcnMoF+ oF3hTyGUxFeKnmo2ahKk+F98pAEFQ+RC2JtRl/GFV9IGqpD3T4dPsvpvcoCO1Yy7jg3h bVXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=YxdkNfAu5/BdiOESi6n0QAAM3FFaI919J2VXmH4sQYk=; b=z1PvPaGCiXZSp1haxmJw9Qpm6VnJPsfSW4g/M5I5l/2pGo2+eNtC/U7ysFTgtKRANB mgc6jUoJ+WHi8UqbxH2pjgIUNxaPEtWgI8sKZUWcGpfAo4KZ8XIcu44enMgnZbSkyYqu jYAIdi7Bh8iwxPfsZRxMcrM8gDjcBA0sNXWpOgNEaIrZmD2SfZUUlu7Dt4wl4easX9ks E73e13r9HdXV9Z6nVcbYXAN2/T9FWGgncOKizw4RD2kVbEsxTu2GfCIP+7Rcc2n6Ivvq gfXGA8XDHLBT1gN1GLm0/qw4lVFOXXYme18UMScS5q2mT7l55nNruJzjEPmQqC/U0bCa 2JFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si1342838edx.342.2021.01.06.13.06.07; Wed, 06 Jan 2021 13:06:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbhAFVEu (ORCPT + 99 others); Wed, 6 Jan 2021 16:04:50 -0500 Received: from mga07.intel.com ([134.134.136.100]:49215 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbhAFVEt (ORCPT ); Wed, 6 Jan 2021 16:04:49 -0500 IronPort-SDR: ywjl1Huv6Qc4FASp0E/XuIuhO438Ym57gejReJ6BasWx2QBTlvmBYqE5rquU6zhZsDwzwTcq/E wTfPkgC9zBuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9856"; a="241413126" X-IronPort-AV: E=Sophos;i="5.79,328,1602572400"; d="scan'208";a="241413126" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2021 13:04:07 -0800 IronPort-SDR: NfpCknYYu5WmTKgIWW28XFArek/3xVp1Y1pSf2H3YFL6dbehLhDzQB/D2aPne6GMG8S9ELbSpF ybLSKS3fsz5Q== X-IronPort-AV: E=Sophos;i="5.79,328,1602572400"; d="scan'208";a="346776914" Received: from pthatich-mobl1.amr.corp.intel.com (HELO intel.com) ([10.252.142.206]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2021 13:04:07 -0800 Date: Wed, 6 Jan 2021 13:04:06 -0800 From: Ben Widawsky To: Dan Williams Cc: Dave Jiang , Borislav Petkov , X86 ML , kernel test robot , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Linux Kernel Mailing List Subject: Re: [PATCH] x86: fix movdir64b() sparse warning Message-ID: <20210106210406.4gqdxhuvrjki5v6h@intel.com> References: <160996560236.3973505.14624475570488164641.stgit@djiang5-desk3.ch.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-01-06 12:59:35, Dan Williams wrote: > On Wed, Jan 6, 2021 at 12:40 PM Dave Jiang wrote: > > > > Add missing __iomem anotation to address sparse warning. > > s/anotation/annotation/ > > > > > "sparse warnings: (new ones prefixed by >>)" > > drivers/dma/idxd/submit.c: note: in included file (through include/linux/io.h, include/linux/pci.h): > > >> arch/x86/include/asm/io.h:422:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *dst @@ got void [noderef] __iomem *dst @@ > > arch/x86/include/asm/io.h:422:27: sparse: expected void *dst > > arch/x86/include/asm/io.h:422:27: sparse: got void [noderef] __iomem *dst > > The sparse spew is somewhat interesting, but what would be more > helpful is explain the why. I.e. that existing and future users expect > to be passing an __iomem annotated pointer to this routine because... > . Otherwise someone (reviewer / future git blame > user) might reasonably ask, "well, why is the driver passing an > __iomem annotated pointer in the first instance?". > > To Ben's point you might also duplicate part of the comment from > movdir64b and say: > > "Recall, from the comment in movdir64b @__dst must be supplied as an > lvalue because this tells the compiler what the object is (its size) > the instruction accesses. I.e., not the pointers but what they point > to, thus the deref'ing '*'." Thanks for pasting this, I missed that. It still doesn't make sense to me why the compiler needs to know this. I guess it makes sense to the rest of you. > > With clarified changelog for both you can add: > > Reviewed-by: Dan Williams