From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0600146D73 for ; Thu, 1 Aug 2024 22:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.202.169.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722551772; cv=none; b=uDu87AXglVCknlN8wlI2z4Eu+lzw06tjV1+nMtp7UetR5Tyt7mDpBIjbQWvI3/ESa0D/Wl1JLnJWHD+1Yi80OwpXA93TwxKqmGso4IZjyP4TRRRY0I2bAPEeTurF+FvIj/lLc3wJZDlv/ktnnkfGErcMXd85Kpkm5TAGeVSCs/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722551772; c=relaxed/simple; bh=io5ptOM2yLV7Yx6TkZgB3r0B2lEmO5avVNXyNXIP1Fc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oKL61kk5eqfp8wzFmBi8us+ckkK6HJDdQ5LUWzAg/GPDLs2J5nopnu+oGvM2G/qV0BgOE3QJ18/kcAq/OojTYhty9KpP1rNdlkACihHeY4XIj/h7/9QFtUKf3P/geN0s3dHPvXGolAiqnv8745BA04Iycpx4WMdWivgaq4ayT/s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com; spf=pass smtp.mailfrom=embeddedor.com; dkim=pass (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b=Dg9mD2MX; arc=none smtp.client-ip=44.202.169.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=embeddedor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b="Dg9mD2MX" Received: from eig-obgw-5006a.ext.cloudfilter.net ([10.0.29.179]) by cmsmtp with ESMTPS id Z1V7sy8fkiA19ZeOwsHqif; Thu, 01 Aug 2024 22:36:02 +0000 Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with ESMTPS id ZeOvsPjOHLd9nZeOvsXg9n; Thu, 01 Aug 2024 22:36:01 +0000 X-Authority-Analysis: v=2.4 cv=C4XvyxP+ c=1 sm=1 tr=0 ts=66ac0dd2 a=1YbLdUo/zbTtOZ3uB5T3HA==:117 a=frY+GlAHrI6frpeK1MvySw==:17 a=IkcTkHD0fZMA:10 a=yoJbH4e0A30A:10 a=VwQbUJbxAAAA:8 a=i3X5FwGiAAAA:8 a=QyXUC8HyAAAA:8 a=NEAV23lmAAAA:8 a=SBNduZsKBOnCDnG2JV0A:9 a=QEXdDO2ut3YA:10 a=IMS77xXFAjTPSJ8Q-sgV:22 a=AjGcO6oz07-iQ99wixmX:22 a=mmqRlSCDY2ywfjPLJ4af:22 a=Xt_RvD8W3m28Mn_h3AK8:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3MRVNS9BLDd/euXQzMdeIf+rl3T+v08bwDEE7pegjac=; b=Dg9mD2MXtuWUsyAV0oB+VR3Okj VyUsvtfrWDxL+WkEj4mFlWV5cTB57jpHsXBwr/Z/D9amX8xnFiFHZuxiqY3eDN2OHbjgKOM5bUntK Vwzo9y2jITds9KFNVFFSkH5KREnTd6lsajB4/pAeV6jHp+fmuOMmd14hacGX3Lpw/+0U7OAez62aA hCKGxPsTZ3rEAKyQXjAQ8I/ORsGtplofKxkOiHICfhDeuWJurziA/hbIlY7NmgFIgC+c1fqRX966V zfjGvs/N1wi+MKWV9mfQmRfMjSF0/h3fCMvZ1m0ntzXGJnbtqn97zBnfycVsHVcSUXSZ1TgORd4Zg hoVrYIDA==; Received: from [201.172.173.139] (port=59916 helo=[192.168.15.14]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1sZeOu-002cvG-2f; Thu, 01 Aug 2024 17:36:00 -0500 Message-ID: Date: Thu, 1 Aug 2024 16:35:59 -0600 Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [gustavoars:testing/wfamnae-next20240729-cbc-2 11/18] include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of struct_group_tagged() To: Nathan Chancellor Cc: kernel test robot , "Gustavo A. R. Silva" , llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, LKML , Brian Cain , linux-hexagon@vger.kernel.org References: <202408011956.wscyBwq6-lkp@intel.com> <138da3e5-0e24-41a6-bb35-df5d07045eb3@embeddedor.com> <20240801190813.GC122261@thelio-3990X> <20240801221427.GA3773553@thelio-3990X> Content-Language: en-US From: "Gustavo A. R. Silva" In-Reply-To: <20240801221427.GA3773553@thelio-3990X> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.linux.dev X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 201.172.173.139 X-Source-L: No X-Exim-ID: 1sZeOu-002cvG-2f X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.15.14]) [201.172.173.139]:59916 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Org: HG=hgshared;ORG=hostgator; X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfExy5KL4AAuys32GlUKHDF6RtxMBx48b9NpOnUMDTSzbgc778/HLuPUjFbzs6jk6wgAujf41eLsVjLUz0aoCtoeBqOYMVVEQ9gVuf+waRdO2qXshlhqE H4SNAqz96eyzAgrODyvVOlnQGc8nTLENSbsT9cdv7ykNnQVVW7EJxI41izZxu/JHRgr9+o/KZdqQLT2rYDmgZxeUTAu1cUhgSUg= On 01/08/24 16:14, Nathan Chancellor wrote: > On Thu, Aug 01, 2024 at 02:17:50PM -0600, Gustavo A. R. Silva wrote: >> >> >> On 01/08/24 13:08, Nathan Chancellor wrote: >>> On Thu, Aug 01, 2024 at 06:47:58AM -0600, Gustavo A. R. Silva wrote: >>>> >>>> >>>> On 01/08/24 05:35, kernel test robot wrote: >>>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/wfamnae-next20240729-cbc-2 >>>>> head: df15c862c1b93b6e1f6c90b0d7971f7a6ad66751 >>>>> commit: e7cd9f429a852fb7e37a706c7d08fc36e7863e06 [11/18] RDMA/uverbs: Use static_assert() to check struct sizes >>>>> config: hexagon-randconfig-001-20240801 (https://download.01.org/0day-ci/archive/20240801/202408011956.wscyBwq6-lkp@intel.com/config) >>>>> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 430b90f04533b099d788db2668176038be38c53b) >>>> >>>> >>>> Clang 20.0.0?? (thinkingface) >>> >>> Indeed, Clang 19 branched and main is now 20 :) >>> >>> https://github.com/llvm/llvm-project/commit/8f701b5df0adb3a2960d78ca2ad9cf53f39ba2fe >> >> Yeah, but is that a stable release? > > No, but the Intel folks have tested tip of tree LLVM against the kernel > for us for a few years now to try and catch issues such as this. Oh, I see, fine. :) > >> BTW, I don't see GCC reporting the same problem below: > > Hexagon does not have a GCC backend anymore so it is not going to be > possible to do an exact A/B comparison with this configuration but... > >>>>>>> include/rdma/uverbs_ioctl.h:643:15: error: static assertion failed due to requirement '__builtin_offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr)': struct member likely outside of struct_group_tagged() >>>>> 643 | static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr), >>>>> | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> 644 | "struct member likely outside of struct_group_tagged()"); >>>>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> include/linux/stddef.h:16:32: note: expanded from macro 'offsetof' >>>>> 16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER) >>>>> | ^ >>>>> include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert' >>>>> 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) >>>>> | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert' >>>>> 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) >>>>> | ^~~~ >>>>> include/rdma/uverbs_ioctl.h:643:58: note: expression evaluates to '56 == 52' > > This seems to give some indication that perhaps there may be some > architecture specific here with padding maybe? I seem to recall ARM OABI > having something similar. Adding the Hexagon folks/list to get some more > clarification. Full warning and context: > > https://lore.kernel.org/202408011956.wscyBwq6-lkp@intel.com/ > > The problematic section preprocessed since sometimes the macros > obfuscate things: > > struct uverbs_attr_bundle { > union { > struct { > struct ib_udata driver_udata; > struct ib_udata ucore; > struct ib_uverbs_file *ufile; > struct ib_ucontext *context; > struct ib_uobject *uobject; > unsigned long attr_present[(((UVERBS_API_ATTR_BKEY_LEN) + > ((sizeof(long) * 8)) - 1) / > ((sizeof(long) * 8)))]; > }; > struct uverbs_attr_bundle_hdr { > struct ib_udata driver_udata; > struct ib_udata ucore; > struct ib_uverbs_file *ufile; > struct ib_ucontext *context; > struct ib_uobject *uobject; > unsigned long attr_present[(((UVERBS_API_ATTR_BKEY_LEN) + > ((sizeof(long) * 8)) - 1) / > ((sizeof(long) * 8)))]; > } hdr; > }; > > struct uverbs_attr attrs[]; > }; > _Static_assert(__builtin_offsetof(struct uverbs_attr_bundle, attrs) == > sizeof(struct uverbs_attr_bundle_hdr), > "struct member likely outside of struct_group_tagged()"); > > FWIW, I see this with all versions of Clang that the kernel supports > with this configuration. I don't have access to a Clang compiler right now; I wonder if you could help me get the output of this command: pahole -C uverbs_attr_bundle drivers/infiniband/core/rdma_core.o Thanks in advance! -Gustavo > > Cheers, > Nathan > >>>>> 643 | static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr), >>>>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> 644 | "struct member likely outside of struct_group_tagged()"); >>>>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert' >>>>> 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) >>>>> | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>>> include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert' >>>>> 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) >>>>> | ^~~~ >>>>> 7 warnings and 1 error generated. >>>>> >>>>> >>>>> vim +643 include/rdma/uverbs_ioctl.h >>>>> >>>>> 630 >>>>> 631 struct uverbs_attr_bundle { >>>>> 632 /* New members MUST be added within the struct_group() macro below. */ >>>>> 633 struct_group_tagged(uverbs_attr_bundle_hdr, hdr, >>>>> 634 struct ib_udata driver_udata; >>>>> 635 struct ib_udata ucore; >>>>> 636 struct ib_uverbs_file *ufile; >>>>> 637 struct ib_ucontext *context; >>>>> 638 struct ib_uobject *uobject; >>>>> 639 DECLARE_BITMAP(attr_present, UVERBS_API_ATTR_BKEY_LEN); >>>>> 640 ); >>>>> 641 struct uverbs_attr attrs[]; >>>>> 642 }; >>>>> > 643 static_assert(offsetof(struct uverbs_attr_bundle, attrs) == sizeof(struct uverbs_attr_bundle_hdr), >>>>> 644 "struct member likely outside of struct_group_tagged()"); >>>>> 645 >>>>> >>>> >> >> Thanks >> -- >> Gustavo