2014-06-11 19:25:36

by Andy Lutomirski

[permalink] [raw]
Subject: [PATCH v2] x86,vdso: Fix vdso_install

The filenames are different now. Inspired by a patch from
Sam Ravnborg.

Reported-by: Josh Boyer <[email protected]>
Signed-off-by: Andy Lutomirski <[email protected]>
---
arch/x86/vdso/Makefile | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 9769df0..e3683d6 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -9,11 +9,6 @@ VDSOX32-$(CONFIG_X86_X32_ABI) := y
VDSO32-$(CONFIG_X86_32) := y
VDSO32-$(CONFIG_COMPAT) := y

-vdso-install-$(VDSO64-y) += vdso.so
-vdso-install-$(VDSOX32-y) += vdsox32.so
-vdso-install-$(VDSO32-y) += $(vdso32-images)
-
-
# files to link into the vdso
vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o

@@ -176,15 +171,20 @@ VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
GCOV_PROFILE := n

#
-# Install the unstripped copy of vdso*.so listed in $(vdso-install-y).
+# Install the unstripped copies of vdso*.so.
#
-quiet_cmd_vdso_install = INSTALL $@
- cmd_vdso_install = cp $(obj)/[email protected] $(MODLIB)/vdso/$@
-$(vdso-install-y): %.so: $(obj)/%.so.dbg FORCE
+quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
+ cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%)
+
+vdso_img_insttargets := $(vdso_img_sodbg:%=install_%)
+
+$(MODLIB)/vdso: FORCE
@mkdir -p $(MODLIB)/vdso
+
+$(vdso_img_insttargets): install_%: $(obj)/% $(MODLIB)/vdso FORCE
$(call cmd,vdso_install)

-PHONY += vdso_install $(vdso-install-y)
-vdso_install: $(vdso-install-y)
+PHONY += vdso_install $(vdso_img_insttargets)
+vdso_install: $(vdso_img_insttargets) FORCE

clean-files := vdso32-syscall* vdso32-sysenter* vdso32-int80*
--
1.9.3


2014-06-11 19:45:33

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH v2] x86,vdso: Fix vdso_install

On Wed, Jun 11, 2014 at 12:25:29PM -0700, Andy Lutomirski wrote:
> The filenames are different now. Inspired by a patch from
> Sam Ravnborg.
>
> Reported-by: Josh Boyer <[email protected]>
> Signed-off-by: Andy Lutomirski <[email protected]>

Better than the first version - thanks!

Acked-by: Sam Ravnborg <[email protected]>

Sam

2014-06-12 13:19:45

by Josh Boyer

[permalink] [raw]
Subject: Re: [PATCH v2] x86,vdso: Fix vdso_install

On Wed, Jun 11, 2014 at 3:25 PM, Andy Lutomirski <[email protected]> wrote:
> The filenames are different now. Inspired by a patch from
> Sam Ravnborg.
>
> Reported-by: Josh Boyer <[email protected]>
> Signed-off-by: Andy Lutomirski <[email protected]>
> ---
> arch/x86/vdso/Makefile | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
> index 9769df0..e3683d6 100644
> --- a/arch/x86/vdso/Makefile
> +++ b/arch/x86/vdso/Makefile
> @@ -9,11 +9,6 @@ VDSOX32-$(CONFIG_X86_X32_ABI) := y
> VDSO32-$(CONFIG_X86_32) := y
> VDSO32-$(CONFIG_COMPAT) := y
>
> -vdso-install-$(VDSO64-y) += vdso.so
> -vdso-install-$(VDSOX32-y) += vdsox32.so
> -vdso-install-$(VDSO32-y) += $(vdso32-images)
> -
> -
> # files to link into the vdso
> vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
>
> @@ -176,15 +171,20 @@ VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
> GCOV_PROFILE := n
>
> #
> -# Install the unstripped copy of vdso*.so listed in $(vdso-install-y).
> +# Install the unstripped copies of vdso*.so.
> #
> -quiet_cmd_vdso_install = INSTALL $@
> - cmd_vdso_install = cp $(obj)/[email protected] $(MODLIB)/vdso/$@
> -$(vdso-install-y): %.so: $(obj)/%.so.dbg FORCE
> +quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
> + cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%)
> +
> +vdso_img_insttargets := $(vdso_img_sodbg:%=install_%)
> +
> +$(MODLIB)/vdso: FORCE
> @mkdir -p $(MODLIB)/vdso
> +
> +$(vdso_img_insttargets): install_%: $(obj)/% $(MODLIB)/vdso FORCE
> $(call cmd,vdso_install)
>
> -PHONY += vdso_install $(vdso-install-y)
> -vdso_install: $(vdso-install-y)
> +PHONY += vdso_install $(vdso_img_insttargets)
> +vdso_install: $(vdso_img_insttargets) FORCE

