[PATCH 0/6] linux-user: prctl improvements

Richard Henderson posted 6 patches 2 years, 4 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20211220214135.189157-1-richard.henderson@linaro.org
Maintainers: "Philippe Mathieu-Daudé" <philmd@redhat.com>, Taylor Simpson <tsimpson@quicinc.com>, Richard Henderson <richard.henderson@linaro.org>, Yoshinori Sato <ysato@users.sourceforge.jp>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Laurent Vivier <laurent@vivier.eu>
There is a newer version of this series
include/hw/core/cpu.h                     |   3 +
linux-user/aarch64/target_prctl.h         | 160 +++++++
linux-user/aarch64/target_syscall.h       |  23 -
linux-user/alpha/target_prctl.h           |   1 +
linux-user/arm/target_prctl.h             |   1 +
linux-user/cris/target_prctl.h            |   1 +
linux-user/generic/target_prctl_unalign.h |  27 ++
linux-user/hexagon/target_prctl.h         |   1 +
linux-user/hppa/target_prctl.h            |   1 +
linux-user/i386/target_prctl.h            |   1 +
linux-user/m68k/target_prctl.h            |   1 +
linux-user/microblaze/target_prctl.h      |   1 +
linux-user/mips/target_prctl.h            |  88 ++++
linux-user/mips/target_syscall.h          |   6 -
linux-user/mips64/target_prctl.h          |   1 +
linux-user/mips64/target_syscall.h        |   6 -
linux-user/nios2/target_prctl.h           |   1 +
linux-user/openrisc/target_prctl.h        |   1 +
linux-user/ppc/target_prctl.h             |   1 +
linux-user/riscv/target_prctl.h           |   1 +
linux-user/s390x/target_prctl.h           |   1 +
linux-user/sh4/target_prctl.h             |   1 +
linux-user/sparc/target_prctl.h           |   1 +
linux-user/x86_64/target_prctl.h          |   1 +
linux-user/xtensa/target_prctl.h          |   1 +
target/alpha/cpu.h                        |   5 +
target/hppa/cpu.h                         |   5 +-
target/sh4/cpu.h                          |   4 +
cpu.c                                     |  20 +-
linux-user/syscall.c                      | 490 +++++++++-------------
target/alpha/translate.c                  |  31 +-
target/hppa/translate.c                   |  19 +-
target/sh4/translate.c                    |  50 ++-
33 files changed, 600 insertions(+), 355 deletions(-)
create mode 100644 linux-user/aarch64/target_prctl.h
create mode 100644 linux-user/alpha/target_prctl.h
create mode 100644 linux-user/arm/target_prctl.h
create mode 100644 linux-user/cris/target_prctl.h
create mode 100644 linux-user/generic/target_prctl_unalign.h
create mode 100644 linux-user/hexagon/target_prctl.h
create mode 100644 linux-user/hppa/target_prctl.h
create mode 100644 linux-user/i386/target_prctl.h
create mode 100644 linux-user/m68k/target_prctl.h
create mode 100644 linux-user/microblaze/target_prctl.h
create mode 100644 linux-user/mips/target_prctl.h
create mode 100644 linux-user/mips64/target_prctl.h
create mode 100644 linux-user/nios2/target_prctl.h
create mode 100644 linux-user/openrisc/target_prctl.h
create mode 100644 linux-user/ppc/target_prctl.h
create mode 100644 linux-user/riscv/target_prctl.h
create mode 100644 linux-user/s390x/target_prctl.h
create mode 100644 linux-user/sh4/target_prctl.h
create mode 100644 linux-user/sparc/target_prctl.h
create mode 100644 linux-user/x86_64/target_prctl.h
create mode 100644 linux-user/xtensa/target_prctl.h
[PATCH 0/6] linux-user: prctl improvements
Posted by Richard Henderson 2 years, 4 months ago
This is split out from a larger patch set for unaligned accesses.
The changes in target/ have no effect without the changes in tcg/,
but this allows the syscall to be handled separately.


r~


