Migration queue
The following changes since commit 19b599f7664b2ebfd0f405fb79c14dd241557452:
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-08-27-v2' into staging (2018-08-27 16:44:20 +0100)
are available in the Git repository at:
git://github.com/juanquintela/qemu.git tags/migration/20180913
for you to fetch changes up to 418fe4f69648b4f3f0afd2588926deafac81cfe8:
tests/migration: Enable the migration test on s390x, too (2018-09-13 14:06:26 +0200)
----------------------------------------------------------------
migration/next for 20180913
Hi this patchset has all pending migration queue that I have (It superceedes the previous one).
- fix rdma_return_path (david)
- s390 migration-test (thomas)
I ported it to the nema Makefile architecuter Please thomas, confirm that you agree with my changes
- aarch64 migration-test (wei)
- lots of compression fixes (xiao)
Please, apply.
----------------------------------------------------------------
Dr. David Alan Gilbert (1):
migration/rdma: Fix uninitialised rdma_return_path
Jose Ricardo Ziviani (1):
Add a hint message to loadvm and exits on failure
Thomas Huth (1):
tests/migration: Enable the migration test on s390x, too
Wei Huang (4):
tests/migration: Convert x86 boot block compilation script into Makefile tests/migration: Support cross compilation in generating boot header file tests/migration: Add migration-test header file
tests: Add migration test for aarch64
Xiao Guangrong (5):
migration: fix calculating xbzrle_counters.cache_miss_rate
migration: handle the error condition properly
migration: do not flush_compressed_data at the end of iteration
migration: show the statistics of compression
migration: use save_page_use_compression in flush_compressed_data
hmp.c | 13 +
migration/migration.c | 12 +
migration/ram.c | 103 +++--
migration/ram.h | 1 +
migration/rdma.c | 2 +-
migration/savevm.c | 4 +-
qapi/migration.json | 26 +-
tests/Makefile.include | 2 +
tests/migration-test.c | 83 +++-
tests/migration/Makefile | 35 ++
tests/migration/aarch64/Makefile | 20 +
tests/migration/aarch64/a-b-kernel.S | 75 ++++
tests/migration/aarch64/a-b-kernel.h | 19 +
tests/migration/i386/Makefile | 22 ++
.../{x86-a-b-bootblock.s => i386/a-b-bootblock.S} | 4 -
.../{x86-a-b-bootblock.h => i386/a-b-bootblock.h} | 8 +-
tests/migration/migration-test.h | 34 ++
tests/migration/rebuild-x86-bootblock.sh | 33 --
tests/migration/s390x/Makefile | 22 ++
tests/migration/s390x/a-b-bios.c | 35 ++
tests/migration/s390x/a-b-bios.h | 427 +++++++++++++++++++++
vl.c | 1 +
22 files changed, 899 insertions(+), 82 deletions(-)
create mode 100644 tests/migration/Makefile
create mode 100644 tests/migration/aarch64/Makefile
create mode 100644 tests/migration/aarch64/a-b-kernel.S
create mode 100644 tests/migration/aarch64/a-b-kernel.h
create mode 100644 tests/migration/i386/Makefile
rename tests/migration/{x86-a-b-bootblock.s => i386/a-b-bootblock.S} (93%)
rename tests/migration/{x86-a-b-bootblock.h => i386/a-b-bootblock.h} (92%)
create mode 100644 tests/migration/migration-test.h
delete mode 100755 tests/migration/rebuild-x86-bootblock.sh
create mode 100644 tests/migration/s390x/Makefile
create mode 100644 tests/migration/s390x/a-b-bios.c
create mode 100644 tests/migration/s390x/a-b-bios.h[Qemu-devel] [PULL 01/12] migration/rdma: Fix uninitialised rdma_return_path
From: "Dr. David Alan Gilbert" <[email protected]>
Clang correctly errors out moaning that rdma_return_path is used uninitialised in the earlier error paths. Make it NULL so that the error path ignores it.
Message-Id: <[email protected]>
--- migration/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/rdma.c +1 -1
@@ -4012,7 +4012,7 @@ static void rdma_accept_incoming_migration(void *opaque)void rdma_start_incoming_migration (const char *host_port,Error **errp) {int ret; -RDMAContext *rdma, *rdma_return_path; +RDMAContext *rdma, *rdma_return_path =NULL ;Error *local_err =NULL ;trace_rdma_start_incoming_migration ();
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 02/12] migration: fix calculating xbzrle_counters.cache_miss_rate
In reply to Juan QuintelaFrom: Xiao Guangrong <[email protected]>
As Peter pointed out:
| - xbzrle_counters.cache_miss is done in save_xbzrle_page(), so it's | per-guest-page granularity | | - RAMState.iterations is done for each ram_find_and_save_block(), so | it's per-host-page granularity | | An example is that when we migrate a 2M huge page in the guest, we | will only increase the RAMState.iterations by 1 (since | ram_find_and_save_block() will be called once), but we might increase | xbzrle_counters.cache_miss for 2M/4K=512 times (we'll call | save_xbzrle_page() that many times) if all the pages got cache miss. | Then IMHO the cache miss rate will be 512/1=51200% (while it should | actually be just 100% cache miss).
And he also suggested as xbzrle_counters.cache_miss_rate is the only user of rs->iterations we can adapt it to count target guest page numbers
After that, rename 'iterations' to 'target_page_count' to better reflect its meaning
Message-Id: <[email protected]>
--- migration/ram.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
migration/ram.c +9 -9
@@ -301,10 +301,10 @@ struct RAMState {uint64_t num_dirty_pages_period;/* xbzrle misses since the beginning of the period */ uint64_t xbzrle_cache_miss_prev; -/* number of iterations at the beginning of period */ -uint64_t iterations_prev; -/* Iterations since start */ -uint64_t iterations; +/* total handled target pages at the beginning of period */ +uint64_t target_page_count_prev; +/* total handled target pages since start */ +uint64_t target_page_count;/* number of dirty bits in the bitmap */ uint64_t migration_dirty_pages;/* protects modification of the bitmap */
@@ -1592,19 +1592,19 @@ uint64_t ram_pagesize_summary(void)static void migration_update_rates (RAMState *rs,int64_t end_time) { -uint64_t iter_count = rs->iterations - rs->iterations_prev; +uint64_t page_count = rs->target_page_count - rs->target_page_count_prev;/* calculate period counters */ ram_counters.dirty_pages_rate = rs->num_dirty_pages_period *1000 / (end_time - rs->time_last_bitmap_sync); -if (!iter_count) { +if (!page_count) {return ; }if (migrate_use_xbzrle ()) { xbzrle_counters.cache_miss_rate = (double )(xbzrle_counters.cache_miss - - rs->xbzrle_cache_miss_prev) / iter_count; + rs->xbzrle_cache_miss_prev) / page_count; rs->xbzrle_cache_miss_prev = xbzrle_counters.cache_miss; } }
@@ -1662,7 +1662,7 @@ static void migration_bitmap_sync(RAMState *rs)migration_update_rates (rs, end_time); - rs->iterations_prev = rs->iterations; + rs->target_page_count_prev = rs->target_page_count;/* reset period counters */ rs->time_last_bitmap_sync = end_time;
@@ -3196,7 +3196,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) done =1 ;break ; } - rs->iterations++; + rs->target_page_count += pages;/* we want to check in the 1st loop, just in case it was the 1st time and we had to sync the dirty bitmap.
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 03/12] migration: handle the error condition properly
In reply to Juan QuintelaFrom: Xiao Guangrong <[email protected]>
ram_find_and_save_block() can return negative if any error hanppens, however, it is completely ignored in current code
Message-Id: <[email protected]>
--- migration/ram.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
migration/ram.c +15 -3
@@ -2372,7 +2372,8 @@ static int ram_save_host_page(RAMState *rs, PageSearchStatus *pss,* * Called within an RCU critical section. * -* Returns the number of pages written where zero means no dirty pages +* Returns the number of pages written where zero means no dirty pages, +* or negative on error * * @rs: current RAM state * @last_stage: if we are at the completion stage
@@ -3196,6 +3197,12 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) done =1 ;break ; } + +if (pages <0 ) { +qemu_file_set_error (f, pages); +break ; + } + rs->target_page_count += pages;/* we want to check in the 1st loop, just in case it was the 1st time
@@ -3238,7 +3245,7 @@ out:/** * ram_save_complete: function called to send the remaining amount of ram * -* Returns zero to indicate success +* Returns zero to indicate success or negative on error * * Called with iothread lock *
@@ -3249,6 +3256,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque) {RAMState **temp = opaque;RAMState *rs = *temp; +int ret =0 ;rcu_read_lock ();
@@ -3269,6 +3277,10 @@ static int ram_save_complete(QEMUFile *f, void *opaque)if (pages ==0 ) {break ; } +if (pages <0 ) { + ret = pages; +break ; + } }flush_compressed_data (rs);
@@ -3280,7 +3292,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)qemu_put_be64 (f,RAM_SAVE_FLAG_EOS );qemu_fflush (f); -return 0 ; +return ret; } static void ram_save_pending(QEMUFile *f, void *opaque, uint64_t max_size,
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 04/12] Add a hint message to loadvm and exits on failure
In reply to Juan QuintelaFrom: Jose Ricardo Ziviani <[email protected]>
This patch adds a small hint for the failure case of the load snapshot process. It may be useful for users to remember that the VM configuration has changed between the save and load processes.
(qemu) loadvm vm-20180903083641
Unknown savevm section or instance 'cpu_common' 4.
Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices Error -22 while loading VM state
(qemu) device_add host-spapr-cpu-core,core-id=4
(qemu) loadvm vm-20180903083641
(qemu) c
(qemu) info status
VM status: running
It also exits Qemu if the snapshot cannot be loaded before reaching the main loop (-loadvm in the command line).
$ qemu-system-ppc64 ... -loadvm vm-20180903083641 qemu-system-ppc64: Unknown savevm section or instance 'cpu_common' 4. Make sure that your current VM setup matches your saved VM setup, including any hotplugged devices qemu-system-ppc64: Error -22 while loading VM state $
Message-Id: <[email protected]>
--- migration/savevm.c | 4 +++- vl.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-)
migration/savevm.c +3 -1
@@ -2078,7 +2078,9 @@ qemu_loadvm_section_start_full(QEMUFile *f, MigrationIncomingState *mis)/* Find savevm section */ se =find_se (idstr, instance_id);if (se ==NULL ) { -error_report ("Unknown savevm section or instance '%s' %d" , +error_report ("Unknown savevm section or instance '%s' %d. " +"Make sure that your current VM setup matches your " +"saved VM setup, including any hotplugged devices" , idstr, instance_id);return -EINVAL ; }
vl.c +1 -0
@@ -4620,6 +4620,7 @@ int main(int argc, char **argv, char **envp)if (load_snapshot (loadvm, &local_err) <0 ) {error_report_err (local_err); autostart =0 ; +exit (1 ); } }
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 05/12] migration: do not flush_compressed_data at the end of iteration
In reply to Juan QuintelaFrom: Xiao Guangrong <[email protected]>
flush_compressed_data() needs to wait all compression threads to finish their work, after that all threads are free until the migration feeds new request to them, reducing its call can improve the throughput and use CPU resource more effectively
We do not need to flush all threads at the end of iteration, the data can be kept locally until the memory block is changed or memory migration starts over in that case we will meet a dirtied page which may still exists in compression threads's ring
Message-Id: <[email protected]>
--- migration/ram.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
migration/ram.c +11 -7
@@ -1996,17 +1996,22 @@ static bool find_dirty_block(RAMState *rs, PageSearchStatus *pss, bool *again) pss->page =0 ; pss->block =QLIST_NEXT_RCU (pss->block, next);if (!pss->block) { +/* +* If memory migration starts over, we will meet a dirtied page +* which may still exists in compression threads's ring, so we +* should flush the compressed data to make sure the new page +* is not overwritten by the old one in the destination. +* +* Also If xbzrle is on, stop using the data compression at this +* point. In theory, xbzrle can do better than compression. +*/ +flush_compressed_data (rs); +/* Hit the end of the list */ pss->block =QLIST_FIRST_RCU (&ram_list.blocks);/* Flag that we've looped */ pss->complete_round = true; rs->ram_bulk_stage = false; -if (migrate_use_xbzrle ()) { -/* If xbzrle is on, stop using the data compression at this -* point. In theory, xbzrle can do better than compression. -*/ -flush_compressed_data (rs); - } }/* Didn't find anything this time, but try again on the new block */ *again = true;
@@ -3219,7 +3224,6 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) } i++; } -flush_compressed_data (rs);rcu_read_unlock ();/*
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 07/12] migration: use save_page_use_compression in flush_compressed_data
In reply to Juan QuintelaFrom: Xiao Guangrong <[email protected]>
It avoids to touch compression locks if xbzrle and compression are both enabled
Message-Id: <[email protected]>
--- migration/ram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
migration/ram.c +3 -1
@@ -1932,11 +1932,13 @@ update_compress_thread_counts(const CompressParam *param, int bytes_xmit) compression_counters.pages++; } +static bool save_page_use_compression (RAMState *rs); +static void flush_compressed_data (RAMState *rs) {int idx, len, thread_count; -if (!migrate_use_compression ()) { +if (!save_page_use_compression (rs)) {return ; } thread_count =migrate_compress_threads ();
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 06/12] migration: show the statistics of compression
In reply to Juan QuintelaFrom: Xiao Guangrong <[email protected]>
Currently, it includes:
pages: amount of pages compressed and transferred to the target VM
busy: amount of count that no free thread to compress data
busy-rate: rate of thread busy
compressed-size: amount of bytes after compression
compression-rate: rate of compressed size
Message-Id: <[email protected]>
--- hmp.c | 13 +++++++++++++ migration/migration.c | 12 ++++++++++++ migration/ram.c | 45 ++++++++++++++++++++++++++++++++++++++++--- migration/ram.h | 1 + qapi/migration.json | 26 ++++++++++++++++++++++++- 5 files changed, 93 insertions(+), 4 deletions(-)
hmp.c +13 -0
@@ -271,6 +271,19 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->xbzrle_cache->overflow); } +if (info->has_compression) { +monitor_printf (mon,"compression pages: %" PRIu64" pages\n" , + info->compression->pages); +monitor_printf (mon,"compression busy: %" PRIu64"\n" , + info->compression->busy); +monitor_printf (mon,"compression busy rate: %0.2f\n" , + info->compression->busy_rate); +monitor_printf (mon,"compressed size: %" PRIu64"\n" , + info->compression->compressed_size); +monitor_printf (mon,"compression rate: %0.2f\n" , + info->compression->compression_rate); + } +if (info->has_cpu_throttle_percentage) {monitor_printf (mon,"cpu throttle percentage: %" PRIu64"\n" , info->cpu_throttle_percentage);
migration/migration.c +12 -0
@@ -758,6 +758,18 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) info->xbzrle_cache->overflow = xbzrle_counters.overflow; } +if (migrate_use_compression ()) { + info->has_compression = true; + info->compression =g_malloc0 (sizeof (*info->compression)); + info->compression->pages = compression_counters.pages; + info->compression->busy = compression_counters.busy; + info->compression->busy_rate = compression_counters.busy_rate; + info->compression->compressed_size = + compression_counters.compressed_size; + info->compression->compression_rate = + compression_counters.compression_rate; + } +if (cpu_throttle_active ()) { info->has_cpu_throttle_percentage = true; info->cpu_throttle_percentage =cpu_throttle_get_percentage ();
migration/ram.c +42 -3
82 lines not on this page · raw message
migration/ram.h +1 -0
@@ -36,6 +36,7 @@extern MigrationStats ram_counters;extern XBZRLECacheStats xbzrle_counters; +extern CompressionStats compression_counters;int xbzrle_cache_resize (int64_t new_size,Error **errp);uint64_t ram_bytes_remaining (void );
qapi/migration.json +25 -1
@@ -75,6 +75,27 @@ 'cache-miss': 'int', 'cache-miss-rate': 'number', 'overflow': 'int' } } +## +# @CompressionStats: +# +# Detailed migration compression statistics +# +# @pages: amount of pages compressed and transferred to the target VM +# +# @busy: count of times that no free thread was available to compress data +# +# @busy-rate: rate of thread busy +# +# @compressed-size: amount of bytes after compression +# +# @compression-rate: rate of compressed size +# +# Since: 3.1 +## +{ 'struct': 'CompressionStats', + 'data': {'pages': 'int', 'busy': 'int', 'busy-rate': 'number', + 'compressed-size': 'int', 'compression-rate': 'number' } } + ## # @MigrationStatus: #
@@ -172,6 +193,8 @@ # only present when the postcopy-blocktime migration capability # is enabled. (Since 3.0) # +# @compression: migration compression statistics, only returned if compression +# feature is on and status is 'active' or 'completed' (Since 3.1) # # Since: 0.14.0 ##
@@ -186,7 +209,8 @@ '*cpu-throttle-percentage': 'int', '*error-desc': 'str', '*postcopy-blocktime' : 'uint32', - '*postcopy-vcpu-blocktime': ['uint32']} } + '*postcopy-vcpu-blocktime': ['uint32'], + '*compression': 'CompressionStats'} } ## # @query-migrate:
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 08/12] tests/migration: Convert x86 boot block compilation script into Makefile
In reply to Juan QuintelaFrom: Wei Huang <[email protected]>
The x86 boot block header currently is generated with a shell script. To better support other CPUs (e.g. aarch64), we convert the script into Makefile. This allows us to 1) support cross-compilation easily, and 2) avoid creating a script file for every architecture.
Note that, in the new design, the cross compiler prefix can be specified by setting the CROSS_PREFIX in "make" command. Also to allow gcc pre-processor to include the C-style file correctly, it also renames the x86-a-b-bootblock.s file extension from .s to .S.
Message-Id: <[email protected]>
---
tests/migration/Makefile | 31 +++++++++++++++++
tests/migration/rebuild-x86-bootblock.sh | 33 -------------------
...86-a-b-bootblock.s => x86-a-b-bootblock.S} | 0
3 files changed, 31 insertions(+), 33 deletions(-)
create mode 100644 tests/migration/Makefile
delete mode 100755 tests/migration/rebuild-x86-bootblock.sh
rename tests/migration/{x86-a-b-bootblock.s => x86-a-b-bootblock.S} (100%)tests/migration/Makefile new file +31 -0
@@ -0,0 +1,31 @@ +# To specify cross compiler prefix, use CROSS_PREFIX= +# $ make CROSS_PREFIX=x86_64-linux-gnu- + +override define __note +/* This file is automatically generated from + * tests/migration/x86-a-b-bootblock.S, edit that and then run + * tests/migration/rebuild-x86-bootblock.sh to update, + * and then remember to send both in your patch submission. + */ +endef +export __note + +.PHONY: all clean +all: x86-a-b-bootblock.h + +x86-a-b-bootblock.h: x86.bootsect + echo "$$__note" > header.tmp + xxd -i $< | sed -e 's/.*int.*//' >> header.tmp + mv header.tmp $@ + +x86.bootsect: x86.boot + dd if=$< of=$@ bs=256 count=2 skip=124 + +x86.boot: x86.o + $(CROSS_PREFIX)objcopy -O binary $< $@ + +x86.o: x86-a-b-bootblock.S + $(CROSS_PREFIX)gcc -m32 -march=i486 -c $< -o $@ + +clean: + @rm -rf *.boot *.o *.bootsect
tests/migration/rebuild-x86-bootblock.sh deleted +0 -33
@@ -1,33 +0,0 @@ -#!/bin/sh -# Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates -# This work is licensed under the terms of the GNU GPL, version 2 or later. -# See the COPYING file in the top-level directory. -# -# Author: [email protected] - -ASMFILE=$PWD/tests/migration/x86-a-b-bootblock.s -HEADER=$PWD/tests/migration/x86-a-b-bootblock.h - -if [ ! -e "$ASMFILE" ] -then - echo "Couldn't find $ASMFILE" >&2 - exit 1 -fi - -ASM_WORK_DIR=$(mktemp -d --tmpdir X86BB.XXXXXX) -cd "$ASM_WORK_DIR" && -as --32 -march=i486 "$ASMFILE" -o x86.o && -objcopy -O binary x86.o x86.boot && -dd if=x86.boot of=x86.bootsect bs=256 count=2 skip=124 && -xxd -i x86.bootsect | -sed -e 's/.*int.*//' > x86.hex && -cat - x86.hex <<HERE > "$HEADER" -/* This file is automatically generated from - * tests/migration/x86-a-b-bootblock.s, edit that and then run - * tests/migration/rebuild-x86-bootblock.sh to update, - * and then remember to send both in your patch submission. - */ -HERE - -rm x86.hex x86.bootsect x86.boot x86.o -cd .. && rmdir "$ASM_WORK_DIR"
tests/migration/x86-a-b-bootblock.S renamed from tests/migration/x86-a-b-bootblock.s +0 -0
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 09/12] tests/migration: Support cross compilation in generating boot header file
In reply to Juan QuintelaFrom: Wei Huang <[email protected]>
Recently a new configure option, CROSS_CC_GUEST, was added to $(TARGET)-softmmu/config-target.mak to support TCG-related tests. This patch tries to leverage this option to support cross compilation when the migration boot block file is being re-generated:
* The x86 related files are moved to a new sub-dir (named ./i386).
* A new top-layer Makefile is created in tests/migration/ directory. This Makefile searches and parses CROSS_CC_GUEST to generate CROSS_PREFIX. The CROSS_PREFIX, if available, is then passed to migration/$ARCH/Makefile.
Message-Id: <[email protected]>
---
tests/migration-test.c | 2 +-
tests/migration/Makefile | 44 ++++++++++---------
tests/migration/i386/Makefile | 22 ++++++++++
.../a-b-bootblock.S} | 4 --
.../a-b-bootblock.h} | 8 ++--
5 files changed, 51 insertions(+), 29 deletions(-)
create mode 100644 tests/migration/i386/Makefile
rename tests/migration/{x86-a-b-bootblock.S => i386/a-b-bootblock.S} (93%)
rename tests/migration/{x86-a-b-bootblock.h => i386/a-b-bootblock.h} (92%)tests/migration-test.c +1 -1
@@ -83,7 +83,7 @@ static const char *tmpfs;/* A simple PC boot sector that modifies memory (1-100MB) quickly * outputting a 'B' every so often if it's still running. */ -#include "tests/migration/x86-a-b-bootblock.h" +#include "tests/migration/i386/a-b-bootblock.h" static void init_bootfile_x86 (const char *bootpath) {
tests/migration/Makefile +24 -20
55 lines not on this page · raw message
tests/migration/i386/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# To specify cross compiler prefix, use CROSS_PREFIX= +# $ make CROSS_PREFIX=x86_64-linux-gnu- + +.PHONY: all clean +all: a-b-bootblock.h + +a-b-bootblock.h: x86.bootsect + echo "$$__note" > header.tmp + xxd -i $< | sed -e 's/.*int.*//' >> header.tmp + mv header.tmp $@ + +x86.bootsect: x86.boot + dd if=$< of=$@ bs=256 count=2 skip=124 + +x86.boot: x86.o + $(CROSS_PREFIX)objcopy -O binary $< $@ + +x86.o: a-b-bootblock.S + $(CROSS_PREFIX)gcc -m32 -march=i486 -c $< -o $@ + +clean: + @rm -rf *.boot *.o *.bootsect
tests/migration/i386/a-b-bootblock.S renamed from tests/migration/x86-a-b-bootblock.S +0 -4
@@ -3,10 +3,6 @@ # range. # Outputs an initial 'A' on serial followed by repeated 'B's # -# run tests/migration/rebuild-x86-bootblock.sh -# to regenerate the hex, and remember to include both the .h and .s -# in any patches. -# # Copyright (c) 2016 Red Hat, Inc. and/or its affiliates # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory.
tests/migration/i386/a-b-bootblock.h renamed from tests/migration/x86-a-b-bootblock.h +4 -4
@@ -1,7 +1,7 @@ -/* This file is automatically generated from -* tests/migration/x86-a-b-bootblock.s, edit that and then run -* tests/migration/rebuild-x86-bootblock.sh to update, -* and then remember to send both in your patch submission. +/* This file is automatically generated from the assembly file in +* tests/migration/i386. Edit that file and then run "make all" +* inside tests/migration to update, and then remember to send both +* the header and the assembler differences in your patch submission. */ unsigned char x86_bootsect[] = {0xfa ,0x0f ,0x01 ,0x16 ,0x74 ,0x7c ,0x66 ,0xb8 ,0x01 ,0x00 ,0x00 ,0x00 ,
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 10/12] tests/migration: Add migration-test header file
In reply to Juan QuintelaFrom: Wei Huang <[email protected]>
This patch moves the settings related migration-test from the migration-test.c file to a new header file.
Message-Id: <[email protected]>
--- tests/migration-test.c | 28 ++++++++++++++++++---------- tests/migration/migration-test.h | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 tests/migration/migration-test.h
tests/migration-test.c +18 -10
@@ -21,11 +21,13 @@#include "chardev/char.h" #include "sysemu/sysemu.h" +#include "migration/migration-test.h" +/* TODO actually test the results and get rid of this */ #define qtest_qmp_discard_response (...) qobject_unref(qtest_qmp(__VA_ARGS__)) -const unsigned start_address =1024 *1024 ; -const unsigned end_address =100 *1024 *1024 ; +unsigned start_address; +unsigned end_address;bool got_stop;static bool uffd_feature_thread_id;
@@ -80,8 +82,8 @@ static bool ufd_version_check(void)static const char *tmpfs; -/* A simple PC boot sector that modifies memory (1-100MB) quickly -* outputting a 'B' every so often if it's still running. +/* The boot file modifies memory area in [start_address, end_address) +* repeatedly. It outputs a 'B' at a fixed rate while it's still running. */ #include "tests/migration/i386/a-b-bootblock.h"
@@ -270,11 +272,11 @@ static void wait_for_migration_pass(QTestState *who)static void check_guests_ram (QTestState *who) {/* Our ASM test will have been incrementing one byte from each page from -* 1MB to <100MB in order. -* This gives us a constraint that any page's byte should be equal or less -* than the previous pages byte (mod 256); and they should all be equal -* except for one transition at the point where we meet the incrementer. -* (We're running this with the guest stopped). +* start_address to < end_address in order. This gives us a constraint +* that any page's byte should be equal or less than the previous pages +* byte (mod 256); and they should all be equal except for one transition +* at the point where we meet the incrementer. (We're running this with +* the guest stopped). */ unsigned address;uint8_t first_byte;
@@ -285,7 +287,8 @@ static void check_guests_ram(QTestState *who)qtest_memread (who, start_address, &first_byte,1 ); last_byte = first_byte; -for (address = start_address +4096 ; address < end_address; address +=4096 ) +for (address = start_address +TEST_MEM_PAGE_SIZE ; address < end_address; + address +=TEST_MEM_PAGE_SIZE ) {uint8_t b;qtest_memread (who, address, &b,1 );
@@ -437,6 +440,8 @@ static int test_migrate_start(QTestState **from, QTestState **to," -drive file=%s,format=raw" " -incoming %s" , accel, tmpfs, bootpath, uri); + start_address =X86_TEST_MEM_START ; + end_address =X86_TEST_MEM_END ; }else if (strcmp (arch,"ppc64" ) ==0 ) { cmd_src =g_strdup_printf ("-machine accel=%s -m 256M" " -name source,debug-threads=on"
@@ -451,6 +456,9 @@ static int test_migrate_start(QTestState **from, QTestState **to," -serial file:%s/dest_serial" " -incoming %s" , accel, tmpfs, uri); + + start_address =PPC_TEST_MEM_START ; + end_address =PPC_TEST_MEM_END ; }else {g_assert_not_reached (); }
tests/migration/migration-test.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Copyright (c) 2018 Red Hat, Inc. and/or its affiliates +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ +#ifndef _TEST_MIGRATION_H_ +#define _TEST_MIGRATION_H_ + +/* Common */ +#define TEST_MEM_PAGE_SIZE 4096 + +/* x86 */ +#define X86_TEST_MEM_START (1 * 1024 * 1024) +#define X86_TEST_MEM_END (100 * 1024 * 1024) + +/* PPC */ +#define PPC_TEST_MEM_START (1 * 1024 * 1024) +#define PPC_TEST_MEM_END (100 * 1024 * 1024) + +#endif /* _TEST_MIGRATION_H_ */
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 11/12] tests: Add migration test for aarch64
In reply to Juan QuintelaFrom: Wei Huang <[email protected]>
This patch adds migration test support for aarch64. The test code, which implements the same functionality as x86, is booted as a kernel in qemu. Here are the design choices we make for aarch64:
* We choose this -kernel approach because aarch64 QEMU doesn't provide a built-in fw like x86 does. So instead of relying on a boot loader, we use -kernel approach for aarch64.
* The serial output is sent to PL011 directly.
* The physical memory base for mach-virt machine is 0x40000000. We change the start_address and end_address for aarch64.
In addition to providing the binary, this patch also includes the source code and the build script in tests/migration/aarch64. So users can change the source and/or re-compile the binary as they wish.
Message-Id: <[email protected]>
--- tests/Makefile.include | 1 + tests/migration-test.c | 27 ++++++++-- tests/migration/Makefile | 2 +- tests/migration/aarch64/Makefile | 20 ++++++++ tests/migration/aarch64/a-b-kernel.S | 75 ++++++++++++++++++++++++++++ tests/migration/aarch64/a-b-kernel.h | 19 +++++++ tests/migration/migration-test.h | 9 ++++ 7 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 tests/migration/aarch64/Makefile create mode 100644 tests/migration/aarch64/a-b-kernel.S create mode 100644 tests/migration/aarch64/a-b-kernel.h
tests/Makefile.include +1 -0
@@ -390,6 +390,7 @@ check-qtest-arm-y += tests/hexloader-test$(EXESUF) check-qtest-aarch64-y = tests/numa-test$(EXESUF) check-qtest-aarch64-$(CONFIG_SDHCI) += tests/sdhci-test$(EXESUF) check-qtest-aarch64-y += tests/boot-serial-test$(EXESUF) +check-qtest-aarch64-y += tests/migration-test$(EXESUF) check-qtest-microblazeel-y = $(check-qtest-microblaze-y)
tests/migration-test.c +23 -4
@@ -86,12 +86,13 @@ static const char *tmpfs;* repeatedly. It outputs a 'B' at a fixed rate while it's still running. */ #include "tests/migration/i386/a-b-bootblock.h" +#include "tests/migration/aarch64/a-b-kernel.h" -static void init_bootfile_x86 (const char *bootpath) +static void init_bootfile (const char *bootpath,void *content) {FILE *bootfile =fopen (bootpath,"wb" ); - g_assert_cmpint(fwrite(x86_bootsect, 512, 1, bootfile), ==, 1); + g_assert_cmpint(fwrite(content, 512, 1, bootfile), ==, 1);fclose (bootfile); }
@@ -428,7 +429,7 @@ static int test_migrate_start(QTestState **from, QTestState **to, got_stop = false;if (strcmp (arch,"i386" ) ==0 ||strcmp (arch,"x86_64" ) ==0 ) { -init_bootfile_x86 (bootpath); +init_bootfile (bootpath, x86_bootsect); cmd_src =g_strdup_printf ("-machine accel=%s -m 150M" " -name source,debug-threads=on" " -serial file:%s/src_serial"
@@ -459,6 +460,24 @@ static int test_migrate_start(QTestState **from, QTestState **to, start_address =PPC_TEST_MEM_START ; end_address =PPC_TEST_MEM_END ; + }else if (strcmp (arch,"aarch64" ) ==0 ) { +init_bootfile (bootpath, aarch64_kernel); + cmd_src =g_strdup_printf ("-machine virt,accel=%s,gic-version=max " +"-name vmsource,debug-threads=on -cpu max " +"-m 150M -serial file:%s/src_serial " +"-kernel %s " , + accel, tmpfs, bootpath); + cmd_dst =g_strdup_printf ("-machine virt,accel=%s,gic-version=max " +"-name vmdest,debug-threads=on -cpu max " +"-m 150M -serial file:%s/dest_serial " +"-kernel %s " +"-incoming %s " , + accel, tmpfs, bootpath, uri); + + start_address =ARM_TEST_MEM_START ; + end_address =ARM_TEST_MEM_END ; + +g_assert (sizeof (aarch64_kernel) <=ARM_TEST_MAX_KERNEL_SIZE ); }else {g_assert_not_reached (); }
@@ -545,7 +564,7 @@ static void test_deprecated(void) {QTestState *from; - from =qtest_start ("" ); + from =qtest_start ("-machine none" );deprecated_set_downtime (from,0.12345 );deprecated_set_speed (from,12345 );
tests/migration/Makefile +1 -1
@@ -5,7 +5,7 @@ # See the COPYING file in the top-level directory. # -TARGET_LIST = i386 +TARGET_LIST = i386 aarch64 SRC_PATH = ../..
tests/migration/aarch64/Makefile new file +20 -0
@@ -0,0 +1,20 @@ +# To specify cross compiler prefix, use CROSS_PREFIX= +# $ make CROSS_PREFIX=aarch64-linux-gnu- + +.PHONY: all clean +all: a-b-kernel.h + +a-b-kernel.h: aarch64.kernel + echo "$$__note" > header.tmp + xxd -i $< | sed -e 's/.*int.*//' >> header.tmp + mv header.tmp $@ + +aarch64.kernel: aarch64.elf + $(CROSS_PREFIX)objcopy -O binary $< $@ + +aarch64.elf: a-b-kernel.S + $(CROSS_PREFIX)gcc -o $@ -nostdlib -Wl,--build-id=none $< + +clean: + @rm -rf *.kernel *.elf +
tests/migration/aarch64/a-b-kernel.S new file +75 -0
75 lines not on this page · raw message
tests/migration/aarch64/a-b-kernel.h new file +19 -0
@@ -0,0 +1,19 @@ +/* This file is automatically generated from the assembly file in +* tests/migration/aarch64. Edit that file and then run "make all" +* inside tests/migration to update, and then remember to send both +* the header and the assembler differences in your patch submission. +*/ +unsigned char aarch64_kernel[] = { +0x00 ,0x10 ,0x38 ,0xd5 ,0x00 ,0xf8 ,0x7f ,0x92 ,0x00 ,0x10 ,0x18 ,0xd5 , +0xdf ,0x3f ,0x03 ,0xd5 ,0x00 ,0x02 ,0xa8 ,0xd2 ,0x01 ,0xc8 ,0xa8 ,0xd2 , +0x23 ,0x08 ,0x80 ,0x52 ,0x02 ,0x20 ,0xa1 ,0xd2 ,0x43 ,0x00 ,0x00 ,0x39 , +0x03 ,0x00 ,0x80 ,0x52 ,0xe4 ,0x03 ,0x00 ,0xaa ,0x83 ,0x00 ,0x00 ,0x39 , +0x84 ,0x04 ,0x40 ,0x91 ,0x9f ,0x00 ,0x01 ,0xeb ,0xad ,0xff ,0xff ,0x54 , +0x05 ,0x00 ,0x80 ,0x52 ,0xe4 ,0x03 ,0x00 ,0xaa ,0x24 ,0x7e ,0x0b ,0xd5 , +0x83 ,0x00 ,0x40 ,0x39 ,0x63 ,0x04 ,0x00 ,0x11 ,0x63 ,0x1c ,0x00 ,0x12 , +0x83 ,0x00 ,0x00 ,0x39 ,0x84 ,0x04 ,0x40 ,0x91 ,0x9f ,0x00 ,0x01 ,0xeb , +0x2b ,0xff ,0xff ,0x54 ,0xa5 ,0x04 ,0x00 ,0x11 ,0xa5 ,0x1c ,0x00 ,0x12 , +0xbf ,0x00 ,0x00 ,0x71 ,0x81 ,0xfe ,0xff ,0x54 ,0x43 ,0x08 ,0x80 ,0x52 , +0x43 ,0x00 ,0x00 ,0x39 ,0xf1 ,0xff ,0xff ,0x17 +}; +
tests/migration/migration-test.h +9 -0
@@ -18,4 +18,13 @@#define PPC_TEST_MEM_START (1 * 1024 * 1024)#define PPC_TEST_MEM_END (100 * 1024 * 1024) +/* ARM */ +#define ARM_TEST_MEM_START (0x40000000 + 1 * 1024 * 1024) +#define ARM_TEST_MEM_END (0x40000000 + 100 * 1024 * 1024) +#define ARM_MACH_VIRT_UART 0x09000000 +/* AArch64 kernel load address is 0x40080000, and the test memory starts at +* 0x40100000. So the maximum allowable kernel size is 512KB. +*/ +#define ARM_TEST_MAX_KERNEL_SIZE (512 * 1024) +#endif /* _TEST_MIGRATION_H_ */
Signature · 1 line
2.17.1
[Qemu-devel] [PULL 12/12] tests/migration: Enable the migration test on s390x, too
In reply to Juan QuintelaFrom: Thomas Huth <[email protected]>
We can re-use the s390-ccw bios code to implement a small firmware for a s390x guest which prints out the "A" and "B" characters and modifies the memory, as required for the migration test.
Message-Id: <[email protected]>
---
- Updated to new cross compiler Makefile
- Rename s390x-a-b-elf to s390x-elf. This way it is consistent with than aarch64
- Change generated comment
--- tests/Makefile.include | 1 + tests/migration-test.c | 26 ++ tests/migration/Makefile | 2 +- tests/migration/migration-test.h | 4 + tests/migration/s390x/Makefile | 22 ++ tests/migration/s390x/a-b-bios.c | 35 +++ tests/migration/s390x/a-b-bios.h | 427 +++++++++++++++++++++++++++++++ 7 files changed, 516 insertions(+), 1 deletion(-) create mode 100644 tests/migration/s390x/Makefile create mode 100644 tests/migration/s390x/a-b-bios.c create mode 100644 tests/migration/s390x/a-b-bios.h
tests/Makefile.include +1 -0
@@ -404,6 +404,7 @@ check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) check-qtest-s390x-y += tests/drive_del-test$(EXESUF) check-qtest-s390x-y += tests/virtio-ccw-test$(EXESUF) check-qtest-s390x-y += tests/cpu-plug-test$(EXESUF) +check-qtest-s390x-y += tests/migration-test$(EXESUF) check-qtest-generic-y += tests/machine-none-test$(EXESUF) check-qtest-generic-y += tests/qom-test$(EXESUF)
tests/migration-test.c +26 -0
@@ -96,6 +96,18 @@ static void init_bootfile(const char *bootpath, void *content)fclose (bootfile); } +#include "tests/migration/s390x/a-b-bios.h" + +static void init_bootfile_s390x (const char *bootpath) +{ +FILE *bootfile =fopen (bootpath,"wb" ); +size_t len =sizeof (s390x_elf); + + g_assert_cmpint(fwrite(s390x_elf, len, 1, bootfile), ==, 1); +fclose (bootfile); +} + +/* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's
@@ -478,6 +490,20 @@ static int test_migrate_start(QTestState **from, QTestState **to, end_address =ARM_TEST_MEM_END ;g_assert (sizeof (aarch64_kernel) <=ARM_TEST_MAX_KERNEL_SIZE ); + }else if (g_str_equal (arch,"s390x" )) { +init_bootfile_s390x (bootpath); + cmd_src =g_strdup_printf ("-machine accel=%s -m 128M" +" -name source,debug-threads=on" +" -serial file:%s/src_serial -bios %s" , + accel, tmpfs, bootpath); + cmd_dst =g_strdup_printf ("-machine accel=%s -m 128M" +" -name target,debug-threads=on" +" -serial file:%s/dest_serial -bios %s" +" -incoming %s" , + accel, tmpfs, bootpath, uri); + + start_address =S390_TEST_MEM_START ; + end_address =S390_TEST_MEM_END ; }else {g_assert_not_reached (); }
tests/migration/Makefile +1 -1
@@ -5,7 +5,7 @@ # See the COPYING file in the top-level directory. # -TARGET_LIST = i386 aarch64 +TARGET_LIST = i386 aarch64 s390x SRC_PATH = ../..
tests/migration/migration-test.h +4 -0
@@ -27,4 +27,8 @@*/ #define ARM_TEST_MAX_KERNEL_SIZE (512 * 1024) +/* S390 */ +#define S390_TEST_MEM_START (1 * 1024 * 1024) +#define S390_TEST_MEM_END (100 * 1024 * 1024) +#endif /* _TEST_MIGRATION_H_ */
tests/migration/s390x/Makefile new file +22 -0
@@ -0,0 +1,22 @@ +# To specify cross compiler prefix, use CROSS_PREFIX= +# $ make CROSS_PREFIX=s390x-linux-gnu- + +.PHONY: all clean +all: a-b-bios.h +fwdir=../../../pc-bios/s390-ccw + +CFLAGS+=-ffreestanding -fno-delete-null-pointer-checks -fPIE -Os \ + -msoft-float -march=z900 -fno-asynchronous-unwind-tables -Wl,-pie \ + -Wl,--build-id=none -nostdlib + +a-b-bios.h: s390x.elf + echo "$$__note" > header.tmp + xxd -i $< | sed -e 's/.*int.*//' >> header.tmp + mv header.tmp $@ + +s390x.elf: a-b-bios.c + $(CROSS_PREFIX)gcc $(CFLAGS) -I$(fwdir) $(fwdir)/start.S \ + $(fwdir)/sclp.c -o $@ $< + +clean: + @rm -rf *.elf *.o
tests/migration/s390x/a-b-bios.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* S390 guest code used in migration tests +* +* Copyright 2018 Thomas Huth, Red Hat Inc. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ + +#define LOADPARM_LEN 8/* Needed for sclp.h */ + +#include <libc.h> +#include <sclp.h> + +char stack[0x8000] __attribute__((aligned(4096))); + +#define START_ADDRESS (1024 * 1024) +#define END_ADDRESS (100 * 1024 * 1024) + +void main (void ) +{ +unsigned long addr; + +sclp_setup (); +sclp_print ("A" ); + +while (1 ) { +for (addr =START_ADDRESS ; addr <END_ADDRESS ; addr +=4096 ) { + *(volatile char *)addr +=1 ;/* Change pages */ + } +sclp_print ("B" ); + } +}
tests/migration/s390x/a-b-bios.h new file +427 -0
427 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PULL 12/12] tests/migration: Enable the migration test on s390x, too
Quoted 128 lines · Juan Quintela
From: Thomas Huth <[email protected]>
We can re-use the s390-ccw bios code to implement a small firmware for a s390x guest which prints out the "A" and "B" characters and modifies the memory, as required for the migration test.
Signed-off-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
Reviewed-by Juan Quintela <[email protected]>Acked-by Cornelia Huck <[email protected]>Signed-off-by Juan Quintela <[email protected]>---
- Updated to new cross compiler
Makefile
- Rename s390x-a-b-elf to s390x-elf. This way it is consistent with than aarch64
- Change generated comment--- tests/Makefile.include | 1 + tests/migration-test.c | 26 ++ tests/migration/Makefile | 2 +- tests/migration/migration-test.h | 4 + tests/migration/s390x/Makefile | 22 ++ tests/migration/s390x/a-b-bios.c | 35 +++ tests/migration/s390x/a-b-bios.h | 427 +++++++++++++++++++++++++++++++ 7 files changed, 516 insertions(+), 1 deletion(-) create mode 100644 tests/migration/s390x/Makefile create mode 100644 tests/migration/s390x/a-b-bios.c create mode 100644 tests/migration/s390x/a-b-bios.htests/Makefile.include +1
-0@@ -404,6 +404,7 @@ check-qtest-s390x-$(CONFIG_POSIX) += tests/test-filter-redirector$(EXESUF) check-qtest-s390x-y += tests/drive_del-test$(EXESUF) check-qtest-s390x-y += tests/virtio-ccw-test$(EXESUF) check-qtest-s390x-y += tests/cpu-plug-test$(EXESUF) +check-qtest-s390x-y += tests/migration-test$(EXESUF) check-qtest-generic-y += tests/machine-none-test$(EXESUF) check-qtest-generic-y += tests/qom-test$(EXESUF)tests/migration-test.c +26
-0@@ -96,6 +96,18 @@ static void init_bootfile(const char *bootpath, void *content)fclose (bootfile); } +#include "tests/migration/s390x/a-b-bios.h" + +static void init_bootfile_s390x (const char *bootpath) +{ +FILE *bootfile =fopen (bootpath,"wb" ); +size_t len =sizeof (s390x_elf); + + g_assert_cmpint(fwrite(s390x_elf, len, 1, bootfile), ==, 1); +fclose (bootfile); +} + +/* * Wait for some output in the serial output file, * we get an 'A' followed by an endless string of 'B's @@ -478,6 +490,20 @@ static int test_migrate_start(QTestState **from, QTestState **to, end_address =ARM_TEST_MEM_END ;g_assert (sizeof (aarch64_kernel) <=ARM_TEST_MAX_KERNEL_SIZE ); + }else if (g_str_equal (arch,"s390x" )) { +init_bootfile_s390x (bootpath); + cmd_src =g_strdup_printf ("-machine accel=%s -m 128M" +" -name source,debug-threads=on" +" -serial file:%s/src_serial -bios %s" , + accel, tmpfs, bootpath); + cmd_dst =g_strdup_printf ("-machine accel=%s -m 128M" +" -name target,debug-threads=on" +" -serial file:%s/dest_serial -bios %s" +" -incoming %s" , + accel, tmpfs, bootpath, uri); + + start_address =S390_TEST_MEM_START ; + end_address =S390_TEST_MEM_END ; }else {g_assert_not_reached (); }tests/migration/Makefile +1
-1@@ -5,7 +5,7 @@ # See the COPYING file in the top-level directory. # -TARGET_LIST = i386 aarch64 +TARGET_LIST = i386 aarch64 s390x SRC_PATH = ../..tests/migration/migration-test.h +4
-0@@ -27,4 +27,8 @@*/ #define ARM_TEST_MAX_KERNEL_SIZE (512 * 1024) +/* S390 */ +#define S390_TEST_MEM_START (1 * 1024 * 1024) +#define S390_TEST_MEM_END (100 * 1024 * 1024) +#endif /* _TEST_MIGRATION_H_ */ tests/migration/s390x/Makefile new file +9
-0@@ -0,0 +1,22 @@ +# To specify cross compiler prefix, use CROSS_PREFIX= +# $ make CROSS_PREFIX=s390x-linux-gnu- + +.PHONY: all clean +all: a-b-bios.h +fwdir=../../../pc-bios/s390-ccw + +CFLAGS+=-ffreestanding -fno-delete-null-pointer-checks -fPIE -Os \ + -msoft-float -march=z900 -fno-asynchronous-unwind-tables -Wl,-pie \
tests/migration/s390x/Makefile line 19
Quoted 10 lines
tests/migration/s390x/Makefile new file +10
-0+ -Wl,--build-id=none -nostdlib + +a-b-bios.h: s390x.elf + echo "$$__note" > header.tmp + xxd -i $< | sed -e 's/.*int.*//' >> header.tmp + mv header.tmp $@ + +s390x.elf: a-b-bios.c + $(CROSS_PREFIX)gcc $(CFLAGS) -I$(fwdir) $(fwdir)/start.S \ + $(fwdir)/sclp.c -o $@ $<
Your modifications look basically fine to me, but please also strip the binary after compiling it, so that the header will be quite a bit smaller.
Thanks,
Thomas
Re: [Qemu-devel] [PULL 12/12] tests/migration: Enable the migration test on s390x, too
Quoted 14 lines · Thomas Huth
Quoted 12 lines · Juan Quintela
From: Thomas Huth <[email protected]>
We can re-use the s390-ccw bios code to implement a small firmware for a s390x guest which prints out the "A" and "B" characters and modifies the memory, as required for the migration test.
Signed-off-by Thomas Huth <[email protected]>Message-Id: <[email protected]>
Reviewed-by Juan Quintela <[email protected]>Acked-by Cornelia Huck <[email protected]>Signed-off-by Juan Quintela <[email protected]>
Quoted 11 lines
tests/migration/s390x/Makefile line 19
Quoted 8 lines
tests/migration/s390x/Makefile new file +8
-0+a-b-bios.h: s390x.elf + echo "$$__note" > header.tmp + xxd -i $< | sed -e 's/.*int.*//' >> header.tmp + mv header.tmp $@ + +s390x.elf: a-b-bios.c + $(CROSS_PREFIX)gcc $(CFLAGS) -I$(fwdir) $(fwdir)/start.S \ + $(fwdir)/sclp.c -o $@ $<Your modifications look basically fine to me, but please also strip the binary after compiling it, so that the header will be quite a bit smaller.
Oops, had it on the s390 and forgot to include it:
$(CROSS_PREFIX)strip --strip-unneded $@
Now sizes are similar.
Thanks, Juan.