diff mbox series

[v4,3/9] linux-user/safe-syscall.inc.S: Move to common-user

Message ID 20211116110256.365484-4-richard.henderson@linaro.org
State Superseded
Headers show
Series linux-user: simplify safe signal handling | expand

Commit Message

Richard Henderson Nov. 16, 2021, 11:02 a.m. UTC
From: Warner Losh <imp@bsdimp.com>

Move all the safe_syscall.inc.S files to common-user. They are almost
identical between linux-user and bsd-user to re-use.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211113045603.60391-4-imp@bsdimp.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 meson.build                                                 | 1 +
 {linux-user => common-user}/host/aarch64/hostdep.h          | 0
 {linux-user => common-user}/host/arm/hostdep.h              | 0
 {linux-user => common-user}/host/i386/hostdep.h             | 0
 {linux-user => common-user}/host/ppc64/hostdep.h            | 0
 {linux-user => common-user}/host/riscv/hostdep.h            | 0
 {linux-user => common-user}/host/s390x/hostdep.h            | 0
 {linux-user => common-user}/host/x86_64/hostdep.h           | 0
 {linux-user => common-user}/host/aarch64/safe-syscall.inc.S | 0
 {linux-user => common-user}/host/arm/safe-syscall.inc.S     | 0
 {linux-user => common-user}/host/i386/safe-syscall.inc.S    | 0
 {linux-user => common-user}/host/ppc64/safe-syscall.inc.S   | 0
 {linux-user => common-user}/host/riscv/safe-syscall.inc.S   | 0
 {linux-user => common-user}/host/s390x/safe-syscall.inc.S   | 0
 {linux-user => common-user}/host/x86_64/safe-syscall.inc.S  | 0
 15 files changed, 1 insertion(+)
 rename {linux-user => common-user}/host/aarch64/hostdep.h (100%)
 rename {linux-user => common-user}/host/arm/hostdep.h (100%)
 rename {linux-user => common-user}/host/i386/hostdep.h (100%)
 rename {linux-user => common-user}/host/ppc64/hostdep.h (100%)
 rename {linux-user => common-user}/host/riscv/hostdep.h (100%)
 rename {linux-user => common-user}/host/s390x/hostdep.h (100%)
 rename {linux-user => common-user}/host/x86_64/hostdep.h (100%)
 rename {linux-user => common-user}/host/aarch64/safe-syscall.inc.S (100%)
 rename {linux-user => common-user}/host/arm/safe-syscall.inc.S (100%)
 rename {linux-user => common-user}/host/i386/safe-syscall.inc.S (100%)
 rename {linux-user => common-user}/host/ppc64/safe-syscall.inc.S (100%)
 rename {linux-user => common-user}/host/riscv/safe-syscall.inc.S (100%)
 rename {linux-user => common-user}/host/s390x/safe-syscall.inc.S (100%)
 rename {linux-user => common-user}/host/x86_64/safe-syscall.inc.S (100%)

Comments

Warner Losh Nov. 16, 2021, 9:03 p.m. UTC | #1
On Tue, Nov 16, 2021 at 4:03 AM Richard Henderson <
richard.henderson@linaro.org> wrote:

> From: Warner Losh <imp@bsdimp.com>
>
> Move all the safe_syscall.inc.S files to common-user. They are almost
> identical between linux-user and bsd-user to re-use.
>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Message-Id: <20211113045603.60391-4-imp@bsdimp.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  meson.build                                                 | 1 +
>  {linux-user => common-user}/host/aarch64/hostdep.h          | 0
>  {linux-user => common-user}/host/arm/hostdep.h              | 0
>  {linux-user => common-user}/host/i386/hostdep.h             | 0
>  {linux-user => common-user}/host/ppc64/hostdep.h            | 0
>  {linux-user => common-user}/host/riscv/hostdep.h            | 0
>  {linux-user => common-user}/host/s390x/hostdep.h            | 0
>  {linux-user => common-user}/host/x86_64/hostdep.h           | 0
>  {linux-user => common-user}/host/aarch64/safe-syscall.inc.S | 0
>  {linux-user => common-user}/host/arm/safe-syscall.inc.S     | 0
>  {linux-user => common-user}/host/i386/safe-syscall.inc.S    | 0
>  {linux-user => common-user}/host/ppc64/safe-syscall.inc.S   | 0
>  {linux-user => common-user}/host/riscv/safe-syscall.inc.S   | 0
>  {linux-user => common-user}/host/s390x/safe-syscall.inc.S   | 0
>  {linux-user => common-user}/host/x86_64/safe-syscall.inc.S  | 0
>  15 files changed, 1 insertion(+)
>  rename {linux-user => common-user}/host/aarch64/hostdep.h (100%)
>  rename {linux-user => common-user}/host/arm/hostdep.h (100%)
>  rename {linux-user => common-user}/host/i386/hostdep.h (100%)
>  rename {linux-user => common-user}/host/ppc64/hostdep.h (100%)
>  rename {linux-user => common-user}/host/riscv/hostdep.h (100%)
>  rename {linux-user => common-user}/host/s390x/hostdep.h (100%)
>  rename {linux-user => common-user}/host/x86_64/hostdep.h (100%)
>  rename {linux-user => common-user}/host/aarch64/safe-syscall.inc.S (100%)
>  rename {linux-user => common-user}/host/arm/safe-syscall.inc.S (100%)
>  rename {linux-user => common-user}/host/i386/safe-syscall.inc.S (100%)
>  rename {linux-user => common-user}/host/ppc64/safe-syscall.inc.S (100%)
>  rename {linux-user => common-user}/host/riscv/safe-syscall.inc.S (100%)
>  rename {linux-user => common-user}/host/s390x/safe-syscall.inc.S (100%)
>  rename {linux-user => common-user}/host/x86_64/safe-syscall.inc.S (100%)
>
> diff --git a/meson.build b/meson.build
> index ccc6cefc25..ec22cf05c1 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2878,6 +2878,7 @@ foreach target : target_dirs
>      if 'CONFIG_LINUX_USER' in config_target
>        base_dir = 'linux-user'
>        target_inc += include_directories('linux-user/host/' /
> config_host['ARCH'])
> +      target_inc += include_directories('common-user/host/' /
> config_host['ARCH'])
>      endif
>      if 'CONFIG_BSD_USER' in config_target
>        base_dir = 'bsd-user'
>

I had to add this:

diff --git a/meson.build b/meson.build
index 0a88bff8d2..349e7a988f 100644
--- a/meson.build
+++ b/meson.build
@@ -2880,6 +2880,8 @@ foreach target : target_dirs
     endif
     if 'CONFIG_BSD_USER' in config_target
       base_dir = 'bsd-user'
+      target_inc += include_directories('bsd-user/host/' /
config_host['ARCH'])
+      target_inc += include_directories('common-user/host/' /
config_host['ARCH'])
       target_inc += include_directories('bsd-user/' / targetos)
       dir = base_dir / abi
       arch_srcs += files(dir / 'target_arch_cpu.c')

to get bsd-user compiling.