OK, so I can't tell from the changelog if this is intentional or not,
but now this installs e.g. vdso64.so.dbg instead of vdso64.so.

[jwboyer@sb vdso]$ pwd
/lib/modules/3.16.0-0.rc0.git3.1.fc21.x86_64/vdso
[jwboyer@sb vdso]$ ls
vdso32-int80.so.dbg vdso32-syscall.so.dbg vdso32-sysenter.so.dbg
vdso64.so.dbg
[jwboyer@sb vdso]$

If it's intentional, you might want to make the changelog a bit more verbose.

josh

2014-06-12 15:28:21

by Andy Lutomirski

[permalink] [raw]
Subject: [PATCH v3] x86,vdso: Fix vdso_install

The filenames are different now. Inspired by a patch from
Sam Ravnborg.

Acked-by: Sam Ravnborg <[email protected]>
Reported-by: Josh Boyer <[email protected]>
Signed-off-by: Andy Lutomirski <[email protected]>
---

I kept Sam's ack from v2, since v3 has only a trivial change.

Changes from v1: Remove core kbuild change
Changes from v2: Name the result .so files again, not .so.dbg

arch/x86/vdso/Makefile | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 9769df0..845b45e 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -9,11 +9,6 @@ VDSOX32-$(CONFIG_X86_X32_ABI) := y
VDSO32-$(CONFIG_X86_32) := y
VDSO32-$(CONFIG_COMPAT) := y

-vdso-install-$(VDSO64-y) += vdso.so
-vdso-install-$(VDSOX32-y) += vdsox32.so
-vdso-install-$(VDSO32-y) += $(vdso32-images)
-
-
# files to link into the vdso
vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o

@@ -176,15 +171,20 @@ VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
GCOV_PROFILE := n

#
-# Install the unstripped copy of vdso*.so listed in $(vdso-install-y).
+# Install the unstripped copies of vdso*.so.
#
-quiet_cmd_vdso_install = INSTALL $@
- cmd_vdso_install = cp $(obj)/[email protected] $(MODLIB)/vdso/$@
-$(vdso-install-y): %.so: $(obj)/%.so.dbg FORCE
+quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
+ cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%)
+
+vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%)
+
+$(MODLIB)/vdso: FORCE
@mkdir -p $(MODLIB)/vdso
+
+$(vdso_img_insttargets): install_%: $(obj)/%.dbg $(MODLIB)/vdso FORCE
$(call cmd,vdso_install)

-PHONY += vdso_install $(vdso-install-y)
-vdso_install: $(vdso-install-y)
+PHONY += vdso_install $(vdso_img_insttargets)
+vdso_install: $(vdso_img_insttargets) FORCE

clean-files := vdso32-syscall* vdso32-sysenter* vdso32-int80*
--
1.9.3

2014-06-12 17:01:57

by Josh Boyer

[permalink] [raw]
Subject: Re: [PATCH v3] x86,vdso: Fix vdso_install

