From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>,
Jared Rossi <jrossi@linux.ibm.com>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Eric Farman <farman@linux.ibm.com>,
Matthew Rosato <mjrosato@linux.ibm.com>
Subject: Re: [PATCH v1] tests/qtest/migration: Fix A-B file build
Date: Tue, 5 May 2026 12:32:35 -0400 [thread overview]
Message-ID: <afobo6vVUd2Pga76@x1.local> (raw)
In-Reply-To: <20260429231025.30818-1-farosas@suse.de>
On Wed, Apr 29, 2026 at 08:10:25PM -0300, Fabiano Rosas wrote:
> The generation of the guest workloads for migration-test is all
> broken:
>
> 1) We moved code around and forgot to update the includes from the guest
> workloads at qtest/migration/<ARCH>/.
>
> 2) Since this code doesn't build by default due to the need for cross
> compilation, we also broke the s390x code entirely by removing the
> libc implementation from sclp.c.
>
> 3) The build adds a blank line at the end of the header files due to
> how the sed command used to remove extra variable declarations is
> written.
>
> 4) Must be too long since we last built this thing that powerpc
> compilers would output BE by default. Nowadays we need -mbig-endian to
> force it.
>
> 5) Format of comments needs fixing to please checkpatch.
>
> Fix everything. Most changes are trivial, except for s390x where I had
> to reimplement some of the routines from sclp.c. Compiling that object
> file in doesn't work because of its various includes that this
> standalone code can't provide.
>
> Testing this change (assuming x86 host):
> $ cd build
> $ pushd tests/qtest/migration
> $ make clean
> $ make i386
> $ make CROSS_PREFIX=your-favorite-cross-compiler- s390x
> $ make CROSS_PREFIX=your-favorite-cross-compiler- aarch64
> $ make CROSS_PREFIX=your-favorite-cross-compiler- ppc64
> $ popd
> $ make -j$(nproc) # must build the tests again
> $ QTEST_QEMU_BINARY=./qemu-system-<ARCH> migration-test
>
> Fixes: 9f4278837d ("pc-bios/s390-ccw: Use the libc from SLOF and remove sclp prints")
> Fixes: e1803dabdc ("tests/qtest/migration: Move common test code")
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Since things are essentially broken, I queued this one directly. However I
don't have any knowledge to review the s390 changes, please s390x
developers do so and if things need change we can do follow ups.
I did test all these and they work. One thing to mention below,
> ---
> tests/qtest/migration/Makefile | 11 +-
> tests/qtest/migration/aarch64/Makefile | 4 +-
> tests/qtest/migration/aarch64/a-b-kernel.S | 2 +-
> tests/qtest/migration/aarch64/a-b-kernel.h | 7 +-
> tests/qtest/migration/bootfile.h | 11 +
> tests/qtest/migration/i386/Makefile | 4 +-
> tests/qtest/migration/i386/a-b-bootblock.S | 2 +-
> tests/qtest/migration/i386/a-b-bootblock.h | 8 +-
> tests/qtest/migration/ppc64/Makefile | 6 +-
> tests/qtest/migration/ppc64/a-b-kernel.S | 2 +-
> tests/qtest/migration/ppc64/a-b-kernel.h | 8 +-
> tests/qtest/migration/s390x/Makefile | 8 +-
> tests/qtest/migration/s390x/a-b-bios.c | 66 ++-
> tests/qtest/migration/s390x/a-b-bios.h | 609 +++++++++++++--------
I somehow generated different a-b-bios.h for s390x after cross-make. But I
verified both versions of s390x_elf[] work here.
My gut feeling is it is a compiler difference causing different code
generated, even if there's no real functional difference.
My "your-favorite-cross-compiler-" dumps this:
$ s390x-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/s390x-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/s390x-linux-gnu/15/lto-wrapper
Target: s390x-linux-gnu
Configured with: ../gcc-15.2.1-20250808/configure --bindir=/usr/bin --build=x86_64-redhat-linux-gnu --datadir=/usr/share --disable-decimal-float --disable-dependency-tracking --disable-gold --disable-libgcj --disable-libgomp --disable-libmpx --disable-libquadmath --disable-libssp --disable-libunwind-exceptions --disable-shared --disable-silent-rules --disable-sjlj-exceptions --disable-threads --with-ld=/usr/bin/s390x-linux-gnu-ld --enable-__cxa_atexit --enable-checking=release --enable-gnu-unique-object --enable-initfini-array --enable-languages=c,c++ --enable-linker-build-id --enable-lto --enable-nls --enable-obsolete --enable-plugin --enable-targets=all --exec-prefix=/usr --host=x86_64-redhat-linux-gnu --includedir=/usr/include --infodir=/usr/share/info --libexecdir=/usr/libexec --localstatedir=/var --mandir=/usr/share/man --prefix=/usr --program-prefix=s390x-linux-gnu- --sbindir=/usr/bin --sharedstatedir=/var/lib --sysconfdir=/etc --target=s390x-linux-gnu --with-bugurl=http://bugzilla.redhat.com/bugzilla/ --with-gcc-major-version-only --with-isl --with-newlib --with-plugin-ld=/usr/bin/s390x-linux-gnu-ld --with-sysroot=/usr/s390x-linux-gnu/sys-root --with-system-libunwind --with-system-zlib --without-headers --with-arch=zEC12 --with-tune=z13 --enable-decimal-float --with-long-double-128 --enable-gnu-indirect-function --with-linker-hash-style=gnu
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.1 20250808 (Red Hat Cross 15.2.1-1) (GCC)
--
Peter Xu
next prev parent reply other threads:[~2026-05-05 16:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 23:10 [PATCH v1] tests/qtest/migration: Fix A-B file build Fabiano Rosas
2026-05-05 16:32 ` Peter Xu [this message]
2026-05-05 19:53 ` Matthew Rosato
2026-05-05 16:44 ` Peter Xu
2026-05-05 19:11 ` Fabiano Rosas
2026-05-05 19:38 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afobo6vVUd2Pga76@x1.local \
--to=peterx@redhat.com \
--cc=cohuck@redhat.com \
--cc=farman@linux.ibm.com \
--cc=farosas@suse.de \
--cc=jrossi@linux.ibm.com \
--cc=lvivier@redhat.com \
--cc=mjrosato@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.