> diff --git a/linux-user/host/aarch64/hostdep.h
> b/common-user/host/aarch64/hostdep.h
> similarity index 100%
> rename from linux-user/host/aarch64/hostdep.h
> rename to common-user/host/aarch64/hostdep.h
> diff --git a/linux-user/host/arm/hostdep.h b/common-user/host/arm/hostdep.h
> similarity index 100%
> rename from linux-user/host/arm/hostdep.h
> rename to common-user/host/arm/hostdep.h
> diff --git a/linux-user/host/i386/hostdep.h
> b/common-user/host/i386/hostdep.h
> similarity index 100%
> rename from linux-user/host/i386/hostdep.h
> rename to common-user/host/i386/hostdep.h
> diff --git a/linux-user/host/ppc64/hostdep.h
> b/common-user/host/ppc64/hostdep.h
> similarity index 100%
> rename from linux-user/host/ppc64/hostdep.h
> rename to common-user/host/ppc64/hostdep.h
> diff --git a/linux-user/host/riscv/hostdep.h
> b/common-user/host/riscv/hostdep.h
> similarity index 100%
> rename from linux-user/host/riscv/hostdep.h
> rename to common-user/host/riscv/hostdep.h
> diff --git a/linux-user/host/s390x/hostdep.h
> b/common-user/host/s390x/hostdep.h
> similarity index 100%
> rename from linux-user/host/s390x/hostdep.h
> rename to common-user/host/s390x/hostdep.h
> diff --git a/linux-user/host/x86_64/hostdep.h
> b/common-user/host/x86_64/hostdep.h
> similarity index 100%
> rename from linux-user/host/x86_64/hostdep.h
> rename to common-user/host/x86_64/hostdep.h
> diff --git a/linux-user/host/aarch64/safe-syscall.inc.S
> b/common-user/host/aarch64/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/aarch64/safe-syscall.inc.S
> rename to common-user/host/aarch64/safe-syscall.inc.S
> diff --git a/linux-user/host/arm/safe-syscall.inc.S
> b/common-user/host/arm/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/arm/safe-syscall.inc.S
> rename to common-user/host/arm/safe-syscall.inc.S
> diff --git a/linux-user/host/i386/safe-syscall.inc.S
> b/common-user/host/i386/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/i386/safe-syscall.inc.S
> rename to common-user/host/i386/safe-syscall.inc.S
> diff --git a/linux-user/host/ppc64/safe-syscall.inc.S
> b/common-user/host/ppc64/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/ppc64/safe-syscall.inc.S
> rename to common-user/host/ppc64/safe-syscall.inc.S
> diff --git a/linux-user/host/riscv/safe-syscall.inc.S
> b/common-user/host/riscv/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/riscv/safe-syscall.inc.S
> rename to common-user/host/riscv/safe-syscall.inc.S
> diff --git a/linux-user/host/s390x/safe-syscall.inc.S
> b/common-user/host/s390x/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/s390x/safe-syscall.inc.S
> rename to common-user/host/s390x/safe-syscall.inc.S
> diff --git a/linux-user/host/x86_64/safe-syscall.inc.S
> b/common-user/host/x86_64/safe-syscall.inc.S
> similarity index 100%
> rename from linux-user/host/x86_64/safe-syscall.inc.S
> rename to common-user/host/x86_64/safe-syscall.inc.S
> --
> 2.25.1
>
>
Philippe Mathieu-Daudé Nov. 17, 2021, 8:11 a.m. UTC | #2
On 11/16/21 22:03, Warner Losh wrote:
> On Tue, Nov 16, 2021 at 4:03 AM Richard Henderson
> <richard.henderson@linaro.org <mailto:richard.henderson@linaro.org>> wrote:
> 
>     From: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
> 
>     Move all the safe_syscall.inc.S files to common-user. They are almost
>     identical between linux-user and bsd-user to re-use.
> 
>     Signed-off-by: Warner Losh <imp@bsdimp.com <mailto:imp@bsdimp.com>>
>     Reviewed-by: Richard Henderson <richard.henderson@linaro.org
>     <mailto:richard.henderson@linaro.org>>
>     Message-Id: <20211113045603.60391-4-imp@bsdimp.com
>     <mailto:20211113045603.60391-4-imp@bsdimp.com>>
>     Signed-off-by: Richard Henderson <richard.henderson@linaro.org
>     <mailto:richard.henderson@linaro.org>>
>     ---
>      meson.build                                                 | 1 +
>      {linux-user => common-user}/host/aarch64/hostdep.h          | 0
>      {linux-user => common-user}/host/arm/hostdep.h              | 0
>      {linux-user => common-user}/host/i386/hostdep.h             | 0
>      {linux-user => common-user}/host/ppc64/hostdep.h            | 0
>      {linux-user => common-user}/host/riscv/hostdep.h            | 0
>      {linux-user => common-user}/host/s390x/hostdep.h            | 0
>      {linux-user => common-user}/host/x86_64/hostdep.h           | 0
>      {linux-user => common-user}/host/aarch64/safe-syscall.inc.S | 0
>      {linux-user => common-user}/host/arm/safe-syscall.inc.S     | 0
>      {linux-user => common-user}/host/i386/safe-syscall.inc.S    | 0
>      {linux-user => common-user}/host/ppc64/safe-syscall.inc.S   | 0
>      {linux-user => common-user}/host/riscv/safe-syscall.inc.S   | 0
>      {linux-user => common-user}/host/s390x/safe-syscall.inc.S   | 0
>      {linux-user => common-user}/host/x86_64/safe-syscall.inc.S  | 0
>      15 files changed, 1 insertion(+)
>      rename {linux-user => common-user}/host/aarch64/hostdep.h (100%)
>      rename {linux-user => common-user}/host/arm/hostdep.h (100%)
>      rename {linux-user => common-user}/host/i386/hostdep.h (100%)
>      rename {linux-user => common-user}/host/ppc64/hostdep.h (100%)
>      rename {linux-user => common-user}/host/riscv/hostdep.h (100%)
>      rename {linux-user => common-user}/host/s390x/hostdep.h (100%)
>      rename {linux-user => common-user}/host/x86_64/hostdep.h (100%)
>      rename {linux-user => common-user}/host/aarch64/safe-syscall.inc.S
>     (100%)
>      rename {linux-user => common-user}/host/arm/safe-syscall.inc.S (100%)
>      rename {linux-user => common-user}/host/i386/safe-syscall.inc.S (100%)
>      rename {linux-user => common-user}/host/ppc64/safe-syscall.inc.S (100%)
>      rename {linux-user => common-user}/host/riscv/safe-syscall.inc.S (100%)
>      rename {linux-user => common-user}/host/s390x/safe-syscall.inc.S (100%)
>      rename {linux-user => common-user}/host/x86_64/safe-syscall.inc.S
>     (100%)
> 
>     diff --git a/meson.build b/meson.build
>     index ccc6cefc25..ec22cf05c1 100644
>     --- a/meson.build
>     +++ b/meson.build
>     @@ -2878,6 +2878,7 @@ foreach target : target_dirs
>          if 'CONFIG_LINUX_USER' in config_target
>            base_dir = 'linux-user'
>            target_inc += include_directories('linux-user/host/' /
>     config_host['ARCH'])
>     +      target_inc += include_directories('common-user/host/' /
>     config_host['ARCH'])
>          endif
>          if 'CONFIG_BSD_USER' in config_target
>            base_dir = 'bsd-user'
> 
> 
> I had to add this:
> 
> diff --git a/meson.build b/meson.build
> index 0a88bff8d2..349e7a988f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2880,6 +2880,8 @@ foreach target : target_dirs
>      endif
>      if 'CONFIG_BSD_USER' in config_target
>        base_dir = 'bsd-user'
> +      target_inc += include_directories('bsd-user/host/' /
> config_host['ARCH'])
> +      target_inc += include_directories('common-user/host/' /
> config_host['ARCH'])
>        target_inc += include_directories('bsd-user/' / targetos)
>        dir = base_dir / abi
>        arch_srcs += files(dir / 'target_arch_cpu.c')
> 
> to get bsd-user compiling.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Richard Henderson Nov. 17, 2021, 12:49 p.m. UTC | #3
On 11/16/21 10:03 PM, Warner Losh wrote:
> I had to add this:
> 
> diff --git a/meson.build b/meson.build
> index 0a88bff8d2..349e7a988f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2880,6 +2880,8 @@ foreach target : target_dirs
>       endif
>       if 'CONFIG_BSD_USER' in config_target
>         base_dir = 'bsd-user'
> +      target_inc += include_directories('bsd-user/host/' / config_host['ARCH'])
> +      target_inc += include_directories('common-user/host/' / config_host['ARCH'])

