-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Thomas Huth <[email protected]> Message-Id: <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Dr. David Alan Gilbert <[email protected]> Fixed up Makefile since the aarch patch sneaked in first
- Loading branch information
Showing
7 changed files
with
343 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 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 $@ | ||
|
||
# We use common-page-size=16 to avoid big padding in the ELF file | ||
s390x.elf: a-b-bios.c | ||
$(CROSS_PREFIX)gcc $(CFLAGS) -I$(fwdir) $(fwdir)/start.S \ | ||
$(fwdir)/sclp.c -Wl,-zcommon-page-size=16 -o $@ $< | ||
$(CROSS_PREFIX)strip $@ | ||
|
||
clean: | ||
@rm -rf *.elf *.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
} |
Oops, something went wrong.