[PATCH v2 0/3] linux-user, configure: fix CPU canonicalization

Paolo Bonzini posted 3 patches 9 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230808120303.585509-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <laurent@vivier.eu>
configure                                   | 173 ++++++++++++--------
linux-user/include/host/alpha/host-signal.h |  55 -------
linux-user/include/host/s390/host-signal.h  | 138 ----------------
linux-user/include/host/s390x/host-signal.h | 139 +++++++++++++++-
linux-user/include/host/x32/host-signal.h   |   1 -
5 files changed, 240 insertions(+), 266 deletions(-)
delete mode 100644 linux-user/include/host/alpha/host-signal.h
delete mode 100644 linux-user/include/host/s390/host-signal.h
delete mode 100644 linux-user/include/host/x32/host-signal.h
[PATCH v2 0/3] linux-user, configure: fix CPU canonicalization
Posted by Paolo Bonzini 9 months, 2 weeks ago
The CPU model has to be canonicalized to what Meson wants in the cross
file, to what Linux uses for its asm-$ARCH directories, and to what
QEMU uses for its user-mode emulation host/$ARCH directories.  Do
all three in a single case statement, and check that the Linux and
QEMU directories actually exist.

At a small cost in repeated lines, this ensures that there are no hidden
ordering requirements between the case statements.  In particular, commit
89e5b7935e9 ("configure: Fix linux-user host detection for riscv64",
2023-08-06) broke ppc64le because it assigned host_arch based on a
non-canonicalized version of $cpu.

While doing this, I noticed that linux-user won't work on x32, alpha
and 32-bit s390 these days, due to missing common-user/ fragments.
The first two patches clean up the directories.

v1->v2: fix s390x compilation; rearrange case terminators


Paolo Bonzini (3):
  configure: fix detection for x32 linux-user
  linux-user: cleanup unused linux-user/include/host directories
  configure: unify case statements for CPU canonicalization

 configure                                   | 173 ++++++++++++--------
 linux-user/include/host/alpha/host-signal.h |  55 -------
 linux-user/include/host/s390/host-signal.h  | 138 ----------------
 linux-user/include/host/s390x/host-signal.h | 139 +++++++++++++++-
 linux-user/include/host/x32/host-signal.h   |   1 -
 5 files changed, 240 insertions(+), 266 deletions(-)
 delete mode 100644 linux-user/include/host/alpha/host-signal.h
 delete mode 100644 linux-user/include/host/s390/host-signal.h
 delete mode 100644 linux-user/include/host/x32/host-signal.h

-- 
2.41.0
Re: [PATCH v2 0/3] linux-user, configure: fix CPU canonicalization
Posted by Ilya Leoshkevich 9 months, 2 weeks ago
On Tue, 2023-08-08 at 14:03 +0200, Paolo Bonzini wrote:
> The CPU model has to be canonicalized to what Meson wants in the
> cross
> file, to what Linux uses for its asm-$ARCH directories, and to what
> QEMU uses for its user-mode emulation host/$ARCH directories.  Do
> all three in a single case statement, and check that the Linux and
> QEMU directories actually exist.
> 
> At a small cost in repeated lines, this ensures that there are no
> hidden
> ordering requirements between the case statements.  In particular,
> commit
> 89e5b7935e9 ("configure: Fix linux-user host detection for riscv64",
> 2023-08-06) broke ppc64le because it assigned host_arch based on a
> non-canonicalized version of $cpu.
> 
> While doing this, I noticed that linux-user won't work on x32, alpha
> and 32-bit s390 these days, due to missing common-user/ fragments.
> The first two patches clean up the directories.
> 
> v1->v2: fix s390x compilation; rearrange case terminators
> 
> 
> Paolo Bonzini (3):
>   configure: fix detection for x32 linux-user
>   linux-user: cleanup unused linux-user/include/host directories
>   configure: unify case statements for CPU canonicalization
> 
>  configure                                   | 173 ++++++++++++------
> --
>  linux-user/include/host/alpha/host-signal.h |  55 -------
>  linux-user/include/host/s390/host-signal.h  | 138 ----------------
>  linux-user/include/host/s390x/host-signal.h | 139 +++++++++++++++-
>  linux-user/include/host/x32/host-signal.h   |   1 -
>  5 files changed, 240 insertions(+), 266 deletions(-)
>  delete mode 100644 linux-user/include/host/alpha/host-signal.h
>  delete mode 100644 linux-user/include/host/s390/host-signal.h
>  delete mode 100644 linux-user/include/host/x32/host-signal.h

Now it works, thanks!

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Re: [PATCH v2 0/3] linux-user, configure: fix CPU canonicalization
Posted by Michael Tokarev 9 months, 2 weeks ago
08.08.2023 15:03, Paolo Bonzini wrote:
> The CPU model has to be canonicalized to what Meson wants in the cross
> file, to what Linux uses for its asm-$ARCH directories, and to what
> QEMU uses for its user-mode emulation host/$ARCH directories.  Do
> all three in a single case statement, and check that the Linux and
> QEMU directories actually exist.
> 
> At a small cost in repeated lines, this ensures that there are no hidden
> ordering requirements between the case statements.  In particular, commit
> 89e5b7935e9 ("configure: Fix linux-user host detection for riscv64",
> 2023-08-06) broke ppc64le because it assigned host_arch based on a
> non-canonicalized version of $cpu.
> 
> While doing this, I noticed that linux-user won't work on x32, alpha
> and 32-bit s390 these days, due to missing common-user/ fragments.
> The first two patches clean up the directories.
> 
> v1->v2: fix s390x compilation; rearrange case terminators
> 
> 
> Paolo Bonzini (3):
>    configure: fix detection for x32 linux-user
>    linux-user: cleanup unused linux-user/include/host directories
>    configure: unify case statements for CPU canonicalization
> 
>   configure                                   | 173 ++++++++++++--------
>   linux-user/include/host/alpha/host-signal.h |  55 -------
>   linux-user/include/host/s390/host-signal.h  | 138 ----------------
>   linux-user/include/host/s390x/host-signal.h | 139 +++++++++++++++-
>   linux-user/include/host/x32/host-signal.h   |   1 -
>   5 files changed, 240 insertions(+), 266 deletions(-)
>   delete mode 100644 linux-user/include/host/alpha/host-signal.h
>   delete mode 100644 linux-user/include/host/s390/host-signal.h
>   delete mode 100644 linux-user/include/host/x32/host-signal.h

Tested-by: Michael Tokarev <mjt@tls.msk.ru>

Tested on s390x and ppc64le hosts.

/mjt