[kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c | 84 +

[kvm-unit-tests PATCH 04/14] powerpc/ppc64: start skeleton framework

2015-08-03 Thread Andrew Jones
Use the arm/arm64 framework as a template to start a skeleton for powerpc/ppc64. Copy the arm makefiles and linker script verbatim. We'll modify them for powerpc with the next patch, making it clear what needs to be changed. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure

[kvm-unit-tests PATCH 05/14] powerpc/pp64: ppc-ify makefiles and linker script

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/Makefile.common | 44 +--- powerpc/Makefile.ppc64 | 16 powerpc/flat.lds| 14 ++ 3 files changed, 31 insertions(+), 43 deletions(-) diff --git

[kvm-unit-tests PATCH 07/14] powerpc/ppc64: add bootloader to bounce into memory

2015-08-03 Thread Andrew Jones
Committing the binary, since there's little point in rebuilding, and it requires SLOF's build_romfs tool, which is not part of this source repository. Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/boot_rom.bin | Bin 0 - 280 bytes 1 file changed, 0 insertions(+), 0 deletions(-)

[kvm-unit-tests PATCH 02/14] lib: share arm-selftest utility functions

2015-08-03 Thread Andrew Jones
arm-selftest has a couple utility functions that could be useful to other unit tests, even other architectures. So move them out. split_var moves to lib/util, where we can add other random utilities over time. assert_args inspires report_abort, which allows us to report a message, using the

[kvm-unit-tests PATCH 14/14] mkstandalone: add support for powerpc

2015-08-03 Thread Andrew Jones
PowerPC needs firmware and an exit code snooper. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 3 +++ powerpc/run | 2 +- scripts/mkstandalone.sh | 50 + 3 files changed, 50 insertions(+), 5 deletions(-)

[kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread Andrew Jones
QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones drjo...@redhat.com --- configure | 2 ++

[kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Andrew Jones
This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK, moving on...) This series brings basic setup;

[kvm-unit-tests PATCH 01/14] lib: asm-generic: add missing casts

2015-08-03 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/io.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index a9939d3a5921f..abd245676e97a 100644 --- a/lib/asm-generic/io.h +++ b/lib/asm-generic/io.h @@

[kvm-unit-tests PATCH 13/14] powerpc/ppc64: add run script and unittests.cfg

2015-08-03 Thread Andrew Jones
Now that we have all the pieces, pull them together into the run script. To run a test do ./powerpc-run powerpc/test.elf To run all tests in unittests.cfg do ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com --- powerpc/run | 57

[kvm-unit-tests PATCH 06/14] powerpc/ppc64: add boot rom source

2015-08-03 Thread Andrew Jones
Make a one line replacement for SLOF. This bootloader just jumps to 0x40, because we know the kernel will be there. This commit allows rebuilding of the bootloader, as long as the SLOF build_romfs tool is present, but since it would be a pain to require that tool for ever build, we'll just

[kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread Andrew Jones
Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios powerpc/boot_rom.bin \ -display none -serial stdio \

[kvm-unit-tests PATCH 03/14] config: no need to mix arch makefiles

2015-08-03 Thread Andrew Jones
Move the config/config-*.mak files to their own directories and rename to Makefile.* README is also updated to reflect the change, as well as to remove an optimistic reference to a non-existent docs directory. Signed-off-by: Andrew Jones drjo...@redhat.com --- Makefile

[kvm-unit-tests PATCH 09/14] powerpc/ppc64: adapt arm's setup

2015-08-03 Thread Andrew Jones
Copy arm's setup code (also DT based) over to powerpc, adapting it a bit. Also bring over arm's setup selftest, giving powerpc its first test. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/setup.h | 27 lib/powerpc/setup.c | 82

[kvm-unit-tests PATCH 12/14] scripts: add exit code snooper

2015-08-03 Thread Andrew Jones
Add a function that reads test output streams and just forwards it on to stdout, except when a line is 'EXIT: STATUS=%d', at which point it grabs the status to use as the exit code. Tests that always exit with zero (due to how they inform QEMU to quit), can now return other status codes. Run with

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Alexander Graf
On 03.08.15 19:02, Andrew Jones wrote: On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio +

Re: [kvm-unit-tests PATCH 10/14] powerpc/ppc64: relocate linker VMAs

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:27PM +0200, Andrew Jones wrote: QEMU loads the unit test, but due to the way it translates the unit test's linker VMA to the LMA, we can't just link such that VMA == LMA. Thus, we link with VMA == 0x0, and then deal with relocation. Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:28PM +0200, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/powerpc/asm/rtas.h | 27 lib/powerpc/io.c| 3 ++ lib/powerpc/rtas.c |

Re: [kvm-unit-tests PATCH 08/14] powerpc/ppc64: add HV putchar

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 04:41:25PM +0200, Andrew Jones wrote: Add the hvcall for putchar and use it in puts. That, along with a couple more lines in start to prepare for C code, and a branch to main(), gets us hello world. Run with qemu-system-ppc64 -M pseries\ -bios

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread David Gibson
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar to how we're not using PSCI on ARM or ACPI on x86. Paolo -- To

Re: [kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-08-03 Thread Paolo Bonzini
On 03/08/2015 16:41, Andrew Jones wrote: This series is the first series of a series of series that will bring support to kvm-unit-tests for ppc64, and eventually ppc64le. (Yes, the word 'series' is four times in that sentence. And now I've typed 'series' five times! Wait, now six times! OK,

Re: [kvm-unit-tests PATCH 11/14] powerpc/ppc64: add rtas_power_off

2015-08-03 Thread Andrew Jones
On Mon, Aug 03, 2015 at 07:08:17PM +0200, Paolo Bonzini wrote: On 03/08/2015 16:41, Andrew Jones wrote: Add enough RTAS support to support power-off, and apply it to exit(). Signed-off-by: Andrew Jones drjo...@redhat.com Why not use virtio-mmio + testdev on ppc as well? Similar