On Thu, Jun 12, 2014 at 11:28 AM, Andy Lutomirski <[email protected]> wrote:
> The filenames are different now. Inspired by a patch from
> Sam Ravnborg.
>
> Acked-by: Sam Ravnborg <[email protected]>
> Reported-by: Josh Boyer <[email protected]>
> Signed-off-by: Andy Lutomirski <[email protected]>

Things look great with this version. Thanks much!

Tested-by: Josh Boyer <[email protected]>

> ---
>
> I kept Sam's ack from v2, since v3 has only a trivial change.
>
> Changes from v1: Remove core kbuild change
> Changes from v2: Name the result .so files again, not .so.dbg
>
> arch/x86/vdso/Makefile | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
> index 9769df0..845b45e 100644
> --- a/arch/x86/vdso/Makefile
> +++ b/arch/x86/vdso/Makefile
> @@ -9,11 +9,6 @@ VDSOX32-$(CONFIG_X86_X32_ABI) := y
> VDSO32-$(CONFIG_X86_32) := y
> VDSO32-$(CONFIG_COMPAT) := y
>
> -vdso-install-$(VDSO64-y) += vdso.so
> -vdso-install-$(VDSOX32-y) += vdsox32.so
> -vdso-install-$(VDSO32-y) += $(vdso32-images)
> -
> -
> # files to link into the vdso
> vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
>
> @@ -176,15 +171,20 @@ VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
> GCOV_PROFILE := n
>
> #
> -# Install the unstripped copy of vdso*.so listed in $(vdso-install-y).
> +# Install the unstripped copies of vdso*.so.
> #
> -quiet_cmd_vdso_install = INSTALL $@
> - cmd_vdso_install = cp $(obj)/[email protected] $(MODLIB)/vdso/$@
> -$(vdso-install-y): %.so: $(obj)/%.so.dbg FORCE
> +quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
> + cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%)
> +
> +vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%)
> +
> +$(MODLIB)/vdso: FORCE
> @mkdir -p $(MODLIB)/vdso
> +
> +$(vdso_img_insttargets): install_%: $(obj)/%.dbg $(MODLIB)/vdso FORCE
> $(call cmd,vdso_install)
>
> -PHONY += vdso_install $(vdso-install-y)
> -vdso_install: $(vdso-install-y)
> +PHONY += vdso_install $(vdso_img_insttargets)
> +vdso_install: $(vdso_img_insttargets) FORCE
>
> clean-files := vdso32-syscall* vdso32-sysenter* vdso32-int80*
> --
> 1.9.3
>

2014-06-13 17:25:18

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH v3] x86,vdso: Fix vdso_install

On 06/12/2014 10:01 AM, Josh Boyer wrote:
> On Thu, Jun 12, 2014 at 11:28 AM, Andy Lutomirski <[email protected]> wrote:
>> The filenames are different now. Inspired by a patch from
>> Sam Ravnborg.
>>
>> Acked-by: Sam Ravnborg <[email protected]>
>> Reported-by: Josh Boyer <[email protected]>
>> Signed-off-by: Andy Lutomirski <[email protected]>
>
> Things look great with this version. Thanks much!
>
> Tested-by: Josh Boyer <[email protected]>
>

Are we okay with the 64-bit vdso now being installed as vdso64.so?

-hpa

2014-06-13 17:28:29

by Andy Lutomirski

[permalink] [raw]
Subject: Re: [PATCH v3] x86,vdso: Fix vdso_install

On Fri, Jun 13, 2014 at 10:24 AM, H. Peter Anvin <[email protected]> wrote:
> On 06/12/2014 10:01 AM, Josh Boyer wrote:
>> On Thu, Jun 12, 2014 at 11:28 AM, Andy Lutomirski <[email protected]> wrote:
>>> The filenames are different now. Inspired by a patch from
>>> Sam Ravnborg.
>>>
>>> Acked-by: Sam Ravnborg <[email protected]>
>>> Reported-by: Josh Boyer <[email protected]>
>>> Signed-off-by: Andy Lutomirski <[email protected]>
>>
>> Things look great with this version. Thanks much!
>>
>> Tested-by: Josh Boyer <[email protected]>
>>
>
> Are we okay with the 64-bit vdso now being installed as vdso64.so?

