summaryrefslogtreecommitdiffstats
path: root/include/hw/ppc/spapr.h
diff options
context:
space:
mode:
authorAlexey Kardashevskiy2014-03-07 05:37:40 +0100
committerAndreas Färber2014-03-20 02:39:33 +0100
commita46622fd07edc6fd3c66f8ab79b4782a78b115f3 (patch)
tree1dd241ce1d0f1deaba63d297ce960fc95a3a4c40 /include/hw/ppc/spapr.h
parenttarget-ppc: Introduce powerisa-207-server flag (diff)
downloadqemu-a46622fd07edc6fd3c66f8ab79b4782a78b115f3.tar.gz
qemu-a46622fd07edc6fd3c66f8ab79b4782a78b115f3.tar.xz
qemu-a46622fd07edc6fd3c66f8ab79b4782a78b115f3.zip
spapr_hcall: Fix little-endian resource handling in H_SET_MODE
This changes resource code definitions to ones used in the host kernel. This fixes H_SET_MODE_RESOURCE_LE (switch between big endian and little endian) to sync registers from KVM before changing LPCR value. This adds a set_spr() helper to update an SPR in a CPU's context to avoid possible races and makes use of it to change LPCR. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/hw/ppc/spapr.h')
-rw-r--r--include/hw/ppc/spapr.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 449fc7ca2d..5fdac1e009 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -153,8 +153,13 @@ typedef struct sPAPREnvironment {
#define H_PP1 (1ULL<<(63-62))
#define H_PP2 (1ULL<<(63-63))
-/* H_SET_MODE flags */
-#define H_SET_MODE_ENDIAN 4
+/* Values for 2nd argument to H_SET_MODE */
+#define H_SET_MODE_RESOURCE_SET_CIABR 1
+#define H_SET_MODE_RESOURCE_SET_DAWR 2
+#define H_SET_MODE_RESOURCE_ADDR_TRANS_MODE 3
+#define H_SET_MODE_RESOURCE_LE 4
+
+/* Flags for H_SET_MODE_RESOURCE_LE */
#define H_SET_MODE_ENDIAN_BIG 0
#define H_SET_MODE_ENDIAN_LITTLE 1