target-arm/cpu.c: arm_cpu_reset don't poke pstate/cpsr directly (BREAKS)

Instead we work our way through the various flags needing setting and
use the restore_state_from_spsr() function to set everything up.

HOWEVER BREAKS: due to not filling the "other" uncached_cpsr
ALSO: qemu-system-arm dies as restore_state_from_spsr -> cpsr_write
which barfs on uninitialised mode.

---
 fixes:
  - fix inital spsr usage in USER
target-arm: unify env->uncached_cpsr & env->pstate (BREAKS)

This unifies everything. But we break currently for aarch32 uspace we
rely on env->uncached_cpsr being ARM_CPU_MODE_SVC when we do an
exception_return to correctly handle the unbanking.
target-arm/kvm.c: better error reporting

When we have a problem syncing CP registers between kvm<->qemu it's a
lot more useful to have the names of the registers in the log than just
a random abort() and core dump.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
  - less verbose log message
  - fix checkpatch warnings
target-arm/kvm: make reg sync code common between kvm32/64

Before we launch a guest we query KVM for the list of "co-processor"
registers it knows about which is used later for save/restore of machine
state. The logic is identical for both 32-bit and 64-bit so I've moved
it all into the common code and simplified the exit paths (as failure =>
exit).

This list may well have more registers than are known by the TCG
emulation which is not necessarily a problem but it does stop us from
migrating between KVM and TCG hosted guests. I've added some additional
checking to report those registers under -d unimp.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
target-arm: Support save/load for 64 bit CPUs

This enables the saving and restoring of machine state by including the
current program state (*psr) and xregs. The save_state_to_spsr hides the
details of if the processor is in 32 or 64 bit mode at the time.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---

v2 (ajb)
  - use common state save functions
  - re-base to latest origin/master
  - clean up commented out code

v3:
  - rename state from cpsr to psr in field description
target-arm: kvm: save/restore mp state

This adds the saving and restore of the current Multi-Processing state
of the machine. While the KVM_GET/SET_MP_STATE API exposes a number of
potential states for x86 we only use two for ARM. Either the process is
running or not.

---

TODO:
  - don't break TCG..