* [BUG] allmodconfig build error in next-20240108 @ 2024-01-08 21:33 Paul E. McKenney 2024-01-08 22:57 ` Stephen Rothwell 0 siblings, 1 reply; 15+ messages in thread From: Paul E. McKenney @ 2024-01-08 21:33 UTC (permalink / raw) To: lucas.dimarchi, ogabbay, thomas.hellstrom; +Cc: linux-kernel, sfr, intel-xe Hello! Recent -next trees get the following build error for allmodconfig builds: ------------------------------------------------------------------------ drivers/gpu/drm/xe/xe_gt_pagefault.c: In function ‘xe_guc_pagefault_handler’: ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 57 | #define __underlying_memcpy __builtin_memcpy | ^ ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ 644 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); | ^~~~~~ In file included from drivers/gpu/drm/xe/xe_device_types.h:17, from drivers/gpu/drm/xe/xe_vm_types.h:16, from drivers/gpu/drm/xe/xe_bo.h:13, from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 102 | struct xe_tile *tile; | ------------------------------------------------------------------------ Thanx, Paul ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-08 21:33 [BUG] allmodconfig build error in next-20240108 Paul E. McKenney @ 2024-01-08 22:57 ` Stephen Rothwell 2024-01-08 23:15 ` Paul E. McKenney 0 siblings, 1 reply; 15+ messages in thread From: Stephen Rothwell @ 2024-01-08 22:57 UTC (permalink / raw) To: Paul E. McKenney Cc: lucas.dimarchi, ogabbay, thomas.hellstrom, linux-kernel, intel-xe [-- Attachment #1: Type: text/plain, Size: 1987 bytes --] Hi Paul, On Mon, 8 Jan 2024 13:33:36 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > Recent -next trees get the following build error for allmodconfig builds: > > ------------------------------------------------------------------------ > > drivers/gpu/drm/xe/xe_gt_pagefault.c: In function ‘xe_guc_pagefault_handler’: > ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] > 57 | #define __underlying_memcpy __builtin_memcpy > | ^ > ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ > 644 | __underlying_##op(p, q, __fortify_size); \ > | ^~~~~~~~~~~~~ > ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ > | ^~~~~~~~~~~~~~~~~~~~ > drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); > | ^~~~~~ > In file included from drivers/gpu/drm/xe/xe_device_types.h:17, > from drivers/gpu/drm/xe/xe_vm_types.h:16, > from drivers/gpu/drm/xe/xe_bo.h:13, > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: > drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 > 102 | struct xe_tile *tile; > | Which architecture? What compiler and version? Anything special in your build setup? I do x86_64 allmodconfig builds all day with gcc v13.2 and I don't see this failure. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-08 22:57 ` Stephen Rothwell @ 2024-01-08 23:15 ` Paul E. McKenney 2024-01-09 16:58 ` Lucas De Marchi 0 siblings, 1 reply; 15+ messages in thread From: Paul E. McKenney @ 2024-01-08 23:15 UTC (permalink / raw) To: Stephen Rothwell Cc: lucas.dimarchi, ogabbay, thomas.hellstrom, linux-kernel, intel-xe On Tue, Jan 09, 2024 at 09:57:57AM +1100, Stephen Rothwell wrote: > Hi Paul, > > On Mon, 8 Jan 2024 13:33:36 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > > > Recent -next trees get the following build error for allmodconfig builds: > > > > ------------------------------------------------------------------------ > > > > drivers/gpu/drm/xe/xe_gt_pagefault.c: In function ‘xe_guc_pagefault_handler’: > > ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] > > 57 | #define __underlying_memcpy __builtin_memcpy > > | ^ > > ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ > > 644 | __underlying_##op(p, q, __fortify_size); \ > > | ^~~~~~~~~~~~~ > > ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ > > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ > > | ^~~~~~~~~~~~~~~~~~~~ > > drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ > > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); > > | ^~~~~~ > > In file included from drivers/gpu/drm/xe/xe_device_types.h:17, > > from drivers/gpu/drm/xe/xe_vm_types.h:16, > > from drivers/gpu/drm/xe/xe_bo.h:13, > > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: > > drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 > > 102 | struct xe_tile *tile; > > | > > Which architecture? What compiler and version? Anything special in your build > setup? I do x86_64 allmodconfig builds all day with gcc v13.2 and I don't see > this failure. Good point! I am using gcc version 11.3.1 20230605 (Red Hat 11.4.1-2) on x86_64. I see the same behavior on gcc version 8.5.0, which for all I know might be too old. Thanx, Paul ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-08 23:15 ` Paul E. McKenney @ 2024-01-09 16:58 ` Lucas De Marchi 2024-01-09 21:11 ` Stephen Rothwell 0 siblings, 1 reply; 15+ messages in thread From: Lucas De Marchi @ 2024-01-09 16:58 UTC (permalink / raw) To: Paul E. McKenney; +Cc: Stephen Rothwell, lucas.dimarchi, linux-kernel, intel-xe On Mon, Jan 08, 2024 at 03:15:23PM -0800, Paul E. McKenney wrote: >On Tue, Jan 09, 2024 at 09:57:57AM +1100, Stephen Rothwell wrote: >> Hi Paul, >> >> On Mon, 8 Jan 2024 13:33:36 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: >> > >> > Recent -next trees get the following build error for allmodconfig builds: >> > >> > ------------------------------------------------------------------------ >> > >> > drivers/gpu/drm/xe/xe_gt_pagefault.c: In function ‘xe_guc_pagefault_handler’: >> > ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] >> > 57 | #define __underlying_memcpy __builtin_memcpy >> > | ^ >> > ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ >> > 644 | __underlying_##op(p, q, __fortify_size); \ >> > | ^~~~~~~~~~~~~ >> > ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ >> > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ >> > | ^~~~~~~~~~~~~~~~~~~~ >> > drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ >> > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); >> > | ^~~~~~ >> > In file included from drivers/gpu/drm/xe/xe_device_types.h:17, >> > from drivers/gpu/drm/xe/xe_vm_types.h:16, >> > from drivers/gpu/drm/xe/xe_bo.h:13, >> > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: >> > drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 >> > 102 | struct xe_tile *tile; >> > | >> >> Which architecture? What compiler and version? Anything special in your build >> setup? I do x86_64 allmodconfig builds all day with gcc v13.2 and I don't see >> this failure. > >Good point! > >I am using gcc version 11.3.1 20230605 (Red Hat 11.4.1-2) on x86_64. >I see the same behavior on gcc version 8.5.0, which for all I know might >be too old. I could reproduce it with allmodconfig and gcc 11.4.1 from rockylinux, but not with gcc 9.3 or 12.3. Also it's not reproduced with gcc 11.4.1 when using defconfig + CONFIG_DRM_XE (even if -Wstringop-overflow is still added). I don't see a bug in the code, even if it inverts the head/tail convention. Searching around showed this which may be relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 At least I can reproduce the same issue as in the snippet provided (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854#c7) with the buggy compiler. So, maybe the best thing to do for now is to disable -Wstringop-overflow for gcc < 12? ------8<----- diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile index 6952da8979ea..0433a3c6cbfd 100644 --- a/drivers/gpu/drm/xe/Makefile +++ b/drivers/gpu/drm/xe/Makefile @@ -17,7 +17,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) subdir-ccflags-y += $(call cc-option, -Wformat-overflow) subdir-ccflags-y += $(call cc-option, -Wformat-truncation) -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) +subdir-ccflags-$(call gcc-min-version, 120000) += $(call cc-option, -Wstringop-overflow) subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) # The following turn off the warnings enabled by -Wextra ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) ------8<----- and if we are tweaking the warnings, then do similarly in scripts/Makefile.extrawarn so it doesn't show up again with W=1 builds. Thoughts? Lucas De Marchi > > Thanx, Paul ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-09 16:58 ` Lucas De Marchi @ 2024-01-09 21:11 ` Stephen Rothwell 2024-01-09 22:45 ` Paul E. McKenney 0 siblings, 1 reply; 15+ messages in thread From: Stephen Rothwell @ 2024-01-09 21:11 UTC (permalink / raw) To: Lucas De Marchi Cc: Paul E. McKenney, Stephen Rothwell, lucas.dimarchi, linux-kernel, intel-xe [-- Attachment #1: Type: text/plain, Size: 5080 bytes --] Hi Lucas, On Tue, 9 Jan 2024 10:58:40 -0600 Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > On Mon, Jan 08, 2024 at 03:15:23PM -0800, Paul E. McKenney wrote: > >On Tue, Jan 09, 2024 at 09:57:57AM +1100, Stephen Rothwell wrote: > >> Hi Paul, > >> > >> On Mon, 8 Jan 2024 13:33:36 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > >> > > >> > Recent -next trees get the following build error for allmodconfig builds: > >> > > >> > ------------------------------------------------------------------------ > >> > > >> > drivers/gpu/drm/xe/xe_gt_pagefault.c: In function ‘xe_guc_pagefault_handler’: > >> > ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] > >> > 57 | #define __underlying_memcpy __builtin_memcpy > >> > | ^ > >> > ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ > >> > 644 | __underlying_##op(p, q, __fortify_size); \ > >> > | ^~~~~~~~~~~~~ > >> > ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ > >> > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ > >> > | ^~~~~~~~~~~~~~~~~~~~ > >> > drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ > >> > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); > >> > | ^~~~~~ > >> > In file included from drivers/gpu/drm/xe/xe_device_types.h:17, > >> > from drivers/gpu/drm/xe/xe_vm_types.h:16, > >> > from drivers/gpu/drm/xe/xe_bo.h:13, > >> > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: > >> > drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 > >> > 102 | struct xe_tile *tile; > >> > | > >> > >> Which architecture? What compiler and version? Anything special in your build > >> setup? I do x86_64 allmodconfig builds all day with gcc v13.2 and I don't see > >> this failure. > > > >Good point! > > > >I am using gcc version 11.3.1 20230605 (Red Hat 11.4.1-2) on x86_64. > >I see the same behavior on gcc version 8.5.0, which for all I know might > >be too old. > > I could reproduce it with allmodconfig and gcc 11.4.1 from rockylinux, > but not with gcc 9.3 or 12.3. Also it's not reproduced with gcc 11.4.1 > when using defconfig + CONFIG_DRM_XE (even if -Wstringop-overflow is > still added). > > I don't see a bug in the code, even if it inverts the head/tail > convention. > > Searching around showed this which may be relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 > At least I can reproduce the same issue as in the snippet provided > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854#c7) with the buggy > compiler. > > So, maybe the best thing to do for now is to disable -Wstringop-overflow > for gcc < 12? > > > ------8<----- > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile > index 6952da8979ea..0433a3c6cbfd 100644 > --- a/drivers/gpu/drm/xe/Makefile > +++ b/drivers/gpu/drm/xe/Makefile > @@ -17,7 +17,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) > +subdir-ccflags-$(call gcc-min-version, 120000) += $(call cc-option, -Wstringop-overflow) > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > # The following turn off the warnings enabled by -Wextra > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) > ------8<----- > > and if we are tweaking the warnings, then do similarly in scripts/Makefile.extrawarn > so it doesn't show up again with W=1 builds. Thoughts? The top level Makefile (in linux-next) has: #Currently, disable -Wstringop-overflow for GCC 11, globally. KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow) KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow) and init/Kconfig has: # Currently, disable -Wstringop-overflow for GCC 11, globally. config GCC11_NO_STRINGOP_OVERFLOW def_bool y config CC_NO_STRINGOP_OVERFLOW bool default y if CC_IS_GCC && GCC_VERSION >= 110000 && GCC_VERSION < 120000 && GCC11_NO_STRINGOP_OVERFLOW config CC_STRINGOP_OVERFLOW bool default y if CC_IS_GCC && !CC_NO_STRINGOP_OVERFLOW So, what does "grep -E '(STRINGOP_OVERFLOW|GCC_VERSION)' .config" show for your breaking build(s)? -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-09 21:11 ` Stephen Rothwell @ 2024-01-09 22:45 ` Paul E. McKenney 2024-01-09 22:58 ` Stephen Rothwell 0 siblings, 1 reply; 15+ messages in thread From: Paul E. McKenney @ 2024-01-09 22:45 UTC (permalink / raw) To: Stephen Rothwell Cc: Lucas De Marchi, Stephen Rothwell, lucas.dimarchi, linux-kernel, intel-xe On Wed, Jan 10, 2024 at 08:11:55AM +1100, Stephen Rothwell wrote: > Hi Lucas, > > On Tue, 9 Jan 2024 10:58:40 -0600 Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > > > On Mon, Jan 08, 2024 at 03:15:23PM -0800, Paul E. McKenney wrote: > > >On Tue, Jan 09, 2024 at 09:57:57AM +1100, Stephen Rothwell wrote: > > >> Hi Paul, > > >> > > >> On Mon, 8 Jan 2024 13:33:36 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > >> > > > >> > Recent -next trees get the following build error for allmodconfig builds: > > >> > > > >> > ------------------------------------------------------------------------ > > >> > > > >> > drivers/gpu/drm/xe/xe_gt_pagefault.c: In function ‘xe_guc_pagefault_handler’: > > >> > ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] > > >> > 57 | #define __underlying_memcpy __builtin_memcpy > > >> > | ^ > > >> > ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ > > >> > 644 | __underlying_##op(p, q, __fortify_size); \ > > >> > | ^~~~~~~~~~~~~ > > >> > ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ > > >> > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ > > >> > | ^~~~~~~~~~~~~~~~~~~~ > > >> > drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ > > >> > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); > > >> > | ^~~~~~ > > >> > In file included from drivers/gpu/drm/xe/xe_device_types.h:17, > > >> > from drivers/gpu/drm/xe/xe_vm_types.h:16, > > >> > from drivers/gpu/drm/xe/xe_bo.h:13, > > >> > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: > > >> > drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 > > >> > 102 | struct xe_tile *tile; > > >> > | > > >> > > >> Which architecture? What compiler and version? Anything special in your build > > >> setup? I do x86_64 allmodconfig builds all day with gcc v13.2 and I don't see > > >> this failure. > > > > > >Good point! > > > > > >I am using gcc version 11.3.1 20230605 (Red Hat 11.4.1-2) on x86_64. > > >I see the same behavior on gcc version 8.5.0, which for all I know might > > >be too old. > > > > I could reproduce it with allmodconfig and gcc 11.4.1 from rockylinux, > > but not with gcc 9.3 or 12.3. Also it's not reproduced with gcc 11.4.1 > > when using defconfig + CONFIG_DRM_XE (even if -Wstringop-overflow is > > still added). > > > > I don't see a bug in the code, even if it inverts the head/tail > > convention. > > > > Searching around showed this which may be relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 > > At least I can reproduce the same issue as in the snippet provided > > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854#c7) with the buggy > > compiler. > > > > So, maybe the best thing to do for now is to disable -Wstringop-overflow > > for gcc < 12? > > > > > > ------8<----- > > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile > > index 6952da8979ea..0433a3c6cbfd 100644 > > --- a/drivers/gpu/drm/xe/Makefile > > +++ b/drivers/gpu/drm/xe/Makefile > > @@ -17,7 +17,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > > -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) > > +subdir-ccflags-$(call gcc-min-version, 120000) += $(call cc-option, -Wstringop-overflow) > > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > > # The following turn off the warnings enabled by -Wextra > > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) > > ------8<----- This I did, thank you! > > and if we are tweaking the warnings, then do similarly in scripts/Makefile.extrawarn > > so it doesn't show up again with W=1 builds. Thoughts? But I failed to find anything similar in scripts/Makefile.extrawarn, so the failure persists. > The top level Makefile (in linux-next) has: > > #Currently, disable -Wstringop-overflow for GCC 11, globally. > KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow) > KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow) > > and init/Kconfig has: > > # Currently, disable -Wstringop-overflow for GCC 11, globally. > config GCC11_NO_STRINGOP_OVERFLOW > def_bool y > > config CC_NO_STRINGOP_OVERFLOW > bool > default y if CC_IS_GCC && GCC_VERSION >= 110000 && GCC_VERSION < 120000 && GCC11_NO_STRINGOP_OVERFLOW > > config CC_STRINGOP_OVERFLOW > bool > default y if CC_IS_GCC && !CC_NO_STRINGOP_OVERFLOW > > So, what does "grep -E '(STRINGOP_OVERFLOW|GCC_VERSION)' .config" show for your > breaking build(s)? Here you go! CONFIG_GCC_VERSION=110400 CONFIG_GCC11_NO_STRINGOP_OVERFLOW=y CONFIG_CC_NO_STRINGOP_OVERFLOW=y Thanx, Paul ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-09 22:45 ` Paul E. McKenney @ 2024-01-09 22:58 ` Stephen Rothwell 2024-01-10 1:09 ` Lucas De Marchi 2024-01-10 3:46 ` Paul E. McKenney 0 siblings, 2 replies; 15+ messages in thread From: Stephen Rothwell @ 2024-01-09 22:58 UTC (permalink / raw) To: Paul E. McKenney; +Cc: Lucas De Marchi, linux-kernel, intel-xe [-- Attachment #1: Type: text/plain, Size: 2299 bytes --] Hi all, On Tue, 9 Jan 2024 14:45:56 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > On Wed, Jan 10, 2024 at 08:11:55AM +1100, Stephen Rothwell wrote: > > > > On Tue, 9 Jan 2024 10:58:40 -0600 Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > > > > > On Mon, Jan 08, 2024 at 03:15:23PM -0800, Paul E. McKenney wrote: > > > I could reproduce it with allmodconfig and gcc 11.4.1 from rockylinux, > > > but not with gcc 9.3 or 12.3. Also it's not reproduced with gcc 11.4.1 > > > when using defconfig + CONFIG_DRM_XE (even if -Wstringop-overflow is > > > still added). > > > > > > I don't see a bug in the code, even if it inverts the head/tail > > > convention. > > > > > > Searching around showed this which may be relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 > > > At least I can reproduce the same issue as in the snippet provided > > > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854#c7) with the buggy > > > compiler. > > > > > > So, maybe the best thing to do for now is to disable -Wstringop-overflow > > > for gcc < 12? > > > > > > > > > ------8<----- > > > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile > > > index 6952da8979ea..0433a3c6cbfd 100644 > > > --- a/drivers/gpu/drm/xe/Makefile > > > +++ b/drivers/gpu/drm/xe/Makefile > > > @@ -17,7 +17,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > > > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > > > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > > > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > > > -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) > > > +subdir-ccflags-$(call gcc-min-version, 120000) += $(call cc-option, -Wstringop-overflow) > > > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > > > # The following turn off the warnings enabled by -Wextra > > > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) > > > ------8<----- > > This I did, thank you! Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" should just be removed as the setting of that option has been moved to the normal C flags in the top level Makefile (out of Makefile.extrawarn). -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-09 22:58 ` Stephen Rothwell @ 2024-01-10 1:09 ` Lucas De Marchi 2024-01-10 3:46 ` Paul E. McKenney 1 sibling, 0 replies; 15+ messages in thread From: Lucas De Marchi @ 2024-01-10 1:09 UTC (permalink / raw) To: Stephen Rothwell Cc: Paul E. McKenney, linux-kernel, intel-xe, Jani Nikula, Nathan Chancellor, Masahiro Yamada On Wed, Jan 10, 2024 at 09:58:22AM +1100, Stephen Rothwell wrote: >Hi all, > >On Tue, 9 Jan 2024 14:45:56 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: >> >> On Wed, Jan 10, 2024 at 08:11:55AM +1100, Stephen Rothwell wrote: >> > >> > On Tue, 9 Jan 2024 10:58:40 -0600 Lucas De Marchi <lucas.demarchi@intel.com> wrote: >> > > >> > > On Mon, Jan 08, 2024 at 03:15:23PM -0800, Paul E. McKenney wrote: >> > > I could reproduce it with allmodconfig and gcc 11.4.1 from rockylinux, >> > > but not with gcc 9.3 or 12.3. Also it's not reproduced with gcc 11.4.1 >> > > when using defconfig + CONFIG_DRM_XE (even if -Wstringop-overflow is >> > > still added). >> > > >> > > I don't see a bug in the code, even if it inverts the head/tail >> > > convention. >> > > >> > > Searching around showed this which may be relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 >> > > At least I can reproduce the same issue as in the snippet provided >> > > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854#c7) with the buggy >> > > compiler. >> > > >> > > So, maybe the best thing to do for now is to disable -Wstringop-overflow >> > > for gcc < 12? >> > > >> > > >> > > ------8<----- >> > > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile >> > > index 6952da8979ea..0433a3c6cbfd 100644 >> > > --- a/drivers/gpu/drm/xe/Makefile >> > > +++ b/drivers/gpu/drm/xe/Makefile >> > > @@ -17,7 +17,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) >> > > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) >> > > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) >> > > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) >> > > -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) >> > > +subdir-ccflags-$(call gcc-min-version, 120000) += $(call cc-option, -Wstringop-overflow) >> > > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) >> > > # The following turn off the warnings enabled by -Wextra >> > > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) >> > > ------8<----- >> >> This I did, thank you! > >Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" >should just be removed as the setting of that option has been moved to the >normal C flags in the top level Makefile (out of Makefile.extrawarn). yeah, if it's part of the default build now and not only with W=1, then we need to sync again. Ideally opting in to extra warning flags should not be done via copy paste, which would avoid this problem. However there were some issues implementing that generically and some push back on making W=1 options automatically propagate to default flags in subsystems/drivers as per https://lore.kernel.org/all/20231006174550.GC3359308@dev-arch.thelio-3990X/ which also makes sense. Cc'ing a few more people involved in that thread if they want to add anything. Lucas De Marchi > >-- >Cheers, >Stephen Rothwell ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-09 22:58 ` Stephen Rothwell 2024-01-10 1:09 ` Lucas De Marchi @ 2024-01-10 3:46 ` Paul E. McKenney 2024-01-10 5:03 ` Stephen Rothwell 1 sibling, 1 reply; 15+ messages in thread From: Paul E. McKenney @ 2024-01-10 3:46 UTC (permalink / raw) To: Stephen Rothwell; +Cc: Lucas De Marchi, linux-kernel, intel-xe On Wed, Jan 10, 2024 at 09:58:22AM +1100, Stephen Rothwell wrote: > Hi all, > > On Tue, 9 Jan 2024 14:45:56 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > > > On Wed, Jan 10, 2024 at 08:11:55AM +1100, Stephen Rothwell wrote: > > > > > > On Tue, 9 Jan 2024 10:58:40 -0600 Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > > > > > > > On Mon, Jan 08, 2024 at 03:15:23PM -0800, Paul E. McKenney wrote: > > > > I could reproduce it with allmodconfig and gcc 11.4.1 from rockylinux, > > > > but not with gcc 9.3 or 12.3. Also it's not reproduced with gcc 11.4.1 > > > > when using defconfig + CONFIG_DRM_XE (even if -Wstringop-overflow is > > > > still added). > > > > > > > > I don't see a bug in the code, even if it inverts the head/tail > > > > convention. > > > > > > > > Searching around showed this which may be relevant: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854 > > > > At least I can reproduce the same issue as in the snippet provided > > > > (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854#c7) with the buggy > > > > compiler. > > > > > > > > So, maybe the best thing to do for now is to disable -Wstringop-overflow > > > > for gcc < 12? > > > > > > > > > > > > ------8<----- > > > > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile > > > > index 6952da8979ea..0433a3c6cbfd 100644 > > > > --- a/drivers/gpu/drm/xe/Makefile > > > > +++ b/drivers/gpu/drm/xe/Makefile > > > > @@ -17,7 +17,7 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > > > > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > > > > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > > > > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > > > > -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) > > > > +subdir-ccflags-$(call gcc-min-version, 120000) += $(call cc-option, -Wstringop-overflow) > > > > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > > > > # The following turn off the warnings enabled by -Wextra > > > > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) > > > > ------8<----- > > > > This I did, thank you! > > Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" > should just be removed as the setting of that option has been moved to the > normal C flags in the top level Makefile (out of Makefile.extrawarn). If you meant like this, no joy. :-( Thanx, Paul ------------------------------------------------------------------------ diff --git a/Makefile b/Makefile index 0705e7426ab7..446bd2da9fa3 100644 --- a/Makefile +++ b/Makefile @@ -988,7 +988,6 @@ KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3) #Currently, disable -Wstringop-overflow for GCC 11, globally. KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow) -KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow) # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += -fno-strict-overflow ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-10 3:46 ` Paul E. McKenney @ 2024-01-10 5:03 ` Stephen Rothwell 2024-01-10 10:26 ` Paul E. McKenney 0 siblings, 1 reply; 15+ messages in thread From: Stephen Rothwell @ 2024-01-10 5:03 UTC (permalink / raw) To: Paul E. McKenney; +Cc: Lucas De Marchi, linux-kernel, intel-xe [-- Attachment #1: Type: text/plain, Size: 547 bytes --] Hi Paul, On Tue, 9 Jan 2024 19:46:27 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > On Wed, Jan 10, 2024 at 09:58:22AM +1100, Stephen Rothwell wrote: > > > > Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" > > should just be removed as the setting of that option has been moved to the > > normal C flags in the top level Makefile (out of Makefile.extrawarn). > > If you meant like this, no joy. :-( Actually I meant the one in drivers/gpu/drm/xe/Makefile -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-10 5:03 ` Stephen Rothwell @ 2024-01-10 10:26 ` Paul E. McKenney 2024-01-10 15:00 ` Lucas De Marchi 0 siblings, 1 reply; 15+ messages in thread From: Paul E. McKenney @ 2024-01-10 10:26 UTC (permalink / raw) To: Stephen Rothwell; +Cc: Lucas De Marchi, linux-kernel, intel-xe On Wed, Jan 10, 2024 at 04:03:51PM +1100, Stephen Rothwell wrote: > Hi Paul, > > On Tue, 9 Jan 2024 19:46:27 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > > > On Wed, Jan 10, 2024 at 09:58:22AM +1100, Stephen Rothwell wrote: > > > > > > Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" > > > should just be removed as the setting of that option has been moved to the > > > normal C flags in the top level Makefile (out of Makefile.extrawarn). > > > > If you meant like this, no joy. :-( > > Actually I meant the one in drivers/gpu/drm/xe/Makefile Like this? That does work as shown below, thank you! Thanx, Paul ------------------------------------------------------------------------ drm/xe: Fix build bug for GCC 11 Building drivers/gpu/drm/xe/xe_gt_pagefault.c with GCC 11 results in the following build errors: ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 57 | #define __underlying_memcpy __builtin_memcpy | ^ ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ 644 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); | ^~~~~~ In file included from drivers/gpu/drm/xe/xe_device_types.h:17, from drivers/gpu/drm/xe/xe_vm_types.h:16, from drivers/gpu/drm/xe/xe_bo.h:13, from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 102 | struct xe_tile *tile; | ^~~~ Fix these by removing -Wstringop-overflow from drm/xe builds. Suggested-by: Stephen Rothwell <sfr@rothwell.id.au> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile index 53bd2a8ba1ae..efcf0ab7a1a6 100644 --- a/drivers/gpu/drm/xe/Makefile +++ b/drivers/gpu/drm/xe/Makefile @@ -17,7 +17,6 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) subdir-ccflags-y += $(call cc-option, -Wformat-overflow) subdir-ccflags-y += $(call cc-option, -Wformat-truncation) -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) # The following turn off the warnings enabled by -Wextra ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-10 10:26 ` Paul E. McKenney @ 2024-01-10 15:00 ` Lucas De Marchi 2024-01-10 15:18 ` Jani Nikula 2024-01-10 16:00 ` Paul E. McKenney 0 siblings, 2 replies; 15+ messages in thread From: Lucas De Marchi @ 2024-01-10 15:00 UTC (permalink / raw) To: Paul E. McKenney; +Cc: Stephen Rothwell, linux-kernel, intel-xe, Jani Nikula On Wed, Jan 10, 2024 at 02:26:54AM -0800, Paul E. McKenney wrote: >On Wed, Jan 10, 2024 at 04:03:51PM +1100, Stephen Rothwell wrote: >> Hi Paul, >> >> On Tue, 9 Jan 2024 19:46:27 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: >> > >> > On Wed, Jan 10, 2024 at 09:58:22AM +1100, Stephen Rothwell wrote: >> > > >> > > Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" >> > > should just be removed as the setting of that option has been moved to the >> > > normal C flags in the top level Makefile (out of Makefile.extrawarn). >> > >> > If you meant like this, no joy. :-( >> >> Actually I meant the one in drivers/gpu/drm/xe/Makefile > >Like this? That does work as shown below, thank you! > > Thanx, Paul > >------------------------------------------------------------------------ > >drm/xe: Fix build bug for GCC 11 > >Building drivers/gpu/drm/xe/xe_gt_pagefault.c with GCC 11 results >in the following build errors: > >./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] > 57 | #define __underlying_memcpy __builtin_memcpy > | ^ >./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ > 644 | __underlying_##op(p, q, __fortify_size); \ > | ^~~~~~~~~~~~~ >./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ > | ^~~~~~~~~~~~~~~~~~~~ >drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); > | ^~~~~~ >In file included from drivers/gpu/drm/xe/xe_device_types.h:17, > from drivers/gpu/drm/xe/xe_vm_types.h:16, > from drivers/gpu/drm/xe/xe_bo.h:13, > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: >drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 > 102 | struct xe_tile *tile; > | ^~~~ > >Fix these by removing -Wstringop-overflow from drm/xe builds. > >Suggested-by: Stephen Rothwell <sfr@rothwell.id.au> >Signed-off-by: Paul E. McKenney <paulmck@kernel.org> [ This particular warning is broken on GCC11. In future changes it will be moved to the normal C flags in the top level Makefile (out of Makefile.extrawarn), but accounting for the compiler support. Just remove it out of xe's forced extra warnings for now ] Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> would you mind if I extend it to drivers/gpu/drm/i915/Makefile in the same commit or would you prefer a separate one? Lucas De Marchi > >diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile >index 53bd2a8ba1ae..efcf0ab7a1a6 100644 >--- a/drivers/gpu/drm/xe/Makefile >+++ b/drivers/gpu/drm/xe/Makefile >@@ -17,7 +17,6 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) >-subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > # The following turn off the warnings enabled by -Wextra > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-10 15:00 ` Lucas De Marchi @ 2024-01-10 15:18 ` Jani Nikula 2024-01-10 15:21 ` Lucas De Marchi 2024-01-10 16:00 ` Paul E. McKenney 1 sibling, 1 reply; 15+ messages in thread From: Jani Nikula @ 2024-01-10 15:18 UTC (permalink / raw) To: Lucas De Marchi, Paul E. McKenney Cc: Stephen Rothwell, linux-kernel, intel-xe On Wed, 10 Jan 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote: > [ This particular warning is broken on GCC11. In future changes it will > be moved to the normal C flags in the top level Makefile (out of > Makefile.extrawarn), but accounting for the compiler support. Just > remove it out of xe's forced extra warnings for now ] > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > > would you mind if I extend it to drivers/gpu/drm/i915/Makefile > in the same commit or would you prefer a separate one? I think I'd prefer separate patches for i915 and xe. And just remove the line instead of subdir-ccflags-$(call gcc-min-version, 120000) as linux-next handles it properly in the top level Makefile. BR, Jani. -- Jani Nikula, Intel ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-10 15:18 ` Jani Nikula @ 2024-01-10 15:21 ` Lucas De Marchi 0 siblings, 0 replies; 15+ messages in thread From: Lucas De Marchi @ 2024-01-10 15:21 UTC (permalink / raw) To: Jani Nikula; +Cc: Paul E. McKenney, Stephen Rothwell, linux-kernel, intel-xe On Wed, Jan 10, 2024 at 05:18:11PM +0200, Jani Nikula wrote: >On Wed, 10 Jan 2024, Lucas De Marchi <lucas.demarchi@intel.com> wrote: >> [ This particular warning is broken on GCC11. In future changes it will >> be moved to the normal C flags in the top level Makefile (out of >> Makefile.extrawarn), but accounting for the compiler support. Just >> remove it out of xe's forced extra warnings for now ] >> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> >> >> would you mind if I extend it to drivers/gpu/drm/i915/Makefile >> in the same commit or would you prefer a separate one? > >I think I'd prefer separate patches for i915 and xe. And just remove the >line instead of subdir-ccflags-$(call gcc-min-version, 120000) as >linux-next handles it properly in the top level Makefile. yes, this is what this patch is doing, just removing the line. Lucas De Marchi. > >BR, >Jani. > > > >-- >Jani Nikula, Intel ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [BUG] allmodconfig build error in next-20240108 2024-01-10 15:00 ` Lucas De Marchi 2024-01-10 15:18 ` Jani Nikula @ 2024-01-10 16:00 ` Paul E. McKenney 1 sibling, 0 replies; 15+ messages in thread From: Paul E. McKenney @ 2024-01-10 16:00 UTC (permalink / raw) To: Lucas De Marchi; +Cc: Stephen Rothwell, linux-kernel, intel-xe, Jani Nikula On Wed, Jan 10, 2024 at 09:00:06AM -0600, Lucas De Marchi wrote: > On Wed, Jan 10, 2024 at 02:26:54AM -0800, Paul E. McKenney wrote: > > On Wed, Jan 10, 2024 at 04:03:51PM +1100, Stephen Rothwell wrote: > > > Hi Paul, > > > > > > On Tue, 9 Jan 2024 19:46:27 -0800 "Paul E. McKenney" <paulmck@kernel.org> wrote: > > > > > > > > On Wed, Jan 10, 2024 at 09:58:22AM +1100, Stephen Rothwell wrote: > > > > > > > > > > Maybe that line "subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)" > > > > > should just be removed as the setting of that option has been moved to the > > > > > normal C flags in the top level Makefile (out of Makefile.extrawarn). > > > > > > > > If you meant like this, no joy. :-( > > > > > > Actually I meant the one in drivers/gpu/drm/xe/Makefile > > > > Like this? That does work as shown below, thank you! > > > > Thanx, Paul > > > > ------------------------------------------------------------------------ > > > > drm/xe: Fix build bug for GCC 11 > > > > Building drivers/gpu/drm/xe/xe_gt_pagefault.c with GCC 11 results > > in the following build errors: > > > > ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] > > 57 | #define __underlying_memcpy __builtin_memcpy > > | ^ > > ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ > > 644 | __underlying_##op(p, q, __fortify_size); \ > > | ^~~~~~~~~~~~~ > > ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ > > 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ > > | ^~~~~~~~~~~~~~~~~~~~ > > drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ > > 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); > > | ^~~~~~ > > In file included from drivers/gpu/drm/xe/xe_device_types.h:17, > > from drivers/gpu/drm/xe/xe_vm_types.h:16, > > from drivers/gpu/drm/xe/xe_bo.h:13, > > from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: > > drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 > > 102 | struct xe_tile *tile; > > | ^~~~ > > > > Fix these by removing -Wstringop-overflow from drm/xe builds. > > > > Suggested-by: Stephen Rothwell <sfr@rothwell.id.au> > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org> > > [ This particular warning is broken on GCC11. In future changes it will > be moved to the normal C flags in the top level Makefile (out of > Makefile.extrawarn), but accounting for the compiler support. Just > remove it out of xe's forced extra warnings for now ] > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > > would you mind if I extend it to drivers/gpu/drm/i915/Makefile > in the same commit or would you prefer a separate one? Whatever works best for you works for me! Thanx, Paul > Lucas De Marchi > > > > > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile > > index 53bd2a8ba1ae..efcf0ab7a1a6 100644 > > --- a/drivers/gpu/drm/xe/Makefile > > +++ b/drivers/gpu/drm/xe/Makefile > > @@ -17,7 +17,6 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) > > subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) > > subdir-ccflags-y += $(call cc-option, -Wformat-overflow) > > subdir-ccflags-y += $(call cc-option, -Wformat-truncation) > > -subdir-ccflags-y += $(call cc-option, -Wstringop-overflow) > > subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) > > # The following turn off the warnings enabled by -Wextra > > ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),) ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-01-10 16:00 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-01-08 21:33 [BUG] allmodconfig build error in next-20240108 Paul E. McKenney 2024-01-08 22:57 ` Stephen Rothwell 2024-01-08 23:15 ` Paul E. McKenney 2024-01-09 16:58 ` Lucas De Marchi 2024-01-09 21:11 ` Stephen Rothwell 2024-01-09 22:45 ` Paul E. McKenney 2024-01-09 22:58 ` Stephen Rothwell 2024-01-10 1:09 ` Lucas De Marchi 2024-01-10 3:46 ` Paul E. McKenney 2024-01-10 5:03 ` Stephen Rothwell 2024-01-10 10:26 ` Paul E. McKenney 2024-01-10 15:00 ` Lucas De Marchi 2024-01-10 15:18 ` Jani Nikula 2024-01-10 15:21 ` Lucas De Marchi 2024-01-10 16:00 ` Paul E. McKenney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox