[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/32] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 21/32] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE |
Date: |
Fri, 27 Jun 2014 13:52:13 +0200 |
From: Sam bobroff <address@hidden>
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 <address@hidden>
[agraf: remove some commentary]
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr_rtas.c | 18 +++++++++---------
include/hw/ppc/spapr.h | 11 +++++++++++
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index 4e87d02..ac9a860 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -222,8 +222,6 @@ static void rtas_stop_self(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
env->msr = 0;
}
-#define DIAGNOSTICS_RUN_MODE 42
-
static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
@@ -233,16 +231,18 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
target_ulong parameter = rtas_ld(args, 0);
target_ulong buffer = rtas_ld(args, 1);
target_ulong length = rtas_ld(args, 2);
- target_ulong ret = RTAS_OUT_NOT_SUPPORTED;
+ target_ulong ret = RTAS_OUT_SUCCESS;
switch (parameter) {
- case DIAGNOSTICS_RUN_MODE:
- if (length == 1) {
- rtas_st(buffer, 0, 0);
- ret = RTAS_OUT_SUCCESS;
- }
+ case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: {
+ uint8_t param_val = DIAGNOSTICS_RUN_MODE_DISABLED;
+
+ rtas_st_buffer(buffer, length, ¶m_val, sizeof(param_val));
break;
}
+ default:
+ ret = RTAS_OUT_NOT_SUPPORTED;
+ }
rtas_st(rets, 0, ret);
}
@@ -257,7 +257,7 @@ static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu,
target_ulong ret = RTAS_OUT_NOT_SUPPORTED;
switch (parameter) {
- case DIAGNOSTICS_RUN_MODE:
+ case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE:
ret = RTAS_OUT_NOT_AUTHORIZED;
break;
}
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 25ca87f..d043771 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;
--
1.8.1.4
- [Qemu-devel] [PULL 04/32] linux-user: Support HWCAP2 in PowerPC, (continued)
- [Qemu-devel] [PULL 04/32] linux-user: Support HWCAP2 in PowerPC, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 08/32] spapr: Fix RTAS token numbers, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 07/32] PPC: Add support for Apple gdb in gdbstub, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 15/32] mac99: Add motherboard devices before PCI cards, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 22/32] spapr: Add RTAS sysparm UUID, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 19/32] spapr: Define a 2.1 pseries machine, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 10/32] vfio: Add vfio_container_ioctl(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 25/32] xics: Add xics_find_source(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 29/32] xics: Implement xics_ics_free(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 32/32] PPC: e500: Only create dt entries for existing serial ports, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 21/32] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE,
Alexander Graf <=
- [Qemu-devel] [PULL 24/32] xics: Add flags for interrupts, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 26/32] xics: Disable flags reset on xics reset, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 16/32] uninorth: Fix PCI hole size, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 06/32] target-ppc: fixed translation of mcrxr instruction, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 28/32] spapr: Remove @next_irq, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 20/32] spapr: Add rtas_st_buffer utility function, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 27/32] spapr: Move interrupt allocator to xics, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 30/32] vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 23/32] spapr: Add RTAS sysparm SPLPAR Characteristics, Alexander Graf, 2014/06/27