I get an error for adding bsd-user/host/ at this point, because bsd-user/host/arch does 
not yet exist.  But I can certainly add common-user/host/ now.


r~
Warner Losh Nov. 17, 2021, 4:09 p.m. UTC | #4
On Wed, Nov 17, 2021 at 5:49 AM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 11/16/21 10:03 PM, Warner Losh wrote:
> > I had to add this:
> >
> > diff --git a/meson.build b/meson.build
> > index 0a88bff8d2..349e7a988f 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -2880,6 +2880,8 @@ foreach target : target_dirs
> >       endif
> >       if 'CONFIG_BSD_USER' in config_target
> >         base_dir = 'bsd-user'
> > +      target_inc += include_directories('bsd-user/host/' /
> config_host['ARCH'])
> > +      target_inc += include_directories('common-user/host/' /
> config_host['ARCH'])
>
> I get an error for adding bsd-user/host/ at this point, because
> bsd-user/host/arch does
> not yet exist.  But I can certainly add common-user/host/ now.
>

That makes sense... It's in my staging area because git sometimes leaves it
behind when I
switch between the bsd-user fork and the qemu upstream and/or my working
branches.

Warner
Philippe Mathieu-Daudé Nov. 17, 2021, 4:20 p.m. UTC | #5
On 11/17/21 13:49, Richard Henderson wrote:
> On 11/16/21 10:03 PM, Warner Losh wrote:
>> I had to add this:
>>
>> diff --git a/meson.build b/meson.build
>> index 0a88bff8d2..349e7a988f 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -2880,6 +2880,8 @@ foreach target : target_dirs
>>       endif
>>       if 'CONFIG_BSD_USER' in config_target
>>         base_dir = 'bsd-user'
>> +      target_inc += include_directories('bsd-user/host/' /
>> config_host['ARCH'])
>> +      target_inc += include_directories('common-user/host/' /
>> config_host['ARCH'])
> 
> I get an error for adding bsd-user/host/ at this point, because
> bsd-user/host/arch does not yet exist.  But I can certainly add
> common-user/host/ now.

