Message ID | 20231123040355.82139-13-david.e.box@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp207595vqx; Wed, 22 Nov 2023 20:05:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsFtypZcOi8vJUOWyIqcUttpvNeKQzRCHxBt0wCihahwmadH8o2qAiwh1LMVIVeNxNK0Sw X-Received: by 2002:a05:6a00:3926:b0:68f:a92a:8509 with SMTP id fh38-20020a056a00392600b0068fa92a8509mr2443821pfb.7.1700712322230; Wed, 22 Nov 2023 20:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712322; cv=none; d=google.com; s=arc-20160816; b=zHq0/EBgKQOGTdRpBbxwcnBk6eMLSrF3Z4KHB/KPwihzMBReFyKKSCLdJVnZUkqbAx 8340iUpOSJ4ghl9izXwtLv6gkyC0SrmU/qCmU4v0PFyqNoQStM4a0+7ZIMl+0a9ZoHzi o6UDWSLZB188GDuAdG7y2mHTIB7qF7ugQYsqqJ4ZIHBU9mzEaGBI2pLjumnuUW7fGQXd SwR+UBMuxKb6BZAgQT3uY4kEm3olJ7u12TvoThJOu7onUi3B7bncYpd4mLLEgxJ0BjDy GyQh40VN5UE/TS2qqf0ykOIk+W4Dl+Voo2xaIF+i1lahKJ9IePDnmPmp9wkipxKjjUTS bAVA== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5ESILGEUPpbzOxOBRSBkGP73mDWWwhQ1lBx+97QIyNw=; fh=aBF56gt1ZIoBM/Km9IExMMgXxUSat1xZCoUaU7LtMu4=; b=QUbJdwu5soqGbXGRSjWMLkbra9urvlmX797re/KGc8d2ktjNNHXWaDRmZzuNzwXczG BeD2984w7u2YEKVCt6ayr8m/72NMb2OziI4NRPzjtYuKS9TAR3qn4yVtf5cnneodSyVE 3cVa2kwDOnBxVyejyGMKHfHN3dXfmaaB86DmI8BQhfe0BIVhwOYodHqKVtwDtMY5uLMX 3rXysOdsV11/csEuC9nI59y1B3jMTeoIgb9EOvlk/nHm6/0b9FPwnGEosQJcuGF98eOC C/xpMvk3nQcHewcD/NidmAMSch41Sn3P7ppum/JFbBbvwLLClb60bu2qWcRYBTZNWXew sqmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=asa4+sDC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id i9-20020a63e909000000b005b42f4443b7si510909pgh.653.2023.11.22.20.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:05:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=asa4+sDC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3696B83B2E29; Wed, 22 Nov 2023 20:05:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344751AbjKWEE5 (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 23:04:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbjKWEDx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 23:03:53 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13B11D48; Wed, 22 Nov 2023 20:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700712240; x=1732248240; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=5ZZAKxI4gVSEhTRWxoAY8gcBKY1IXr9jOeKv5If/tc8=; b=asa4+sDCer8oL6EvCBvQ2oOOHS+KlIJMRg7xnBL+AE7Gf5TDURuGAmf2 Q+Zd09rPaDWaCrezuNGCylWFIwk17toqzXXRFSxJidfgS7v95ml7xwlcy KD1qQlXOEEg2IOtBrtdnHpcEsE5163bI5kIWKJ504E1CJB3JJHnPFYBlq 8LACWQzy+UQkp4N5kFLMEFzQ62aFbCXoGBSzZxRG92VOgd1MRYpMZciFd vPFAun+QljxVduibEeLvorfWZ1ovuCQwt2sT/Ju9PgcZq1pj+NKjjdIOO F7H71yPpXSqAqMzvmjXY3uFg6sWaYAI4ZKfnoa+uJ8qf1DDu8HR1/+Nyu A==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="5334663" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="5334663" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="837671154" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="837671154" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:57 -0800 Received: from debox1-desk4.lan (snpatel1-mobl.amr.corp.intel.com [10.209.89.91]) by linux.intel.com (Postfix) with ESMTP id C57AF580CA6; Wed, 22 Nov 2023 20:03:56 -0800 (PST) From: "David E. Box" <david.e.box@linux.intel.com> To: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, ilpo.jarvinen@linux.intel.com, rajvi.jingar@linux.intel.com, dave.hansen@linux.intel.com, peterz@infradead.org Subject: [PATCH V5 12/20] asm-generic/io.h: iounmap/ioport_unmap cleanup.h support Date: Wed, 22 Nov 2023 20:03:47 -0800 Message-Id: <20231123040355.82139-13-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123040355.82139-1-david.e.box@linux.intel.com> References: <20231123040355.82139-1-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 20:05:15 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783326124207884060 X-GMAIL-MSGID: 1783326124207884060 |
Series |
intel_pmc: Add telemetry API to read counters
|
|
Commit Message
David E. Box
Nov. 23, 2023, 4:03 a.m. UTC
Add auto-release cleanups for iounmap() and ioport_unmap().
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
V2 - Move from linux/io.h to asm-generic/io.h. Adds iounmap cleanup if
iounmap() is defined. Adds ioport_unmap cleanup if CONFIG_IOPORT_MAP
is defined.
include/asm-generic/io.h | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On Wed, 22 Nov 2023, David E. Box wrote: > Add auto-release cleanups for iounmap() and ioport_unmap(). > > Signed-off-by: David E. Box <david.e.box@linux.intel.com> > Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > --- > V2 - Move from linux/io.h to asm-generic/io.h. Adds iounmap cleanup if > iounmap() is defined. Adds ioport_unmap cleanup if CONFIG_IOPORT_MAP > is defined. > > include/asm-generic/io.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index bac63e874c7b..9ef0332490b1 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -8,6 +8,7 @@ > #define __ASM_GENERIC_IO_H > > #include <asm/page.h> /* I/O is all done through memory accesses */ > +#include <linux/cleanup.h> > #include <linux/string.h> /* for memset() and memcpy() */ > #include <linux/types.h> > #include <linux/instruction_pointer.h> > @@ -1065,6 +1066,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, size_t size) > #endif > #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ > > +#ifdef iounmap > +DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); > +#endif > + > #ifndef ioremap_wc > #define ioremap_wc ioremap > #endif > @@ -1127,6 +1132,7 @@ static inline void ioport_unmap(void __iomem *p) > extern void __iomem *ioport_map(unsigned long port, unsigned int nr); > extern void ioport_unmap(void __iomem *p); > #endif /* CONFIG_GENERIC_IOMAP */ > +DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T)); > #endif /* CONFIG_HAS_IOPORT_MAP */ > > #ifndef CONFIG_GENERIC_IOMAP Has this now built successfully with LKP? (I don't think we get success notifications from LKP for patch submissions, only failures). There were some odd errors last time but I think all they were unrelated to this change (besides the checkpatch false positive, I mean).
On Thu, 2023-11-23 at 16:30 +0200, Ilpo Järvinen wrote: > On Wed, 22 Nov 2023, David E. Box wrote: > > > Add auto-release cleanups for iounmap() and ioport_unmap(). > > > > Signed-off-by: David E. Box <david.e.box@linux.intel.com> > > Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > > --- > > V2 - Move from linux/io.h to asm-generic/io.h. Adds iounmap cleanup if > > iounmap() is defined. Adds ioport_unmap cleanup if CONFIG_IOPORT_MAP > > is defined. > > > > include/asm-generic/io.h | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > index bac63e874c7b..9ef0332490b1 100644 > > --- a/include/asm-generic/io.h > > +++ b/include/asm-generic/io.h > > @@ -8,6 +8,7 @@ > > #define __ASM_GENERIC_IO_H > > > > #include <asm/page.h> /* I/O is all done through memory accesses */ > > +#include <linux/cleanup.h> > > #include <linux/string.h> /* for memset() and memcpy() */ > > #include <linux/types.h> > > #include <linux/instruction_pointer.h> > > @@ -1065,6 +1066,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, > > size_t size) > > #endif > > #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ > > > > +#ifdef iounmap > > +DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); > > +#endif > > + > > #ifndef ioremap_wc > > #define ioremap_wc ioremap > > #endif > > @@ -1127,6 +1132,7 @@ static inline void ioport_unmap(void __iomem *p) > > extern void __iomem *ioport_map(unsigned long port, unsigned int nr); > > extern void ioport_unmap(void __iomem *p); > > #endif /* CONFIG_GENERIC_IOMAP */ > > +DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T)); > > #endif /* CONFIG_HAS_IOPORT_MAP */ > > > > #ifndef CONFIG_GENERIC_IOMAP > > Has this now built successfully with LKP? (I don't think we get success > notifications from LKP for patch submissions, only failures). I haven't received it yet and don't know when or if I will. The build instructions are provided so I can attempt to check it myself. > > There were some odd errors last time but I think all they were unrelated > to this change (besides the checkpatch false positive, I mean). Indeed. I couldn't explain them either except to think maybe it was related to the implicit declaration warning. The implicit declaration warning was one that I did see in my build after rerunning with W=1 C=1. I usually always run with this but on V4 had done so only on the modules and forgot the bzImage. David >
Hi David, kernel test robot noticed the following build errors: [auto build test ERROR on b85ea95d086471afb4ad062012a4d73cd328fa86] url: https://github.com/intel-lab-lkp/linux/commits/David-E-Box/platform-x86-intel-vsec-Fix-xa_alloc-memory-leak/20231123-120726 base: b85ea95d086471afb4ad062012a4d73cd328fa86 patch link: https://lore.kernel.org/r/20231123040355.82139-13-david.e.box%40linux.intel.com patch subject: [PATCH V5 12/20] asm-generic/io.h: iounmap/ioport_unmap cleanup.h support config: s390-randconfig-001-20231123 (https://download.01.org/0day-ci/archive/20231124/202311241214.jcL84du7-lkp@intel.com/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231124/202311241214.jcL84du7-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202311241214.jcL84du7-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/s390/include/asm/io.h:78: include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x)) ^ include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16' #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x)) ^ In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/s390/include/asm/io.h:78: include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x)) ^ include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32' #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x)) ^ In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/s390/include/asm/io.h:78: include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] readsl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesb(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesw(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] writesl(PCI_IOBASE + addr, buffer, count); ~~~~~~~~~~ ^ >> include/asm-generic/io.h:1070:38: error: call to undeclared function 'iounmap'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); ^ arch/s390/include/asm/io.h:29:17: note: expanded from macro 'iounmap' #define iounmap iounmap ^ include/asm-generic/io.h:1070:38: note: did you mean 'vunmap'? arch/s390/include/asm/io.h:29:17: note: expanded from macro 'iounmap' #define iounmap iounmap ^ include/linux/vmalloc.h:167:13: note: 'vunmap' declared here extern void vunmap(const void *addr); ^ In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:591: In file included from arch/s390/include/asm/hw_irq.h:6: In file included from include/linux/pci.h:37: In file included from include/linux/device.h:32: In file included from include/linux/device/driver.h:21: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/s390/include/asm/elf.h:160: include/linux/compat.h:454:22: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds] case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; ^ ~ arch/s390/include/asm/signal.h:22:9: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:591: In file included from arch/s390/include/asm/hw_irq.h:6: In file included from include/linux/pci.h:37: In file included from include/linux/device.h:32: In file included from include/linux/device/driver.h:21: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/s390/include/asm/elf.h:160: include/linux/compat.h:454:10: warning: array index 7 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds] case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; ^ ~ include/linux/compat.h:130:2: note: array 'sig' declared here compat_sigset_word sig[_COMPAT_NSIG_WORDS]; ^ include/linux/compat.h:454:42: warning: array index 6 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds] case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; ^ ~ include/linux/compat.h:130:2: note: array 'sig' declared here compat_sigset_word sig[_COMPAT_NSIG_WORDS]; ^ include/linux/compat.h:454:53: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds] case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; ^ ~ arch/s390/include/asm/signal.h:22:9: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:591: In file included from arch/s390/include/asm/hw_irq.h:6: In file included from include/linux/pci.h:37: In file included from include/linux/device.h:32: In file included from include/linux/device/driver.h:21: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/s390/include/asm/elf.h:160: include/linux/compat.h:456:22: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds] case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; ^ ~ arch/s390/include/asm/signal.h:22:9: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ In file included from arch/s390/kernel/asm-offsets.c:11: In file included from include/linux/kvm_host.h:19: In file included from include/linux/msi.h:27: In file included from include/linux/irq.h:591: In file included from arch/s390/include/asm/hw_irq.h:6: In file included from include/linux/pci.h:37: In file included from include/linux/device.h:32: In file included from include/linux/device/driver.h:21: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/s390/include/asm/elf.h:160: include/linux/compat.h:456:10: warning: array index 5 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds] case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; ^ ~ include/linux/compat.h:130:2: note: array 'sig' declared here compat_sigset_word sig[_COMPAT_NSIG_WORDS]; ^ include/linux/compat.h:456:42: warning: array index 4 is past the end of the array (that has type 'compat_sigset_word[2]' (aka 'unsigned int[2]')) [-Warray-bounds] case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; ^ ~ include/linux/compat.h:130:2: note: array 'sig' declared here compat_sigset_word sig[_COMPAT_NSIG_WORDS]; ^ include/linux/compat.h:456:53: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds] case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; vim +/iounmap +1070 include/asm-generic/io.h 1068 1069 #ifdef iounmap > 1070 DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); 1071 #endif 1072
+Baoquan for ioremap question. On Thu, 2023-11-23 at 16:30 +0200, Ilpo Järvinen wrote: > On Wed, 22 Nov 2023, David E. Box wrote: > > > Add auto-release cleanups for iounmap() and ioport_unmap(). > > > > Signed-off-by: David E. Box <david.e.box@linux.intel.com> > > Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > > --- > > V2 - Move from linux/io.h to asm-generic/io.h. Adds iounmap cleanup if > > iounmap() is defined. Adds ioport_unmap cleanup if CONFIG_IOPORT_MAP > > is defined. > > > > include/asm-generic/io.h | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > index bac63e874c7b..9ef0332490b1 100644 > > --- a/include/asm-generic/io.h > > +++ b/include/asm-generic/io.h > > @@ -8,6 +8,7 @@ > > #define __ASM_GENERIC_IO_H > > > > #include <asm/page.h> /* I/O is all done through memory accesses */ > > +#include <linux/cleanup.h> > > #include <linux/string.h> /* for memset() and memcpy() */ > > #include <linux/types.h> > > #include <linux/instruction_pointer.h> > > @@ -1065,6 +1066,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, > > size_t size) > > #endif > > #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ > > > > +#ifdef iounmap > > +DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); > > +#endif Baoquan, LKP is reporting an undeclared function 'iounmap' error with the above change from this patch when building for s390 with PCI disabled. The ioremap defines in arch/s390/include/asm/io.h are not wrapped under the #ifdef CONFIG_PCI block. Shouldn't they be since the s390 Kconfig only adds GENERIC_IOREMAP if PCI? https://lore.kernel.org/oe-kbuild-all/202311241214.jcL84du7-lkp@intel.com Note that the report includes pointer arithmetic warnings that are not related to this patch. Those warnings occur in mainline as well. David > > + > > #ifndef ioremap_wc > > #define ioremap_wc ioremap > > #endif > > @@ -1127,6 +1132,7 @@ static inline void ioport_unmap(void __iomem *p) > > extern void __iomem *ioport_map(unsigned long port, unsigned int nr); > > extern void ioport_unmap(void __iomem *p); > > #endif /* CONFIG_GENERIC_IOMAP */ > > +DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T)); > > #endif /* CONFIG_HAS_IOPORT_MAP */ > > > > #ifndef CONFIG_GENERIC_IOMAP > > Has this now built successfully with LKP? (I don't think we get success > notifications from LKP for patch submissions, only failures). > > There were some odd errors last time but I think all they were unrelated > to this change (besides the checkpatch false positive, I mean). >
On 11/27/23 at 05:55pm, David E. Box wrote: > +Baoquan for ioremap question. > > On Thu, 2023-11-23 at 16:30 +0200, Ilpo Järvinen wrote: > > On Wed, 22 Nov 2023, David E. Box wrote: > > > > > Add auto-release cleanups for iounmap() and ioport_unmap(). > > > > > > Signed-off-by: David E. Box <david.e.box@linux.intel.com> > > > Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > > > --- > > > V2 - Move from linux/io.h to asm-generic/io.h. Adds iounmap cleanup if > > > iounmap() is defined. Adds ioport_unmap cleanup if CONFIG_IOPORT_MAP > > > is defined. > > > > > > include/asm-generic/io.h | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > > index bac63e874c7b..9ef0332490b1 100644 > > > --- a/include/asm-generic/io.h > > > +++ b/include/asm-generic/io.h > > > @@ -8,6 +8,7 @@ > > > #define __ASM_GENERIC_IO_H > > > > > > #include <asm/page.h> /* I/O is all done through memory accesses */ > > > +#include <linux/cleanup.h> > > > #include <linux/string.h> /* for memset() and memcpy() */ > > > #include <linux/types.h> > > > #include <linux/instruction_pointer.h> > > > @@ -1065,6 +1066,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, > > > size_t size) > > > #endif > > > #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ > > > > > > +#ifdef iounmap > > > +DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); > > > +#endif > > Baoquan, LKP is reporting an undeclared function 'iounmap' error with the above > change from this patch when building for s390 with PCI disabled. The ioremap > defines in arch/s390/include/asm/io.h are not wrapped under the #ifdef > CONFIG_PCI block. Shouldn't they be since the s390 Kconfig only adds > GENERIC_IOREMAP if PCI? Sorry, almost forget this mail. Will check and reply later. > > https://lore.kernel.org/oe-kbuild-all/202311241214.jcL84du7-lkp@intel.com > > > Note that the report includes pointer arithmetic warnings that are not related > to this patch. Those warnings occur in mainline as well. > > David > > > > + > > > #ifndef ioremap_wc > > > #define ioremap_wc ioremap > > > #endif > > > @@ -1127,6 +1132,7 @@ static inline void ioport_unmap(void __iomem *p) > > > extern void __iomem *ioport_map(unsigned long port, unsigned int nr); > > > extern void ioport_unmap(void __iomem *p); > > > #endif /* CONFIG_GENERIC_IOMAP */ > > > +DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T)); > > > #endif /* CONFIG_HAS_IOPORT_MAP */ > > > > > > #ifndef CONFIG_GENERIC_IOMAP > > > > Has this now built successfully with LKP? (I don't think we get success > > notifications from LKP for patch submissions, only failures). > > > > There were some odd errors last time but I think all they were unrelated > > to this change (besides the checkpatch false positive, I mean). > > >
On 11/27/23 at 05:55pm, David E. Box wrote: > +Baoquan for ioremap question. > > On Thu, 2023-11-23 at 16:30 +0200, Ilpo Järvinen wrote: > > On Wed, 22 Nov 2023, David E. Box wrote: > > > > > Add auto-release cleanups for iounmap() and ioport_unmap(). > > > > > > Signed-off-by: David E. Box <david.e.box@linux.intel.com> > > > Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> > > > --- > > > V2 - Move from linux/io.h to asm-generic/io.h. Adds iounmap cleanup if > > > iounmap() is defined. Adds ioport_unmap cleanup if CONFIG_IOPORT_MAP > > > is defined. > > > > > > include/asm-generic/io.h | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > > > index bac63e874c7b..9ef0332490b1 100644 > > > --- a/include/asm-generic/io.h > > > +++ b/include/asm-generic/io.h > > > @@ -8,6 +8,7 @@ > > > #define __ASM_GENERIC_IO_H > > > > > > #include <asm/page.h> /* I/O is all done through memory accesses */ > > > +#include <linux/cleanup.h> > > > #include <linux/string.h> /* for memset() and memcpy() */ > > > #include <linux/types.h> > > > #include <linux/instruction_pointer.h> > > > @@ -1065,6 +1066,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, > > > size_t size) > > > #endif > > > #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ > > > > > > +#ifdef iounmap > > > +DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); > > > +#endif > > Baoquan, LKP is reporting an undeclared function 'iounmap' error with the above > change from this patch when building for s390 with PCI disabled. The ioremap > defines in arch/s390/include/asm/io.h are not wrapped under the #ifdef > CONFIG_PCI block. Shouldn't they be since the s390 Kconfig only adds > GENERIC_IOREMAP if PCI? > > https://lore.kernel.org/oe-kbuild-all/202311241214.jcL84du7-lkp@intel.com I tried to reproduce the error, while I got failure as below. I will find a s390x machine to try again. --------------------------------------------------------- [root@ linux]# COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang-16 ~/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=s390 olddefconfig Compiler will be installed in /root/0day PATH=/root/0day/llvm-16.0.6-x86_64/bin:/root/.local/bin:/root/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin make --keep-going HOSTCC=/root/0day/llvm-16.0.6-x86_64/bin/clang CC=/root/0day/llvm-16.0.6-x86_64/bin/clang OBJCOPY=/usr/s390x-linux-gnu/bin/objcopy AR=llvm-ar NM=llvm-nm STRIP=llvm-strip OBJDUMP=llvm-objdump OBJSIZE=llvm-size READELF=llvm-readelf HOSTCXX=clang++ HOSTAR=llvm-ar CROSS_COMPILE=s390x-linux-gnu- --jobs=128 KCFLAGS= -Wtautological-compare -Wno-error=return-type -Wreturn-type -Wcast-function-type -funsigned-char -Wundef -fstrict-flex-arrays=3 -Wenum-conversion W=1 O=build_dir ARCH=s390 olddefconfig make[1]: Entering directory '/root/linux/build_dir' GEN Makefile scripts/Kconfig.include:40: linker 's390x-linux-gnu-ld' not found make[3]: *** [../scripts/kconfig/Makefile:77: olddefconfig] Error 1 make[2]: *** [/root/linux/Makefile:685: olddefconfig] Error 2 make[1]: *** [/root/linux/Makefile:234: __sub-make] Error 2 make[1]: Target 'olddefconfig' not remade because of errors. make[1]: Leaving directory '/root/linux/build_dir' make: *** [Makefile:234: __sub-make] Error 2 make: Target 'olddefconfig' not remade because of errors. ------------------------------------------------------------------ And when I execute the 3rd step of reproducer to apply the required patch series, I never succeed. Don't know why. ---------------------------------------------------------------- [root@intel-knightslanding-lb-02 linux]# b4 shazam https://lore.kernel.org/r/20231123040355.82139-13-david.e.box@linux.intel.com Grabbing thread from lore.kernel.org/all/20231123040355.82139-13-david.e.box@linux.intel.com/t.mbox.gz Checking for newer revisions Grabbing search results from lore.kernel.org Added from v6: 21 patches Analyzing 63 messages in the thread Will use the latest revision: v6 You can pick other revisions using the -vN flag Checking attestation on all messages, may take a moment... --- ✓ [PATCH v6 1/20] platform/x86/intel/vsec: Fix xa_alloc memory leak ---------------------------------------------------------------- > > > Note that the report includes pointer arithmetic warnings that are not related > to this patch. Those warnings occur in mainline as well. > > David > > > > + > > > #ifndef ioremap_wc > > > #define ioremap_wc ioremap > > > #endif > > > @@ -1127,6 +1132,7 @@ static inline void ioport_unmap(void __iomem *p) > > > extern void __iomem *ioport_map(unsigned long port, unsigned int nr); > > > extern void ioport_unmap(void __iomem *p); > > > #endif /* CONFIG_GENERIC_IOMAP */ > > > +DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T)); > > > #endif /* CONFIG_HAS_IOPORT_MAP */ > > > > > > #ifndef CONFIG_GENERIC_IOMAP > > > > Has this now built successfully with LKP? (I don't think we get success > > notifications from LKP for patch submissions, only failures). > > > > There were some odd errors last time but I think all they were unrelated > > to this change (besides the checkpatch false positive, I mean). > > >
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index bac63e874c7b..9ef0332490b1 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -8,6 +8,7 @@ #define __ASM_GENERIC_IO_H #include <asm/page.h> /* I/O is all done through memory accesses */ +#include <linux/cleanup.h> #include <linux/string.h> /* for memset() and memcpy() */ #include <linux/types.h> #include <linux/instruction_pointer.h> @@ -1065,6 +1066,10 @@ static inline void __iomem *ioremap(phys_addr_t addr, size_t size) #endif #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ +#ifdef iounmap +DEFINE_FREE(iounmap, void __iomem *, iounmap(_T)); +#endif + #ifndef ioremap_wc #define ioremap_wc ioremap #endif @@ -1127,6 +1132,7 @@ static inline void ioport_unmap(void __iomem *p) extern void __iomem *ioport_map(unsigned long port, unsigned int nr); extern void ioport_unmap(void __iomem *p); #endif /* CONFIG_GENERIC_IOMAP */ +DEFINE_FREE(ioport_unmap, void __iomem *, ioport_unmap(_T)); #endif /* CONFIG_HAS_IOPORT_MAP */ #ifndef CONFIG_GENERIC_IOMAP