[PULL v2 0/5] Linux user for 5.0 patches

Laurent Vivier posted 5 patches 4 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200324111700.595531-1-laurent@vivier.eu
Maintainers: Riku Voipio <riku.voipio@iki.fi>, Laurent Vivier <laurent@vivier.eu>, Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <rth@twiddle.net>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
linux-user/i386/cpu_loop.c | 201 ++++++++++++++++++++++++++-----------
linux-user/syscall.c       |  39 ++++++-
target/i386/cpu.h          |  12 ++-
target/i386/translate.c    |  14 ++-
4 files changed, 200 insertions(+), 66 deletions(-)
[PULL v2 0/5] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
The following changes since commit 29e0855c5af62bbb0b0b6fed792e004dad92ba95:

  Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging (2020-03-22 21:00:38 +0000)

are available in the Git repository at:

  git://github.com/vivier/qemu.git tags/linux-user-for-5.0-pull-request

for you to fetch changes up to eec24827f7e67ead39349bb78597da566f854a4c:

  linux-user: Flush out implementation of gettimeofday (2020-03-24 12:04:14 +0100)

----------------------------------------------------------------
Emulate x86_64 vsyscall

v2: remove trailing space

----------------------------------------------------------------

Richard Henderson (5):
  target/i386: Renumber EXCP_SYSCALL
  linux-user/i386: Split out gen_signal
  linux-user/i386: Emulate x86_64 vsyscalls
  linux-user: Add x86_64 vsyscall page to /proc/self/maps
  linux-user: Flush out implementation of gettimeofday

 linux-user/i386/cpu_loop.c | 201 ++++++++++++++++++++++++++-----------
 linux-user/syscall.c       |  39 ++++++-
 target/i386/cpu.h          |  12 ++-
 target/i386/translate.c    |  14 ++-
 4 files changed, 200 insertions(+), 66 deletions(-)

-- 
2.25.1