Richard Henderson (6):
  linux-user: Split out do_prctl and subroutines
  linux-user: Disable more prctl subcodes
  linux-user: Add code for PR_GET/SET_UNALIGN
  target/alpha: Implement prctl_unalign_sigbus
  target/hppa: Implement prctl_unalign_sigbus
  target/sh4: Implement prctl_unalign_sigbus

 include/hw/core/cpu.h                     |   3 +
 linux-user/aarch64/target_prctl.h         | 160 +++++++
 linux-user/aarch64/target_syscall.h       |  23 -
 linux-user/alpha/target_prctl.h           |   1 +
 linux-user/arm/target_prctl.h             |   1 +
 linux-user/cris/target_prctl.h            |   1 +
 linux-user/generic/target_prctl_unalign.h |  27 ++
 linux-user/hexagon/target_prctl.h         |   1 +
 linux-user/hppa/target_prctl.h            |   1 +
 linux-user/i386/target_prctl.h            |   1 +
 linux-user/m68k/target_prctl.h            |   1 +
 linux-user/microblaze/target_prctl.h      |   1 +
 linux-user/mips/target_prctl.h            |  88 ++++
 linux-user/mips/target_syscall.h          |   6 -
 linux-user/mips64/target_prctl.h          |   1 +
 linux-user/mips64/target_syscall.h        |   6 -
 linux-user/nios2/target_prctl.h           |   1 +
 linux-user/openrisc/target_prctl.h        |   1 +
 linux-user/ppc/target_prctl.h             |   1 +
 linux-user/riscv/target_prctl.h           |   1 +
 linux-user/s390x/target_prctl.h           |   1 +
 linux-user/sh4/target_prctl.h             |   1 +
 linux-user/sparc/target_prctl.h           |   1 +
 linux-user/x86_64/target_prctl.h          |   1 +
 linux-user/xtensa/target_prctl.h          |   1 +
 target/alpha/cpu.h                        |   5 +
 target/hppa/cpu.h                         |   5 +-
 target/sh4/cpu.h                          |   4 +
 cpu.c                                     |  20 +-
 linux-user/syscall.c                      | 490 +++++++++-------------
 target/alpha/translate.c                  |  31 +-
 target/hppa/translate.c                   |  19 +-
 target/sh4/translate.c                    |  50 ++-
 33 files changed, 600 insertions(+), 355 deletions(-)
 create mode 100644 linux-user/aarch64/target_prctl.h
 create mode 100644 linux-user/alpha/target_prctl.h
 create mode 100644 linux-user/arm/target_prctl.h
 create mode 100644 linux-user/cris/target_prctl.h
 create mode 100644 linux-user/generic/target_prctl_unalign.h
 create mode 100644 linux-user/hexagon/target_prctl.h
 create mode 100644 linux-user/hppa/target_prctl.h
 create mode 100644 linux-user/i386/target_prctl.h
 create mode 100644 linux-user/m68k/target_prctl.h
 create mode 100644 linux-user/microblaze/target_prctl.h
 create mode 100644 linux-user/mips/target_prctl.h
 create mode 100644 linux-user/mips64/target_prctl.h
 create mode 100644 linux-user/nios2/target_prctl.h
 create mode 100644 linux-user/openrisc/target_prctl.h
 create mode 100644 linux-user/ppc/target_prctl.h
 create mode 100644 linux-user/riscv/target_prctl.h
 create mode 100644 linux-user/s390x/target_prctl.h
 create mode 100644 linux-user/sh4/target_prctl.h
 create mode 100644 linux-user/sparc/target_prctl.h
 create mode 100644 linux-user/x86_64/target_prctl.h
 create mode 100644 linux-user/xtensa/target_prctl.h

-- 
2.25.1


Re: [PATCH 0/6] linux-user: prctl improvements
Posted by Laurent Vivier 2 years, 4 months ago
Le 20/12/2021 à 22:41, Richard Henderson a écrit :
> This is split out from a larger patch set for unaligned accesses.
> The changes in target/ have no effect without the changes in tcg/,
> but this allows the syscall to be handled separately.
> 
> 
> r~

Hi Richard,

while I was testing the series for the pull request I found some regressions on commands that were 
passing on before and are not now.

Could you send a follow up patch to add at least PR_CAPBSET_DROP and PR_SET_PDEATHSIG to make the 
LTP testsuite (20200930) happy again (capset02, prctl01, prctl02, prctl03)?

Thanks,
Laurent

Re: [PATCH 0/6] linux-user: prctl improvements
Posted by gaosong 2 years, 4 months ago
Hi Laurent,

On 2022/1/6 下午6:46, Laurent Vivier wrote:
> make the LTP testsuite (20200930) happy again (capset02, prctl01, 
> prctl02, prctl03)? 

Do we have LTP test documents?   or What test methods do we have for linux-user?

As for far, I konw 'make check ' ,'make check-tcg'.  and some testcases on tests/tcg/$Arch.

Thanks
Song

Re: [PATCH 0/6] linux-user: prctl improvements
Posted by Laurent Vivier 2 years, 4 months ago
Hi Gaosong,

Le 07/01/2022 à 09:46, gaosong a écrit :
> Hi Laurent,
> 
> On 2022/1/6 下午6:46, Laurent Vivier wrote:
>> make the LTP testsuite (20200930) happy again (capset02, prctl01, prctl02, prctl03)? 
> 
> Do we have LTP test documents?   or What test methods do we have for linux-user?

I run the Linux Test Project test suite in a container (unshare command) using binfmt_misc:

https://linux-test-project.github.io/

I have some scripts to automatically create debian chroots and build/run the suite inside:

https://github.com/vivier/linux-user-test-scrips

My top script is "run_all.sh" that creates the chroots and run the ltp_test.

The list of the targets I test is in targets.conf:

etch="m68k"
stretch="s390x ppc64le mipsel mips64el mips arm aarch64"
jessie="ppc"
wheezy="sparc32plus"
lenny="hppa alpha"
sid="m68k ppc64 sh4 riscv64 alpha aarch64 s390x hppa sparc64"
trusty="aarch64 ppc ppc64le"
bionic="aarch64 arm ppc64le s390x"

Than I compare the results with the previous run using diff_ltp.sh

This means I don't test architectures that don't have debian support, and only test on x86_64 host.

Thanks,
Laurent