Does commit 46369b50ee3 help?
("Introduce meson_user_arch source set for arch-specific user-mode")
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index ccc6cefc25..ec22cf05c1 100644
--- a/meson.build
+++ b/meson.build
@@ -2878,6 +2878,7 @@  foreach target : target_dirs
     if 'CONFIG_LINUX_USER' in config_target
       base_dir = 'linux-user'
       target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
+      target_inc += include_directories('common-user/host/' / config_host['ARCH'])
     endif
     if 'CONFIG_BSD_USER' in config_target
       base_dir = 'bsd-user'
diff --git a/linux-user/host/aarch64/hostdep.h b/common-user/host/aarch64/hostdep.h
similarity index 100%
rename from linux-user/host/aarch64/hostdep.h
rename to common-user/host/aarch64/hostdep.h
diff --git a/linux-user/host/arm/hostdep.h b/common-user/host/arm/hostdep.h
similarity index 100%
rename from linux-user/host/arm/hostdep.h
rename to common-user/host/arm/hostdep.h
diff --git a/linux-user/host/i386/hostdep.h b/common-user/host/i386/hostdep.h
similarity index 100%
rename from linux-user/host/i386/hostdep.h
rename to common-user/host/i386/hostdep.h
diff --git a/linux-user/host/ppc64/hostdep.h b/common-user/host/ppc64/hostdep.h
similarity index 100%
rename from linux-user/host/ppc64/hostdep.h
rename to common-user/host/ppc64/hostdep.h
diff --git a/linux-user/host/riscv/hostdep.h b/common-user/host/riscv/hostdep.h
similarity index 100%
rename from linux-user/host/riscv/hostdep.h
rename to common-user/host/riscv/hostdep.h
diff --git a/linux-user/host/s390x/hostdep.h b/common-user/host/s390x/hostdep.h
similarity index 100%
rename from linux-user/host/s390x/hostdep.h
rename to common-user/host/s390x/hostdep.h
diff --git a/linux-user/host/x86_64/hostdep.h b/common-user/host/x86_64/hostdep.h
similarity index 100%
rename from linux-user/host/x86_64/hostdep.h
rename to common-user/host/x86_64/hostdep.h
diff --git a/linux-user/host/aarch64/safe-syscall.inc.S b/common-user/host/aarch64/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/aarch64/safe-syscall.inc.S
rename to common-user/host/aarch64/safe-syscall.inc.S
diff --git a/linux-user/host/arm/safe-syscall.inc.S b/common-user/host/arm/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/arm/safe-syscall.inc.S
rename to common-user/host/arm/safe-syscall.inc.S
diff --git a/linux-user/host/i386/safe-syscall.inc.S b/common-user/host/i386/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/i386/safe-syscall.inc.S
rename to common-user/host/i386/safe-syscall.inc.S
diff --git a/linux-user/host/ppc64/safe-syscall.inc.S b/common-user/host/ppc64/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/ppc64/safe-syscall.inc.S
rename to common-user/host/ppc64/safe-syscall.inc.S
diff --git a/linux-user/host/riscv/safe-syscall.inc.S b/common-user/host/riscv/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/riscv/safe-syscall.inc.S
rename to common-user/host/riscv/safe-syscall.inc.S
diff --git a/linux-user/host/s390x/safe-syscall.inc.S b/common-user/host/s390x/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/s390x/safe-syscall.inc.S
rename to common-user/host/s390x/safe-syscall.inc.S
diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/common-user/host/x86_64/safe-syscall.inc.S
similarity index 100%
rename from linux-user/host/x86_64/safe-syscall.inc.S
rename to common-user/host/x86_64/safe-syscall.inc.S