All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Silence gcc warnings about arch ABI drift
@ 2019-06-06 10:33 Dave Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Martin @ 2019-06-06 10:33 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Catalin Marinas, Will Deacon

Since GCC 9, the compiler warns about evolution of the
platform-specific ABI, in particular relating for the marshaling of
certain structures involving bitfields.

The kernel is a standalone binary, and of course nobody would be
so stupid as to expose structs containing bitfields as function
arguments in ABI.  (Passing a pointer to such a struct, however
inadvisable, should be unaffected by this change.  perf and various
drivers rely on that.)

So these warnings do more harm than good: turn them off.

We may miss warnings about future ABI drift, but that's too bad.
Future ABI breaks of this class will have to be debugged and fixed
the traditional way unless the compiler evolves finer-grained
diagnostics.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---

Changes since v1:

 * Linus didn't like being credited with this patch, I reset the
   author to be me.  (i.e., I didn't screw up with git commit this
   time...)

 arch/arm64/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b025304..8fbd583 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -51,6 +51,7 @@ endif
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)
 KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
+KBUILD_CFLAGS	+= -Wno-psabi
 KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst)
 
 KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
-- 
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Silence gcc warnings about arch ABI drift
  2019-06-04  9:44 ` Christoph Hellwig
@ 2019-06-04  9:52   ` Dave Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Martin @ 2019-06-04  9:52 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Catalin Marinas, Linus Torvalds, Will Deacon, linux-arm-kernel

On Tue, Jun 04, 2019 at 02:44:52AM -0700, Christoph Hellwig wrote:
> I'd be curious where we expose structs containing bitfields as
> pass by value arguments in the kernel.  That generally doesn't seem
> like a great idea.

This was firing on struct printf_spec for example, which is local to
lib/vsnprintf.c.

I haven't dug into the background of why that struct is encoded this way,
or whether pass-by-value semantics are really important for it.  Maybe
it could be changed.

Bitfields in ABI would be the worse problem, but this particular
warning is only related to pass-by-value cases.  I haven't exhaustively
gone through everything, but I've not seen a case of bitfields passed
by value in the ABI.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Silence gcc warnings about arch ABI drift
  2019-06-03 15:30 Dave Martin
  2019-06-03 17:33 ` Linus Torvalds
@ 2019-06-04  9:44 ` Christoph Hellwig
  2019-06-04  9:52   ` Dave Martin
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2019-06-04  9:44 UTC (permalink / raw)
  To: Dave Martin
  Cc: Will Deacon, Catalin Marinas, Linus Torvalds, linux-arm-kernel

I'd be curious where we expose structs containing bitfields as
pass by value arguments in the kernel.  That generally doesn't seem
like a great idea.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Silence gcc warnings about arch ABI drift
  2019-06-03 17:33 ` Linus Torvalds
@ 2019-06-04  8:50   ` Dave Martin
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Martin @ 2019-06-04  8:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Catalin Marinas, Will Deacon, Linux ARM

On Mon, Jun 03, 2019 at 10:33:58AM -0700, Linus Torvalds wrote:
> On Mon, Jun 3, 2019 at 8:30 AM Dave Martin <Dave.Martin@arm.com> wrote:
> >
> > From: Linus Torvalds <torvalds@linux-foundation.org>
> 
> That's the wrong author. I have no idea about the -Wno-psabi flag.

Errr.  I have no idea what happened there.

My best guess is a typo'd git commit command, but it still leaves me
scratching my head.

Mind if I steal the patch from you and pretend it's mine?

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: Silence gcc warnings about arch ABI drift
  2019-06-03 15:30 Dave Martin
@ 2019-06-03 17:33 ` Linus Torvalds
  2019-06-04  8:50   ` Dave Martin
  2019-06-04  9:44 ` Christoph Hellwig
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2019-06-03 17:33 UTC (permalink / raw)
  To: Dave Martin; +Cc: Catalin Marinas, Will Deacon, Linux ARM

On Mon, Jun 3, 2019 at 8:30 AM Dave Martin <Dave.Martin@arm.com> wrote:
>
> From: Linus Torvalds <torvalds@linux-foundation.org>

That's the wrong author. I have no idea about the -Wno-psabi flag.

                 Linus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] arm64: Silence gcc warnings about arch ABI drift
@ 2019-06-03 15:30 Dave Martin
  2019-06-03 17:33 ` Linus Torvalds
  2019-06-04  9:44 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Dave Martin @ 2019-06-03 15:30 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Catalin Marinas, Linus Torvalds, Will Deacon

From: Linus Torvalds <torvalds@linux-foundation.org>

Since GCC 9, the compiler warns about evolution of the
platform-specific ABI, in particular relating for the marshaling of
certain structures involving bitfields.

The kernel is a standalone binary, and of course nobody would be
so stupid as to expose structs containing bitfields as function
arguments in ABI.  (Passing a pointer to such a struct, however
inadvisable, should be unaffected by this change.  perf and various
drivers rely on that.)

So these warnings do more harm than good: turn them off.

We may miss warnings about future ABI drift, but that's too bad.
Future ABI breaks of this class will have to be debugged and fixed
the traditional way unless the compiler evolves finer-grained
diagnostics.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
 arch/arm64/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b025304..8fbd583 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -51,6 +51,7 @@ endif
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)
 KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
+KBUILD_CFLAGS	+= -Wno-psabi
 KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst)
 
 KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
-- 
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-06 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 10:33 [PATCH] arm64: Silence gcc warnings about arch ABI drift Dave Martin
  -- strict thread matches above, loose matches on Subject: below --
2019-06-03 15:30 Dave Martin
2019-06-03 17:33 ` Linus Torvalds
2019-06-04  8:50   ` Dave Martin
2019-06-04  9:44 ` Christoph Hellwig
2019-06-04  9:52   ` Dave Martin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.