All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa
@ 2017-01-25 21:56 Laurent Vivier
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 1/3] linux-user: add hppa magic numbers in qemu-binfmt-conf.sh Laurent Vivier
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Laurent Vivier @ 2017-01-25 21:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, John Paul Adrian Glaubitz, Laurent Vivier

This short series enables hppa in qemu-binfmt-conf.sh, and fixes
a bug in the netlink functions that has been found by Adrian Glaubitz
while he was testing a debian chroot with qemu-hppa. I think the problem
doesn't appear on other architectures I have tested as they should use
NR_socketcall syscall instead of NR_socket syscall.

v2:
    added the hppa UTS machine name fix
    added R-b and T-b

Laurent Vivier (3):
  linux-user: add hppa magic numbers in qemu-binfmt-conf.sh
  linux-user: fix "apt-get update" on linux-user hppa
  linux-user: define correct UTS machine name for hppa

 linux-user/syscall.c        | 1 -
 linux-user/uname.c          | 2 ++
 scripts/qemu-binfmt-conf.sh | 9 +++++++--
 3 files changed, 9 insertions(+), 3 deletions(-)

-- 
2.9.3

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

* [Qemu-devel] [PATCH v2 1/3] linux-user: add hppa magic numbers in qemu-binfmt-conf.sh
  2017-01-25 21:56 [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa Laurent Vivier
@ 2017-01-25 21:56 ` Laurent Vivier
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 2/3] linux-user: fix "apt-get update" on linux-user hppa Laurent Vivier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2017-01-25 21:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, John Paul Adrian Glaubitz, Laurent Vivier

As we have now a linux-user HPPA target, we can add it to the list of
supported targets in qemu-binfmt-conf.sh

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <rth@twiddle.net>
---
 scripts/qemu-binfmt-conf.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index de4d1c1..0f1aa63 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -1,9 +1,10 @@
 #!/bin/sh
-# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390/HPPA
+# program execution by the kernel
 
 qemu_target_list="i386 i486 alpha arm sparc32plus ppc ppc64 ppc64le m68k \
 mips mipsel mipsn32 mipsn32el mips64 mips64el \
-sh4 sh4eb s390x aarch64"
+sh4 sh4eb s390x aarch64 hppa"
 
 i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00'
 i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
@@ -91,6 +92,10 @@ aarch64_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x
 aarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
 aarch64_family=arm
 
+hppa_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f'
+hppa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
+hppa_family=hppa
+
 qemu_get_family() {
     cpu=${HOST_ARCH:-$(uname -m)}
     case "$cpu" in
-- 
2.9.3

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

* [Qemu-devel] [PATCH v2 2/3] linux-user: fix "apt-get update" on linux-user hppa
  2017-01-25 21:56 [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa Laurent Vivier
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 1/3] linux-user: add hppa magic numbers in qemu-binfmt-conf.sh Laurent Vivier
@ 2017-01-25 21:56 ` Laurent Vivier
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 3/3] linux-user: define correct UTS machine name for hppa Laurent Vivier
  2017-01-25 22:05 ` [Qemu-devel] [PATCH v2 0/3] linux-user: some patches " no-reply
  3 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2017-01-25 21:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, John Paul Adrian Glaubitz, Laurent Vivier

apt-get was hanging on linux-user hppa.

strace has shown the netlink data stream was not correctly byte swapped.

It appears the fd translator function is unregistered just after it
has been registered, so the translator function is not called.

This patch removes the fd_trans_unregister() after the do_socket()
in the TARGET_NR_socket case.

This fd_trans_unregister() was added by commit
    e36800c linux-user: add signalfd/signalfd4 syscalls
when do_socket() was not registering any fd translator.
And as now it is, we must remove this fd_trans_unregister() to keep them.

Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
 linux-user/syscall.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 11a311f..9be8e95 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9343,7 +9343,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 #ifdef TARGET_NR_socket
     case TARGET_NR_socket:
         ret = do_socket(arg1, arg2, arg3);
-        fd_trans_unregister(ret);
         break;
 #endif
 #ifdef TARGET_NR_socketpair
-- 
2.9.3

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

* [Qemu-devel] [PATCH v2 3/3] linux-user: define correct UTS machine name for hppa
  2017-01-25 21:56 [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa Laurent Vivier
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 1/3] linux-user: add hppa magic numbers in qemu-binfmt-conf.sh Laurent Vivier
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 2/3] linux-user: fix "apt-get update" on linux-user hppa Laurent Vivier
@ 2017-01-25 21:56 ` Laurent Vivier
  2017-01-25 22:49   ` Peter Maydell
  2017-01-25 22:05 ` [Qemu-devel] [PATCH v2 0/3] linux-user: some patches " no-reply
  3 siblings, 1 reply; 6+ messages in thread
