All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vdso: drop implicit common-page-size linker flag
@ 2018-12-06 19:12 ndesaulniers
  2018-12-06 20:29 ` Andy Lutomirski
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: ndesaulniers @ 2018-12-06 19:12 UTC (permalink / raw)
  To: luto
  Cc: Nick Desaulniers, Fangrui Song, Andi Kleen, Andi Kleen,
	Dmitry Golovin, Bill Wendling, Rui Ueyama, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin, x86, linux-kernel

These are implied by the target architecture and for x86_64 match the
max-page-size. The default for non-NaCl x86_64 is 0x1000 (4096).

In bfd the common page size is defined as 0x1000 (4096) for non-NaCl
x86_64 targets:

bfd/elf64-x86-64.c:
4998:#define ELF_COMMONPAGESIZE             0x1000

For gold, the common page size is defined as 0x1000 (4096) for non-NaCl
x86_64 targets:

gold/x86_64.cc:
1413:  0x1000, // common_pagesize (overridable by -z common-page-size)
1442:  0x1000, // common_pagesize (overridable by -z common-page-size)

(ELF_COMMONPAGESIZE also defaults to ELF_MAXPAGESIZE when not set
explicitly for a target architecture in bfd/elfxx-target.h, but that's
not relevant for x86_64).

Because it's implied by the target architecture, it's of questionable
use to implement in LLD.  This patch resolves one of the issues towards
using LLD to link an x86_64 kernel.

Fixes commit 2aae950b21e4 ("x86_64: Add vDSO for x86-64 with
gettimeofday/clock_gettime/getcpu")

Link: https://bugs.llvm.org/show_bug.cgi?id=38774
Link: https://github.com/ClangBuiltLinux/linux/issues/31
Cc: Fangrui Song <maskray@google.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Reported-by: Dmitry Golovin <dima@golovin.in>
Reported-by: Bill Wendling <morbo@google.com>
Suggested-by: Dmitry Golovin <dima@golovin.in>
Suggested-by: Rui Ueyama <ruiu@google.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/x86/entry/vdso/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 141d415a8c80..0624bf2266fd 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -47,7 +47,7 @@ targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
 CPPFLAGS_vdso.lds += -P -C
 
 VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
-			-z max-page-size=4096 -z common-page-size=4096
+			-z max-page-size=4096
 
 $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
 	$(call if_changed,vdso)
@@ -98,7 +98,7 @@ CFLAGS_REMOVE_vvar.o = -pg
 
 CPPFLAGS_vdsox32.lds = $(CPPFLAGS_vdso.lds)
 VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \
-			   -z max-page-size=4096 -z common-page-size=4096
+			   -z max-page-size=4096
 
 # x32-rebranded versions
 vobjx32s-y := $(vobjs-y:.o=-x32.o)
-- 
2.20.0.rc1.387.gf8505762e3-goog


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

end of thread, other threads:[~2018-12-11 20:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-06 19:12 [PATCH] x86/vdso: drop implicit common-page-size linker flag ndesaulniers
2018-12-06 20:29 ` Andy Lutomirski
2018-12-07 10:18 ` Borislav Petkov
2018-12-07 17:45   ` Nick Desaulniers
2018-12-07 17:52     ` Borislav Petkov
2018-12-07 18:00       ` Nick Desaulniers
2018-12-07 18:33 ` [tip:x86/urgent] x86/vdso: Drop " tip-bot for Nick Desaulniers
2018-12-11 13:12 ` [tip:x86/build] x86/um/vdso: " tip-bot for ndesaulniers@google.com
2018-12-11 17:39   ` Nick Desaulniers
2018-12-11 17:43     ` Richard Weinberger
2018-12-11 17:46       ` Borislav Petkov
2018-12-11 17:53         ` Nick Desaulniers
2018-12-11 18:05           ` Borislav Petkov
2018-12-11 19:08             ` Nick Desaulniers
2018-12-11 20:14               ` Richard Weinberger
2018-12-11 20:53               ` Borislav Petkov
2018-12-11 13:25 ` tip-bot for Nick Desaulniers

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.