Re: [PULL v2 0/5] Linux user for 5.0 patches
Posted by Peter Maydell 4 years, 1 month ago
On Tue, 24 Mar 2020 at 11:18, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit 29e0855c5af62bbb0b0b6fed792e004dad92ba95:
>
>   Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging (2020-03-22 21:00:38 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/vivier/qemu.git tags/linux-user-for-5.0-pull-request
>
> for you to fetch changes up to eec24827f7e67ead39349bb78597da566f854a4c:
>
>   linux-user: Flush out implementation of gettimeofday (2020-03-24 12:04:14 +0100)
>
> ----------------------------------------------------------------
> Emulate x86_64 vsyscall
>
> v2: remove trailing space
>
> ----------------------------------------------------------------
>
> Richard Henderson (5):
>   target/i386: Renumber EXCP_SYSCALL
>   linux-user/i386: Split out gen_signal
>   linux-user/i386: Emulate x86_64 vsyscalls
>   linux-user: Add x86_64 vsyscall page to /proc/self/maps
>   linux-user: Flush out implementation of gettimeofday

Fails as before:

/home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-linux-user/qemu-x86_64
-L ./gnemul/qemu-x86_64 x86_64/ls -l dummyfile
qemu: 0x40008117e9: unhandled CPU exception 0x101 - aborting
RAX=000000000000003f RBX=000000006ffffe34 RCX=0000004000800b18
RDX=0000004000813180
RSI=0000000000000064 RDI=0000004000800670 RBP=000000006fffff40
RSP=0000004000800668
R8 =0000000000000000 R9 =0000004000800b45 R10=0000004000801a18
R11=0000004000801260
R12=00000040008008c0 R13=0000000000000008 R14=0000000000400040
R15=00000040008032d0
RIP=00000040008117e9 RFL=00000246 [---Z-P-] CPL=3 II=0 A20=1 SMM=0 HLT=0
ES =0000 0000000000000000 00000000 00000000
CS =0033 0000000000000000 ffffffff 00effb00 DPL=3 CS64 [-RA]
SS =002b 0000000000000000 ffffffff 00cff300 DPL=3 DS   [-WA]
DS =0000 0000000000000000 00000000 00000000
FS =0000 0000000000000000 00000000 00000000
GS =0000 0000000000000000 00000000 00000000
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT=     000000400091a000 0000007f
IDT=     0000004000919000 000001ff
CR0=80010001 CR2=0000000000000000 CR3=0000000000000000 CR4=00000220
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000500
Makefile:6: recipe for target 'test' failed
make: *** [test] Error 127
make: Leaving directory '/home/petmay01/linaro/linux-user-test-0.3'

thanks
-- PMM

Re: [PULL v2 0/5] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 24/03/2020 à 13:20, Peter Maydell a écrit :
> On Tue, 24 Mar 2020 at 11:18, Laurent Vivier <laurent@vivier.eu> wrote:
>>
>> The following changes since commit 29e0855c5af62bbb0b0b6fed792e004dad92ba95:
>>
>>   Merge remote-tracking branch 'remotes/elmarco/tags/slirp-pull-request' into staging (2020-03-22 21:00:38 +0000)
>>
>> are available in the Git repository at:
>>
>>   git://github.com/vivier/qemu.git tags/linux-user-for-5.0-pull-request
>>
>> for you to fetch changes up to eec24827f7e67ead39349bb78597da566f854a4c:
>>
>>   linux-user: Flush out implementation of gettimeofday (2020-03-24 12:04:14 +0100)
>>
>> ----------------------------------------------------------------
>> Emulate x86_64 vsyscall
>>
>> v2: remove trailing space
>>
>> ----------------------------------------------------------------
>>
>> Richard Henderson (5):
>>   target/i386: Renumber EXCP_SYSCALL
>>   linux-user/i386: Split out gen_signal
>>   linux-user/i386: Emulate x86_64 vsyscalls
>>   linux-user: Add x86_64 vsyscall page to /proc/self/maps
>>   linux-user: Flush out implementation of gettimeofday
> 
> Fails as before:

OK, I think there is an existing problem in the build dependencies.

Do you use enable all targets ("configure" without parameters)?
Do you run make with "all" or "x86_64-linux-user/all"?

I will not resend this PR while I don't understand what really happens.

Thanks,
Laurent

Re: [PULL v2 0/5] Linux user for 5.0 patches
Posted by Peter Maydell 4 years, 1 month ago
On Tue, 24 Mar 2020 at 12:32, Laurent Vivier <laurent@vivier.eu> wrote:
> OK, I think there is an existing problem in the build dependencies.
>
> Do you use enable all targets ("configure" without parameters)?
> Do you run make with "all" or "x86_64-linux-user/all"?

This config is
'../../configure' '--cc=ccache gcc' '--enable-debug' '--static'
'--disable-system' '--disable-gnutls'
and it is an incremental build, so just

make --output-sync -C build/all-linux-static -j8
make --output-sync -C build/all-linux-static check V=1 -j8
make --output-sync -C ~/linaro/linux-user-test-0.3/ test
make --output-sync -C build/all-linux-static check-tcg

(it's step 3 that fails here).

thanks
-- PMM

Re: [PULL v2 0/5] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 24/03/2020 à 14:14, Peter Maydell a écrit :
> On Tue, 24 Mar 2020 at 12:32, Laurent Vivier <laurent@vivier.eu> wrote:
>> OK, I think there is an existing problem in the build dependencies.
>>
>> Do you use enable all targets ("configure" without parameters)?
>> Do you run make with "all" or "x86_64-linux-user/all"?
> 
> This config is
> '../../configure' '--cc=ccache gcc' '--enable-debug' '--static'
> '--disable-system' '--disable-gnutls'
> and it is an incremental build, so just
> 
> make --output-sync -C build/all-linux-static -j8
> make --output-sync -C build/all-linux-static check V=1 -j8
> make --output-sync -C ~/linaro/linux-user-test-0.3/ test
> make --output-sync -C build/all-linux-static check-tcg
> 
> (it's step 3 that fails here).
> 

The problem is introduced by the change I made to be able to bisect
while we move syscall_nr.h from source dir to build dir (as said by
Richard):

4d6a835dea47 ("linux-user: introduce parameters to generate syscall_nr.h")

There is also a new problem introduced by:

5f29856b852d(" linux-user, configure: improve syscall_nr.h dependencies
checking")

that doesn't scan arch variant (it scans ppc64-linux-user but not
ppc64le-linux-user).

The best solution I can propose is to simply remove the piece of code
I've added in configure and let the user to do a "make clean" if the
build fails because of the move of syscall_nr.h from source dir to build
dir.

Any idea?

Thanks,
Laurent

Re: [PULL v2 0/5] Linux user for 5.0 patches
Posted by Laurent Vivier 4 years, 1 month ago
Le 24/03/2020 à 23:10, Laurent Vivier a écrit :
> Le 24/03/2020 à 14:14, Peter Maydell a écrit :
>> On Tue, 24 Mar 2020 at 12:32, Laurent Vivier <laurent@vivier.eu> wrote:
>>> OK, I think there is an existing problem in the build dependencies.
>>>
>>> Do you use enable all targets ("configure" without parameters)?
>>> Do you run make with "all" or "x86_64-linux-user/all"?
>>
>> This config is
>> '../../configure' '--cc=ccache gcc' '--enable-debug' '--static'
>> '--disable-system' '--disable-gnutls'
>> and it is an incremental build, so just
>>
>> make --output-sync -C build/all-linux-static -j8
>> make --output-sync -C build/all-linux-static check V=1 -j8
>> make --output-sync -C ~/linaro/linux-user-test-0.3/ test
>> make --output-sync -C build/all-linux-static check-tcg
>>
>> (it's step 3 that fails here).
>>
> 
> The problem is introduced by the change I made to be able to bisect
> while we move syscall_nr.h from source dir to build dir (as said by
> Richard):
> 
> 4d6a835dea47 ("linux-user: introduce parameters to generate syscall_nr.h")
> 
> There is also a new problem introduced by:
> 
> 5f29856b852d(" linux-user, configure: improve syscall_nr.h dependencies
> checking")
> 
> that doesn't scan arch variant (it scans ppc64-linux-user but not
> ppc64le-linux-user).
> 
> The best solution I can propose is to simply remove the piece of code
> I've added in configure and let the user to do a "make clean" if the
> build fails because of the move of syscall_nr.h from source dir to build
> dir.

This change fixes both problems:

--- a/configure
+++ b/configure
@@ -1910,9 +1910,11 @@ for arch in alpha hppa m68k xtensa sh4 microblaze
arm ppc s390x sparc sparc64 \
     # remove the file if it has been generated in the source directory
     rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
     # remove the dependency files
-    test -d ${arch}-linux-user && find ${arch}-linux-user -type f -name
"*.d" \
-         -exec grep -q "${source_path}/linux-user/${arch}/syscall_nr.h"
{} \; \
-         -exec rm {} \;
+    for target in ${arch}*-linux-user ; do
+        test -d "${target}" && find "${target}" -type f -name "*.d" \
+             -exec grep -q
"${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
+             -print | while read file ; do set -x; rm "${file}"
"${file%.d}.o" ; set +x ; done
+    done
 done

 if test -z "$python"

Thanks,
Laurent