linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/unwind/orc: Fix ORC unwind table alignment
@ 2019-03-06 17:07 Josh Poimboeuf
  2019-03-06 18:44 ` Nick Desaulniers
  2019-03-06 19:40 ` [tip:x86/urgent] " tip-bot for Josh Poimboeuf
  0 siblings, 2 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2019-03-06 17:07 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, Peter Zijlstra, Nick Desaulniers, Dmitry Golovin,
	Sedat Dilek

The .orc_unwind section is a packed array of 6-byte structs.  It's
currently aligned to 6 bytes, which is causing warnings in the LLD
linker.

Six isn't a power of two, so it's not a valid alignment value.  The
actual alignment doesn't matter much because it's an array of packed
structs.  An alignment of two is sufficient.  In reality it always gets
aligned to four bytes because it comes immediately after the
4-byte-aligned .orc_unwind_ip section.

Link: https://github.com/ClangBuiltLinux/linux/issues/218
Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder")
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: Dmitry Golovin <dima@golovin.in>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 include/asm-generic/vmlinux.lds.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d7a6a9c2370..f8f6f04c4453 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -733,7 +733,7 @@
 		KEEP(*(.orc_unwind_ip))					\
 		__stop_orc_unwind_ip = .;				\
 	}								\
-	. = ALIGN(6);							\
+	. = ALIGN(2);							\
 	.orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) {		\
 		__start_orc_unwind = .;					\
 		KEEP(*(.orc_unwind))					\
-- 
2.17.2


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

* Re: [PATCH] x86/unwind/orc: Fix ORC unwind table alignment
  2019-03-06 17:07 [PATCH] x86/unwind/orc: Fix ORC unwind table alignment Josh Poimboeuf
@ 2019-03-06 18:44 ` Nick Desaulniers
  2019-03-06 19:04   ` Josh Poimboeuf
  2019-03-06 19:40 ` [tip:x86/urgent] " tip-bot for Josh Poimboeuf
  1 sibling, 1 reply; 4+ messages in thread
From: Nick Desaulniers @ 2019-03-06 18:44 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: x86, LKML, Peter Zijlstra, Dmitry Golovin, Sedat Dilek

On Wed, Mar 6, 2019 at 9:08 AM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> The .orc_unwind section is a packed array of 6-byte structs.  It's
> currently aligned to 6 bytes, which is causing warnings in the LLD
> linker.
>
> Six isn't a power of two, so it's not a valid alignment value.  The
> actual alignment doesn't matter much because it's an array of packed
> structs.  An alignment of two is sufficient.  In reality it always gets
> aligned to four bytes because it comes immediately after the
> 4-byte-aligned .orc_unwind_ip section.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/218
> Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder")

Thanks for the patch Josh, we appreciate it.  It looks like
ee9f8fce9964 landed in v4.14-rc1.  Should we CC stable?

> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Reported-by: Dmitry Golovin <dima@golovin.in>
> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  include/asm-generic/vmlinux.lds.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
> index 3d7a6a9c2370..f8f6f04c4453 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -733,7 +733,7 @@
>                 KEEP(*(.orc_unwind_ip))                                 \
>                 __stop_orc_unwind_ip = .;                               \
>         }                                                               \
> -       . = ALIGN(6);                                                   \
> +       . = ALIGN(2);                                                   \
>         .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) {             \
>                 __start_orc_unwind = .;                                 \
>                 KEEP(*(.orc_unwind))                                    \
> --
> 2.17.2
>


-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] x86/unwind/orc: Fix ORC unwind table alignment
  2019-03-06 18:44 ` Nick Desaulniers
@ 2019-03-06 19:04   ` Josh Poimboeuf
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Poimboeuf @ 2019-03-06 19:04 UTC (permalink / raw)
  To: Nick Desaulniers; +Cc: x86, LKML, Peter Zijlstra, Dmitry Golovin, Sedat Dilek

On Wed, Mar 06, 2019 at 10:44:01AM -0800, Nick Desaulniers wrote:
> On Wed, Mar 6, 2019 at 9:08 AM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >
> > The .orc_unwind section is a packed array of 6-byte structs.  It's
> > currently aligned to 6 bytes, which is causing warnings in the LLD
> > linker.
> >
> > Six isn't a power of two, so it's not a valid alignment value.  The
> > actual alignment doesn't matter much because it's an array of packed
> > structs.  An alignment of two is sufficient.  In reality it always gets
> > aligned to four bytes because it comes immediately after the
> > 4-byte-aligned .orc_unwind_ip section.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/218
> > Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder")
> 
> Thanks for the patch Josh, we appreciate it.  It looks like
> ee9f8fce9964 landed in v4.14-rc1.  Should we CC stable?

Yes, that would be a good idea.

Can the tip maintainers please add

  Cc: stable@vger.kernel.org

when merging?

-- 
Josh

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

* [tip:x86/urgent] x86/unwind/orc: Fix ORC unwind table alignment
  2019-03-06 17:07 [PATCH] x86/unwind/orc: Fix ORC unwind table alignment Josh Poimboeuf
  2019-03-06 18:44 ` Nick Desaulniers
@ 2019-03-06 19:40 ` tip-bot for Josh Poimboeuf
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Josh Poimboeuf @ 2019-03-06 19:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, ndesaulniers, mingo, jpoimboe, sedat.dilek, dima,
	tglx, hpa, peterz

Commit-ID:  f76a16adc485699f95bb71fce114f97c832fe664
Gitweb:     https://git.kernel.org/tip/f76a16adc485699f95bb71fce114f97c832fe664
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Wed, 6 Mar 2019 11:07:24 -0600
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 6 Mar 2019 20:36:32 +0100

x86/unwind/orc: Fix ORC unwind table alignment

The .orc_unwind section is a packed array of 6-byte structs.  It's
currently aligned to 6 bytes, which is causing warnings in the LLD
linker.

Six isn't a power of two, so it's not a valid alignment value.  The
actual alignment doesn't matter much because it's an array of packed
structs.  An alignment of two is sufficient.  In reality it always gets
aligned to four bytes because it comes immediately after the
4-byte-aligned .orc_unwind_ip section.

Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder")
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: Dmitry Golovin <dima@golovin.in>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/218
Link: https://lkml.kernel.org/r/d55027ee95fe73e952dcd8be90aebd31b0095c45.1551892041.git.jpoimboe@redhat.com

---
 include/asm-generic/vmlinux.lds.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3d7a6a9c2370..f8f6f04c4453 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -733,7 +733,7 @@
 		KEEP(*(.orc_unwind_ip))					\
 		__stop_orc_unwind_ip = .;				\
 	}								\
-	. = ALIGN(6);							\
+	. = ALIGN(2);							\
 	.orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) {		\
 		__start_orc_unwind = .;					\
 		KEEP(*(.orc_unwind))					\

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

end of thread, other threads:[~2019-03-06 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 17:07 [PATCH] x86/unwind/orc: Fix ORC unwind table alignment Josh Poimboeuf
2019-03-06 18:44 ` Nick Desaulniers
2019-03-06 19:04   ` Josh Poimboeuf
2019-03-06 19:40 ` [tip:x86/urgent] " tip-bot for Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).