Unless someone actually complains, I think so. Ideally, I think we'd
have a symlink from the build id, but that's a separate issue.

AFAIK, the only thing that actually references these files is Fedora's
gdb, which is finding them from Fedora's build-id symlinks, which
should work fine regardless of what the thing is called.

How's this for a patch description:

make vdso_install has been broken since this commit:

commit 6f121e548f83674ab4920a4e60afb58d4f61b829
Author: Andy Lutomirski <[email protected]>
Date: Mon May 5 12:19:34 2014 -0700

x86, vdso: Reimplement vdso.so preparation in build-time C

because the names of the files to be installed changed. This fixes
vdso_install to install the right files.

Subject: [tip:x86/vdso] x86/vdso: Fix vdso_install

Commit-ID: a934fb5bc9cd1260be89272cfb7a6c9dc71974d7
Gitweb: http://git.kernel.org/tip/a934fb5bc9cd1260be89272cfb7a6c9dc71974d7
Author: Andy Lutomirski <[email protected]>
AuthorDate: Thu, 12 Jun 2014 08:28:10 -0700
Committer: H. Peter Anvin <[email protected]>
CommitDate: Fri, 13 Jun 2014 10:31:48 -0700

x86/vdso: Fix vdso_install

"make vdso_install" installs unstripped versions of the vdso objects
for the benefit of the debugger. This was broken by checkin:

6f121e548f83 x86, vdso: Reimplement vdso.so preparation in build-time C

The filenames are different now, so update the Makefile to cope.

This still installs the 64-bit vdso as vdso64.so. We believe this
will be okay, as the only known user is a patched gdb which is known
to use build-ids, but if it turns out to be a problem we may have to
add a link.

Inspired by a patch from Sam Ravnborg.

Acked-by: Sam Ravnborg <[email protected]>
Reported-by: Josh Boyer <[email protected]>
Tested-by: Josh Boyer <[email protected]>
Signed-off-by: Andy Lutomirski <[email protected]>
Link: http://lkml.kernel.org/r/b10299edd8ba98d17e07dafcd895b8ecf4d99eff.1402586707.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/vdso/Makefile | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index ba6fc27..3c0809a 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -9,11 +9,6 @@ VDSOX32-$(CONFIG_X86_X32_ABI) := y
VDSO32-$(CONFIG_X86_32) := y
VDSO32-$(CONFIG_COMPAT) := y

-vdso-install-$(VDSO64-y) += vdso.so
-vdso-install-$(VDSOX32-y) += vdsox32.so
-vdso-install-$(VDSO32-y) += $(vdso32-images)
-
-
# files to link into the vdso
vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vdso-fakesections.o
vobjs-nox32 := vdso-fakesections.o
@@ -178,15 +173,20 @@ VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
GCOV_PROFILE := n

#
-# Install the unstripped copy of vdso*.so listed in $(vdso-install-y).
+# Install the unstripped copies of vdso*.so.
#
-quiet_cmd_vdso_install = INSTALL $@
- cmd_vdso_install = cp $(obj)/[email protected] $(MODLIB)/vdso/$@
-$(vdso-install-y): %.so: $(obj)/%.so.dbg FORCE
+quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
+ cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%)
+
+vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%)
+
+$(MODLIB)/vdso: FORCE
@mkdir -p $(MODLIB)/vdso
+
+$(vdso_img_insttargets): install_%: $(obj)/%.dbg $(MODLIB)/vdso FORCE
$(call cmd,vdso_install)

-PHONY += vdso_install $(vdso-install-y)
-vdso_install: $(vdso-install-y)
+PHONY += vdso_install $(vdso_img_insttargets)
+vdso_install: $(vdso_img_insttargets) FORCE

clean-files := vdso32-syscall* vdso32-sysenter* vdso32-int80*