mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
tests/migration: Enable the migration test on s390x, too
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. [quintela: Converted the compile script to Makefile rules] Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1539078677-25396-1-git-send-email-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Fixed up Makefile since the aarch patch sneaked in first
This commit is contained in:
parent
c02b37814c
commit
5571dc824b
7 changed files with 343 additions and 1 deletions
36
tests/migration/s390x/a-b-bios.c
Normal file
36
tests/migration/s390x/a-b-bios.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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 <s390-ccw.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");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue