KVM: ARM: VFP userspace interface.

We use space #18 for floating point regs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/testing/selftests/kvm/arm: Import mmiotest from github.
tools/testing/selftests/kvm/arm: update test code to use kvm_vcpu_init.

We need to call KVM_ARM_VCPU_INIT now.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: add to selftests makefile

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: Generalize for different tests.

So we can have other ones than mmio.  The command line is now the name
of the test (ie. 'mmio').

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: Use err() and errx()

This is more convenient than perror and return.  We use exit status 2 if
something went wrong with setting up the test and 1 if it failed.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: Use C code in the tiny guest.

The asm stub just sets up a stack and we jump to 'test'.  We also use
change the mmio so we have well-defined 'fail', 'success' and 'putc'
mmio addresses: everything else gets handed to that test's specific
handler.

We have print() and assert() helpers in guest.h.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: Load an elf guest.

I stole this from my lguest elf-loading code.  It's still small, but
it means we can have a separate section for an exception table (for
cp15 testing) for example.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: Add install target.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: vfp test.

We just check the fp state is as expected, and then we make sure that
the guest and host are seeing independent fp registers.

As expected, this fails without the VFP support patches, and passes
afterwards!

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: conditional exectution test.

This tests conditional stores, which are allowed to trap even if they
wouldn't be executed.  I couldn't get the thumb code to assemble, but
I want to test that too.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
tools/testing/selftests/kvm/arm: add exception table to guest.

A global skip_undef flag lets us ignore undefined faults, for testing,
others just print a message and exit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/testing/selftests/kvm/arm: cp15 test.

This currently tests our CP15 regs are what we expect (unfinished).

I need to also check save/restore of CP15 regs.
Update Makefile header

Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
KVM: ARM: test: MMIO nits

Expand the IO data region size and export pointer.

Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
KVM: ARM: Change license on selftest

Change to GPL v2 license.

Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
tools/testing/selftests/kvm/arm: add API tests to cp15.

From: Rusty Russell <rusty.russell@linaro.org>

This tests that save and restore ioctls agree with what the guest
sees.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
kvmtest: update for new API.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
kvmtest: handle core registers.

Add tests for core registers, now available via GET_ONE_REG.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
kvmtest: check demuxed cache registers.

Sanity checks for cache registers.

Signed-off-by: Rusty Russell <rusty.russell@linaro.org>