From: Laurent Vivier @ 2017-01-25 21:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, John Paul Adrian Glaubitz, Laurent Vivier

the correct UTS machine name (as expected by systemd) is "parisc",
not "hppa".

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/uname.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/uname.c b/linux-user/uname.c
index 313b79d..daad002 100644
--- a/linux-user/uname.c
+++ b/linux-user/uname.c
@@ -63,6 +63,8 @@ const char *cpu_to_uname_machine(void *cpu_env)
         return "i586";
     }
     return "i686";
+#elif defined(TARGET_HPPA)
+    return "parisc";
 #else
     /* default is #define-d in each arch/ subdir */
     return UNAME_MACHINE;
-- 
2.9.3

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

* Re: [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa
  2017-01-25 21:56 [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa Laurent Vivier
                   ` (2 preceding siblings ...)
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 3/3] linux-user: define correct UTS machine name for hppa Laurent Vivier
@ 2017-01-25 22:05 ` no-reply
  3 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2017-01-25 22:05 UTC (permalink / raw)
  To: laurent; +Cc: famz, qemu-devel, riku.voipio, glaubitz

Hi,

Your series seems to have some coding style problems. See output below for
more information:

Type: series
Subject: [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa
Message-id: 20170125215637.2992-1-laurent@vivier.eu

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20170125215637.2992-1-laurent@vivier.eu -> patchew/20170125215637.2992-1-laurent@vivier.eu
Switched to a new branch 'test'
c426c84 linux-user: define correct UTS machine name for hppa
1566132 linux-user: fix "apt-get update" on linux-user hppa
97a848f linux-user: add hppa magic numbers in qemu-binfmt-conf.sh

=== OUTPUT BEGIN ===
Checking PATCH 1/3: linux-user: add hppa magic numbers in qemu-binfmt-conf.sh...
ERROR: line over 90 characters
#34: FILE: scripts/qemu-binfmt-conf.sh:95:
+hppa_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0f'

ERROR: line over 90 characters
#35: FILE: scripts/qemu-binfmt-conf.sh:96:
+hppa_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'

total: 2 errors, 0 warnings, 22 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 2/3: linux-user: fix "apt-get update" on linux-user hppa...
Checking PATCH 3/3: linux-user: define correct UTS machine name for hppa...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

* Re: [Qemu-devel] [PATCH v2 3/3] linux-user: define correct UTS machine name for hppa
  2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 3/3] linux-user: define correct UTS machine name for hppa Laurent Vivier
@ 2017-01-25 22:49   ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2017-01-25 22:49 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: QEMU Developers, Riku Voipio, John Paul Adrian Glaubitz

On 25 January 2017 at 21:56, Laurent Vivier <laurent@vivier.eu> wrote:
> the correct UTS machine name (as expected by systemd) is "parisc",
> not "hppa".
>
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  linux-user/uname.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/linux-user/uname.c b/linux-user/uname.c
> index 313b79d..daad002 100644
> --- a/linux-user/uname.c
> +++ b/linux-user/uname.c
> @@ -63,6 +63,8 @@ const char *cpu_to_uname_machine(void *cpu_env)
>          return "i586";
>      }
>      return "i686";
> +#elif defined(TARGET_HPPA)
> +    return "parisc";
>  #else
>      /* default is #define-d in each arch/ subdir */
>      return UNAME_MACHINE;

This function is for when the uname string has to be
determined at runtime. If this target has a fixed
string, then you should just set UNAME_MACHINE correctly
in linux-user/$ARCH/target_syscall.h.

thanks
-- PMM

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

end of thread, other threads:[~2017-01-25 22:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 21:56 [Qemu-devel] [PATCH v2 0/3] linux-user: some patches for hppa Laurent Vivier
2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 1/3] linux-user: add hppa magic numbers in qemu-binfmt-conf.sh Laurent Vivier
2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 2/3] linux-user: fix "apt-get update" on linux-user hppa Laurent Vivier
2017-01-25 21:56 ` [Qemu-devel] [PATCH v2 3/3] linux-user: define correct UTS machine name for hppa Laurent Vivier
2017-01-25 22:49   ` Peter Maydell
2017-01-25 22:05 ` [Qemu-devel] [PATCH v2 0/3] linux-user: some patches " no-reply

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.