Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp443203pxu; Thu, 7 Jan 2021 08:48:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJydbHp4fMg7YQJRMCKfC+WwP4m//mq/0hb3KYIyKNaGrf/Wf8TQF1jZMB/7h6zlrdHpDm6V X-Received: by 2002:a17:906:178d:: with SMTP id t13mr1407739eje.455.1610038107334; Thu, 07 Jan 2021 08:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610038107; cv=none; d=google.com; s=arc-20160816; b=Z5Dj8wlp5rM54T4+lTSTfGkGoYBSKzyYKwJA8DYiij+bEKWWd/0pDpJ0jzTXVXGBKN CuF0tJyaiZPiPS+Ex/jlKOKwB8xekgi2WCVRAR5elgGxAawUfn/ALnELepmVlxNWLlY5 ciZBA5pRuVxAOBTRXoWT2/RKL28B2WfD3f3wzVOzf260+z8T7vPLs8s5hZSblpB5FsxJ 3SF4iCwjPD6fAM7C3NIWCGsvW+AI9y28Eo/8Jc4ANc6tlVp30+uaNcFAltGS3ZRBmRkp 9YfdQ0ARWRWtrOgdZJ4S3aBfnczfA3WVU97nTOAv+zpOyqnkG4psaWBOnEi389eJPG4L aqzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=+lvTr/sb15C03Hb++QTSmtfzyQzKNS1nZOPA7Yk5FIk=; b=BH4CYtJL4j3gSUc13Cdep7mmNNaaa/tMaBaw458R53oy9UeDVZ1alM5e8kELlHcgRL eAAUJTefkbnpuYBH+NvXWbYiWk0Yt+vSP4Rco1yW4+NO6k49darl5Stg+tyxR7EAOskr S8S0StOq9N446Y8BOqNd4+lzCiQzi0SH3RVKui5ij4ZK9psTWSWQ90FC5Vl4z18ZxUaJ oeAqjfT4s9FSHLN4CNSFsxA6RHFnSAqaEFcgGoHInMzFe1UFWAYIXAJbGkAh5+qLNGNX okZpSQKeO2Ea4sh/9TD+S7d0sPFSH3BVbc5FScuLkOcLDWqE5340FnaYY85SXNCNKGSo gPsw== 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 si15si2472810ejb.394.2021.01.07.08.48.03; Thu, 07 Jan 2021 08:48:27 -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 S1728974AbhAGQpu (ORCPT + 99 others); Thu, 7 Jan 2021 11:45:50 -0500 Received: from mga02.intel.com ([134.134.136.20]:47738 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728210AbhAGQpt (ORCPT ); Thu, 7 Jan 2021 11:45:49 -0500 IronPort-SDR: EIG6c2EpIiS4srB3fDR/dPzul0ErpcNLM1RldPCFaCdL8UnmuVMhBnWMtvlxgUa+1safFlLYWt iuXrYMO/26NQ== X-IronPort-AV: E=McAfee;i="6000,8403,9857"; a="164524615" X-IronPort-AV: E=Sophos;i="5.79,329,1602572400"; d="scan'208";a="164524615" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 08:45:22 -0800 IronPort-SDR: teG6szFSg8FXQwpak2aOHdYrr7/o8Q1/7nR8bW2u+EA+sWVhYwt9WHl82ZJyRpjguSRXRHrr2s tUj554Dbco0Q== X-IronPort-AV: E=Sophos;i="5.79,329,1602572400"; d="scan'208";a="567818451" Received: from djiang5-desk3.ch.intel.com ([143.182.136.137]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 08:45:21 -0800 Subject: [PATCH v3] x86: fix enqcmds() with missing __iomem annotation From: Dave Jiang To: bp@alien8.de, x86@kernel.org Cc: kernel test robot , Ben Widawsky , Dan Williams , dan.j.williams@intel.com, ben.widawsky@intel.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org Date: Thu, 07 Jan 2021 09:45:21 -0700 Message-ID: <161003789741.4062451.14362269365703761223.stgit@djiang5-desk3.ch.intel.com> User-Agent: StGit/0.23-29-ga622f1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add missing __iomem annotation to address sparse warning. Caller is expected to pass an __iomem annotated pointer to this function. The current usages send a 64bytes command descriptor to an MMIO location (portal) on a device for consumption. Also, from the comment in movdir64b(), which also applies to enqcmds(), @__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 '*'." "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 drivers/dma/idxd/submit.c: note: in included file (through arch/x86/include/asm/processor.h, arch/x86/include/asm/timex.h, include/linux/timex.h, ...): >> arch/x86/include/asm/special_insns.h:289:41: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct *__dst @@ got void [noderef] __iomem *dst @@ arch/x86/include/asm/special_insns.h:289:41: sparse: expected struct *__dst arch/x86/include/asm/special_insns.h:289:41: sparse: got void [noderef] __iomem *dst Fixes: 7f5933f81bd8 ("x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction") Reported-by: kernel test robot Reviewed-by: Ben Widawsky Reviewed-by: Dan Williams Signed-off-by: Dave Jiang --- v3: - Update subject with comments from Boris. v2: - Update commit log with comments from Dan. arch/x86/include/asm/special_insns.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 4e234645f0c6..1d3cbaef4bb7 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h @@ -286,7 +286,7 @@ static inline void movdir64b(void __iomem *dst, const void *src) static inline int enqcmds(void __iomem *dst, const void *src) { const struct { char _[64]; } *__src = src; - struct { char _[64]; } *__dst = dst; + struct { char _[64]; } __iomem *__dst = dst; int zf; /*