summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSam bobroff2014-06-25 05:54:30 +0200
committerAlexander Graf2014-06-27 13:48:25 +0200
commit3052d9519000739ec25224ed1ca7498b7ff66d77 (patch)
tree2a3078c89a60e446a34e7183f6e51a739b35472c /include
parentspapr: Add rtas_st_buffer utility function (diff)
downloadqemu-3052d9519000739ec25224ed1ca7498b7ff66d77.tar.gz
qemu-3052d9519000739ec25224ed1ca7498b7ff66d77.tar.xz
qemu-3052d9519000739ec25224ed1ca7498b7ff66d77.zip
spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE
This allows the ibm,get-system-parameter RTAS call to succeed for the DIAGNOSTICS_RUN_MODE system parameter. The problem can be seen with "ppc64_cpu --run-mode" from the powerpc-utils package which fails before this patch with "Machine does not support diagnostic run mode". This is corrected by using the rtas_st_buffer() function to write to the buffer. The RTAS constants are also moved out into a header file, some new constants added and the surrounding code slightly simplified. Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com> [agraf: remove some commentary] Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/hw/ppc/spapr.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 25ca87f244..d043771616 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -397,6 +397,17 @@ static inline int spapr_allocate_lsi(int hint)
#define RTAS_TOKEN_MAX (RTAS_TOKEN_BASE + 0x21)
+/* RTAS ibm,get-system-parameter token values */
+#define RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE 42
+
+/* Possible values for the platform-processor-diagnostics-run-mode parameter
+ * of the RTAS ibm,get-system-parameter call.
+ */
+#define DIAGNOSTICS_RUN_MODE_DISABLED 0
+#define DIAGNOSTICS_RUN_MODE_STAGGERED 1
+#define DIAGNOSTICS_RUN_MODE_IMMEDIATE 2
+#define DIAGNOSTICS_RUN_MODE_PERIODIC 3
+
static inline uint64_t ppc64_phys_to_real(uint64_t addr)
{
return addr & ~0xF000000000000000ULL;