Message ID | 20231025214811.2066376-1-mathieu.desnoyers@efficios.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp257674vqb; Wed, 25 Oct 2023 14:48:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2Kkw6/9S2gaCbwOiONNcDfvQYv4aNnoL2R0MqNO7d4lvOFJIJKYtzCa4QK+T/KVAbTOaW X-Received: by 2002:a25:374f:0:b0:da0:4d4d:da6a with SMTP id e76-20020a25374f000000b00da04d4dda6amr5202856yba.42.1698270493801; Wed, 25 Oct 2023 14:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698270493; cv=none; d=google.com; s=arc-20160816; b=lWDkIA3u8uirGiQjDONatGT1sT48S2jpY89ii5EKb4nrs+cmF7C2tE7W5umv9pXAVM +W+qx3H7+hNUVPaOvUfP/HTIYtawfnb0ISgjPr9RRvxiNSafHMJ+SbmliKeH7L0qJBMR o2sCJ2aCCWEPrauHIlprIXYIxT9a5X8zJi/3Xvldo4a+wEGGC7E92OBVKQGMs4Yf8xsT CNccrBlLg2XT06PpEqstxq+X/g256kOHilPTdMLJfFUORUayRj6/9QZUp3xWh6WvvQMy b1HClqI1sTEYrxv4n5PkfyAKSrZ8YFQsE3TzO3fw3NPBN8V3AwlNZXDRjiE+Rs3iFzin 0zdg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8tSKa0HgdWYulSoiXZKm44fXO771HcZyFUGdgFqIvd4=; fh=uEEAtRcJYtiS6DedIKKo1qno7ioKI2axq6Yg7vU01Kw=; b=fIW6IUvv+fJvSQc6IOnhm0DmpBFiOle+ujNkbrNtJk4c4ohb2NDdpg7eqZlHLOfHi5 sVmNoAXs7z20smrixBglHAD/aSj6ZAsbKu1mlRIpjtLopqEmK8k1P9o5xduYCVwO/X0Y RZQt90ioMZLb7GYxLXCDIp1C2cUhAURGP2I2Kbso4Rf6Ntz6MXjTBK9Myl4jTwb9D1P+ zmF8V0y/YlxONvs0Goy6KfElLihnH4sVuY92q3RGk7MMIrxLWKIfxnOw/+WeakBt2sNN G1O/ipK46YK0N6wpZXTYVWVVh+e4UU+nQ2Yc+znSc4ShhPo71StGsiQGRnStexqLB/wo 14DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=evucBCtL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f17-20020a25b091000000b00d77f78ab3a7si12499932ybj.479.2023.10.25.14.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 14:48:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=evucBCtL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 627E481A43D4; Wed, 25 Oct 2023 14:48:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbjJYVsJ (ORCPT <rfc822;a1648639935@gmail.com> + 25 others); Wed, 25 Oct 2023 17:48:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjJYVsI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Oct 2023 17:48:08 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5141A3 for <linux-kernel@vger.kernel.org>; Wed, 25 Oct 2023 14:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1698270481; bh=OBn+A/l8SxiCM8pYkWDBMu9Vbe4Ej9dhbMErkCapgFw=; h=From:To:Cc:Subject:Date:From; b=evucBCtLcRhgzcOxhGkDUg2KZQigvdnMoGnGLRA/lXtNB4Px44KjpH5/wqK5t1qqV i9JRbGmj477Ws9acTCjwBCYgagzV7aBI2kzStfkPEd1nOKzmu0xGS+ZEOusZYPnB5r YTZPX7e7rR9hVpuSBKtp6vRaJj3wfxa+NuMKrC90QtmGgrva78UQ1iDkh6ffg192us ndevKMtGwXpayEe4dxW4t979pijO7qNTa9yFyME8JQ3Ki77VMkdd54cionaDaALXC2 Bb2P8rXFuV8cOlntv3A/PP3ZF4DS1uulwZfCPoYbU1rdCYMDUYdr7yKE2TZvzz/MCy RHrjScjSh95jw== Received: from thinkos.internal.efficios.com (unknown [IPv6:2606:6d00:100:4000:582e:ab84:d98b:7516]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4SG2bj2Hg9z1ZC5; Wed, 25 Oct 2023 17:48:01 -0400 (EDT) From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> To: Peter Zijlstra <peterz@infradead.org> Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Steven Rostedt <rostedt@goodmis.org> Subject: [PATCH] Fix: rseq uapi: Adapt header includes to follow glibc header changes Date: Wed, 25 Oct 2023 17:48:11 -0400 Message-Id: <20231025214811.2066376-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 25 Oct 2023 14:48:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780765681469308658 X-GMAIL-MSGID: 1780765681469308658 |
Series |
Fix: rseq uapi: Adapt header includes to follow glibc header changes
|
|
Commit Message
Mathieu Desnoyers
Oct. 25, 2023, 9:48 p.m. UTC
With "recent" glibc headers, using <sys/types.h> with __GNU_SOURCE fails
to have __u32 and others types needed by the rseq.h uapi header file.
Include ctype.h and asm/types.h to fix this. Add a __KERNEL__ #ifdef to
select the kernel vs userspace header includes.
Also, remove the now unneeded asm/byteorder.h include, since it also
causes its own build issues with "recent" glibc headers.
I'm cautiously using the term "recent" glibc here because I don't know
exactly in which glibc versions those changes happened. Steven
reproduced this issue with glibc 2.37 on Debian.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reported-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
---
include/uapi/linux/rseq.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Comments
On Wed, 2023-10-25 at 17:48 -0400, Mathieu Desnoyers wrote: > With "recent" glibc headers, using <sys/types.h> with __GNU_SOURCE > fails > to have __u32 and others types needed by the rseq.h uapi header file. > Include ctype.h and asm/types.h to fix this. Add a __KERNEL__ #ifdef > to > select the kernel vs userspace header includes. > > Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> > Reported-by: Steven Rostedt (Google) <rostedt@goodmis.org> > Cc: Steven Rostedt (Google) <rostedt@goodmis.org> > Cc: Peter Zijlstra (Intel) <peterz@infradead.org> > Acked-by: Rik van Riel <riel@surriel.com>
Hi Mathieu, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.6-rc7 next-20231026] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Mathieu-Desnoyers/Fix-rseq-uapi-Adapt-header-includes-to-follow-glibc-header-changes/20231026-054939 base: linus/master patch link: https://lore.kernel.org/r/20231025214811.2066376-1-mathieu.desnoyers%40efficios.com patch subject: [PATCH] Fix: rseq uapi: Adapt header includes to follow glibc header changes config: i386-randconfig-001-20231026 (https://download.01.org/0day-ci/archive/20231027/202310271556.LunB8KLv-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231027/202310271556.LunB8KLv-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/202310271556.LunB8KLv-lkp@intel.com/ All warnings (new ones prefixed by >>): >> usr/include/linux/rseq.h:14: include of <linux/types.h> is preferred over <asm/types.h> >> usr/include/linux/rseq.h:47: found __[us]{8,16,32,64} type without #include <linux/types.h>
On 2023-10-27 03:53, kernel test robot wrote: > Hi Mathieu, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on linus/master] > [also build test WARNING on v6.6-rc7 next-20231026] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] The test robot complains about using <asm/types.h> in uapi headers for !__KERNEL__ case. Steven, was there something wrong with including linux/types.h in uapi headers ? Thanks, Mathieu > > url: https://github.com/intel-lab-lkp/linux/commits/Mathieu-Desnoyers/Fix-rseq-uapi-Adapt-header-includes-to-follow-glibc-header-changes/20231026-054939 > base: linus/master > patch link: https://lore.kernel.org/r/20231025214811.2066376-1-mathieu.desnoyers%40efficios.com > patch subject: [PATCH] Fix: rseq uapi: Adapt header includes to follow glibc header changes > config: i386-randconfig-001-20231026 (https://download.01.org/0day-ci/archive/20231027/202310271556.LunB8KLv-lkp@intel.com/config) > compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231027/202310271556.LunB8KLv-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/202310271556.LunB8KLv-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > >>> usr/include/linux/rseq.h:14: include of <linux/types.h> is preferred over <asm/types.h> >>> usr/include/linux/rseq.h:47: found __[us]{8,16,32,64} type without #include <linux/types.h> >
On Fri, 27 Oct 2023 09:37:26 -0400 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: > On 2023-10-27 03:53, kernel test robot wrote: > > Hi Mathieu, > > > > kernel test robot noticed the following build warnings: > > > > [auto build test WARNING on linus/master] > > [also build test WARNING on v6.6-rc7 next-20231026] > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > And when submitting patch, we suggest to use '--base' as documented in > > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > The test robot complains about using <asm/types.h> in uapi headers for > !__KERNEL__ case. > > Steven, was there something wrong with including linux/types.h in uapi > headers ? > Actually, linux/types.h includes asm/types.h so I don't think that was the issue. I think the issue was mostly with: #include <asm/byteorder.h> Replacing linux/types.h with asm/types.h worked, but may have been unnecessary. -- Steve
On 2023-10-27 10:06, Steven Rostedt wrote: > On Fri, 27 Oct 2023 09:37:26 -0400 > Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: > >> On 2023-10-27 03:53, kernel test robot wrote: >>> Hi Mathieu, >>> >>> kernel test robot noticed the following build warnings: >>> >>> [auto build test WARNING on linus/master] >>> [also build test WARNING on v6.6-rc7 next-20231026] >>> [If your patch is applied to the wrong git tree, kindly drop us a note. >>> And when submitting patch, we suggest to use '--base' as documented in >>> https://git-scm.com/docs/git-format-patch#_base_tree_information] >> >> The test robot complains about using <asm/types.h> in uapi headers for >> !__KERNEL__ case. >> >> Steven, was there something wrong with including linux/types.h in uapi >> headers ? >> > > Actually, linux/types.h includes asm/types.h so I don't think that was the > issue. I think the issue was mostly with: > > #include <asm/byteorder.h> > > Replacing linux/types.h with asm/types.h worked, but may have been > unnecessary. Hi Steven, So what is the minimal change required to make things work on your setup? I just tested with a Debian "testing" chroot (with libc 2.37-12) and I cannot reproduce your issue. Should I just submit a patch that removes "#include <asm/byteorder.h>" ? I am really unsure which environments are affected though. Thanks, Mathieu
On Wed, 1 Nov 2023 16:10:04 -0400 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: > So what is the minimal change required to make things work on your > setup? I just tested with a Debian "testing" chroot (with libc 2.37-12) > and I cannot reproduce your issue. > > Should I just submit a patch that removes "#include <asm/byteorder.h>" ? > I am really unsure which environments are affected though. > I guess you can drop it :-p When I tried to reproduce it with hand writing 'gcc', I couldn't. But when I did: $ make foo It gave me the error. I was confused for a bit. Then I looked at what my Makefile was doing and what I was doing. The only difference was that the make included: -I. Removing that from the Makefile worked! My Makefile added to the CFLAGS "-I." and I forgot that this directory has a "linux/" directory in it that I used years ago to test kernel functions. The git history shows it was last touched in 2016 (when I was still at Red Hat) Removing -I. now makes everything work. I have no idea why it suddenly stopped working just a few months ago. Maybe something was moved out of the gcc headers so my local headers no longer see it. That is, perhaps the glibc headers moved something out and added a #include to it, where my local headers did not have that change. I don't know and I don't care. Well, at least now I know why I was getting errors on my build, but couldn't find anything on the internet showing why others were not! Sorry for the noise. :-/ -- Steve
On 2023-11-01 16:44, Steven Rostedt wrote: > On Wed, 1 Nov 2023 16:10:04 -0400 > Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: > >> So what is the minimal change required to make things work on your >> setup? I just tested with a Debian "testing" chroot (with libc 2.37-12) >> and I cannot reproduce your issue. >> >> Should I just submit a patch that removes "#include <asm/byteorder.h>" ? >> I am really unsure which environments are affected though. >> > > I guess you can drop it :-p OK, let's drop this patch then. I may respin the removal of asm/byteorder.h include as a cleanup in the future, but there is really no hurry. Thanks, Mathieu > > When I tried to reproduce it with hand writing 'gcc', I couldn't. But when > I did: > > $ make foo > > It gave me the error. I was confused for a bit. Then I looked at what my > Makefile was doing and what I was doing. The only difference was that the > make included: > > -I. > > Removing that from the Makefile worked! > > My Makefile added to the CFLAGS "-I." and I forgot that this directory has > a "linux/" directory in it that I used years ago to test kernel functions. > The git history shows it was last touched in 2016 (when I was still at Red Hat) > > Removing -I. now makes everything work. > > I have no idea why it suddenly stopped working just a few months ago. Maybe > something was moved out of the gcc headers so my local headers no longer > see it. That is, perhaps the glibc headers moved something out and added a > #include to it, where my local headers did not have that change. I don't > know and I don't care. > > Well, at least now I know why I was getting errors on my build, but > couldn't find anything on the internet showing why others were not! > > Sorry for the noise. :-/ > > -- Steve >
diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h index c233aae5eac9..0f9cd8211ff0 100644 --- a/include/uapi/linux/rseq.h +++ b/include/uapi/linux/rseq.h @@ -10,8 +10,12 @@ * Copyright (c) 2015-2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> */ -#include <linux/types.h> -#include <asm/byteorder.h> +#ifdef __KERNEL__ +# include <linux/types.h> +#else +# include <ctype.h> +# include <asm/types.h> +#endif enum rseq_cpu_id_state { RSEQ_CPU_ID_UNINITIALIZED = -1,