[PATCH 0/2] linux-user: Load a vdso for x86_64

Richard Henderson posted 2 patches 5 years, 5 months ago
Test docker-mingw@fedora passed
Test checkpatch passed
Test asan passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200519194452.9009-1-richard.henderson@linaro.org
Maintainers: Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <laurent@vivier.eu>
There is a newer version of this series
Makefile                  |   4 +-
linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
pc-bios/Makefile          |   5 +
pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
6 files changed, 401 insertions(+), 7 deletions(-)
create mode 100644 pc-bios/vdso-linux-x64.S
create mode 100644 pc-bios/vdso-linux-x64.ld
create mode 100755 pc-bios/vdso-linux-x64.so
[PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Richard Henderson 5 years, 5 months ago
The subject of AT_SYSINFO came up on launchpad recently.

There is definite room for improvement in all of this:

(1) We could build the vdso binary into qemu instead of really
    loading it from the file system.  This would obviate the
    several problems of locating the .so file.  It would also
    mean that --static builds continue to create a standalone
    qemu binary.

(2) We could use our cross-build system to build the vdso.
    Though we'd still likely want to keep the image in git
    along side the other rom images for when cross-build is
    not available.

(3) There are some ??? comments where some decisions could be made,
    and other ??? that are merely commenting on weirdness.

(4) It shouldn't take too much effort to create vdsos for the
    other architectures.  But we should get this one as clean
    as we can first.

Amusingly, this patch set has just turned 10 years old.
First posted April 4, 2010.  I don't recall ever seeing
any review on the several postings over the years.


r~


Richard Henderson (2):
  linux-user: Build vdso for x64.
  linux-user: Load a VDSO for x86-64.

 Makefile                  |   4 +-
 linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
 pc-bios/Makefile          |   5 +
 pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
 pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
 pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
 6 files changed, 401 insertions(+), 7 deletions(-)
 create mode 100644 pc-bios/vdso-linux-x64.S
 create mode 100644 pc-bios/vdso-linux-x64.ld
 create mode 100755 pc-bios/vdso-linux-x64.so

-- 
2.20.1


Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Peter Maydell 5 years, 5 months ago
On Tue, 19 May 2020 at 20:45, Richard Henderson
<richard.henderson@linaro.org> wrote:
>  Makefile                  |   4 +-
>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>  pc-bios/Makefile          |   5 +
>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes

I'm not really a fan of binaries in source control :-(

thanks
-- PMM

Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Laurent Vivier 5 years, 5 months ago
Le 28/05/2020 à 12:08, Peter Maydell a écrit :
> On Tue, 19 May 2020 at 20:45, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>  Makefile                  |   4 +-
>>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>>  pc-bios/Makefile          |   5 +
>>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
> 
> I'm not really a fan of binaries in source control :-(

Can't we see that as a firmware or a ROM?
It's only 7,4 KB and needs a cross-compilation env to be rebuilt.

Do you have another solution?

If you don't like this I can remove the series. Let me know.

Thanks,
Laurent


Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Philippe Mathieu-Daudé 5 years, 5 months ago
On 5/28/20 12:32 PM, Laurent Vivier wrote:
> Le 28/05/2020 à 12:08, Peter Maydell a écrit :
>> On Tue, 19 May 2020 at 20:45, Richard Henderson
>> <richard.henderson@linaro.org> wrote:
>>>  Makefile                  |   4 +-
>>>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>>>  pc-bios/Makefile          |   5 +
>>>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>>>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>>>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
>>
>> I'm not really a fan of binaries in source control :-(
> 
> Can't we see that as a firmware or a ROM?
> It's only 7,4 KB and needs a cross-compilation env to be rebuilt.
> 
> Do you have another solution?

There are only 13 asm instructions, the rest is ELF structure.
Maybe we can strip the linker version ELF sections. Taking out the
alignment gap, not much left.

Nonetheless it is certainly annoying to write that using a readable
scripting language when the linker already does the job, and the patch
is already written/tested.

> 
> If you don't like this I can remove the series. Let me know.
> 
> Thanks,
> Laurent
> 
> 


Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Richard Henderson 5 years, 5 months ago
On 5/28/20 3:32 AM, Laurent Vivier wrote:
> Le 28/05/2020 à 12:08, Peter Maydell a écrit :
>> On Tue, 19 May 2020 at 20:45, Richard Henderson
>> <richard.henderson@linaro.org> wrote:
>>>  Makefile                  |   4 +-
>>>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>>>  pc-bios/Makefile          |   5 +
>>>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>>>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>>>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
>>
>> I'm not really a fan of binaries in source control :-(
> 
> Can't we see that as a firmware or a ROM?
> It's only 7,4 KB and needs a cross-compilation env to be rebuilt.
> 
> Do you have another solution?
> 
> If you don't like this I can remove the series. Let me know.

I think some more of the questions in the cover letter need answering.  Does
this patch set not break your own --static chroot tests, for example?


r~

Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Laurent Vivier 5 years, 5 months ago
Le 28/05/2020 à 23:42, Richard Henderson a écrit :
> On 5/28/20 3:32 AM, Laurent Vivier wrote:
>> Le 28/05/2020 à 12:08, Peter Maydell a écrit :
>>> On Tue, 19 May 2020 at 20:45, Richard Henderson
>>> <richard.henderson@linaro.org> wrote:
>>>>  Makefile                  |   4 +-
>>>>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>>>>  pc-bios/Makefile          |   5 +
>>>>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>>>>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>>>>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
>>>
>>> I'm not really a fan of binaries in source control :-(
>>
>> Can't we see that as a firmware or a ROM?
>> It's only 7,4 KB and needs a cross-compilation env to be rebuilt.
>>
>> Do you have another solution?
>>
>> If you don't like this I can remove the series. Let me know.
> 
> I think some more of the questions in the cover letter need answering.  Does
> this patch set not break your own --static chroot tests, for example?

I will test my branch with this series in my --static chroot and remove
the series before the PR.

Thanks,
Laurent

Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Philippe Mathieu-Daudé 5 years, 5 months ago
On 5/29/20 10:50 AM, Laurent Vivier wrote:
> Le 28/05/2020 à 23:42, Richard Henderson a écrit :
>> On 5/28/20 3:32 AM, Laurent Vivier wrote:
>>> Le 28/05/2020 à 12:08, Peter Maydell a écrit :
>>>> On Tue, 19 May 2020 at 20:45, Richard Henderson
>>>> <richard.henderson@linaro.org> wrote:
>>>>>  Makefile                  |   4 +-
>>>>>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>>>>>  pc-bios/Makefile          |   5 +
>>>>>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>>>>>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>>>>>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
>>>>
>>>> I'm not really a fan of binaries in source control :-(
>>>
>>> Can't we see that as a firmware or a ROM?
>>> It's only 7,4 KB and needs a cross-compilation env to be rebuilt.
>>>
>>> Do you have another solution?
>>>
>>> If you don't like this I can remove the series. Let me know.
>>
>> I think some more of the questions in the cover letter need answering.  Does
>> this patch set not break your own --static chroot tests, for example?
> 
> I will test my branch with this series in my --static chroot and remove
> the series before the PR.

Another option is to keep patch #1 in your pullreq, but removing the .so
binary...

> 
> Thanks,
> Laurent
> 


Re: [PATCH 0/2] linux-user: Load a vdso for x86_64
Posted by Laurent Vivier 5 years, 5 months ago
Le 19/05/2020 à 21:44, Richard Henderson a écrit :
> The subject of AT_SYSINFO came up on launchpad recently.
> 
> There is definite room for improvement in all of this:
> 
> (1) We could build the vdso binary into qemu instead of really
>     loading it from the file system.  This would obviate the
>     several problems of locating the .so file.  It would also
>     mean that --static builds continue to create a standalone
>     qemu binary.
> 
> (2) We could use our cross-build system to build the vdso.
>     Though we'd still likely want to keep the image in git
>     along side the other rom images for when cross-build is
>     not available.
> 
> (3) There are some ??? comments where some decisions could be made,
>     and other ??? that are merely commenting on weirdness.
> 
> (4) It shouldn't take too much effort to create vdsos for the
>     other architectures.  But we should get this one as clean
>     as we can first.
> 
> Amusingly, this patch set has just turned 10 years old.
> First posted April 4, 2010.  I don't recall ever seeing
> any review on the several postings over the years.
> 
> 
> r~
> 
> 
> Richard Henderson (2):
>   linux-user: Build vdso for x64.
>   linux-user: Load a VDSO for x86-64.
> 
>  Makefile                  |   4 +-
>  linux-user/elfload.c      | 203 +++++++++++++++++++++++++++++++++++++-
>  pc-bios/Makefile          |   5 +
>  pc-bios/vdso-linux-x64.S  | 115 +++++++++++++++++++++
>  pc-bios/vdso-linux-x64.ld |  81 +++++++++++++++
>  pc-bios/vdso-linux-x64.so | Bin 0 -> 7500 bytes
>  6 files changed, 401 insertions(+), 7 deletions(-)
>  create mode 100644 pc-bios/vdso-linux-x64.S
>  create mode 100644 pc-bios/vdso-linux-x64.ld
>  create mode 100755 pc-bios/vdso-linux-x64.so
> 

Applied to my linux-user branch.

Thanks,
Laurent