[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/35] spapr: implement H_SET_MODE debug facilities
From: |
Cédric Le Goater |
Subject: |
[PULL 08/35] spapr: implement H_SET_MODE debug facilities |
Date: |
Mon, 4 Sep 2023 11:06:03 +0200 |
From: Nicholas Piggin <npiggin@gmail.com>
Wire up the H_SET_MODE debug resources to the CIABR and DAWR0 debug
facilities in TCG.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/spapr_hcall.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 9b1f225d4a5d..b7dc388f2fc9 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -3,6 +3,7 @@
#include "qapi/error.h"
#include "sysemu/hw_accel.h"
#include "sysemu/runstate.h"
+#include "sysemu/tcg.h"
#include "qemu/log.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
@@ -789,6 +790,54 @@ static target_ulong h_logical_dcbf(PowerPCCPU *cpu,
SpaprMachineState *spapr,
return H_SUCCESS;
}
+static target_ulong h_set_mode_resource_set_ciabr(PowerPCCPU *cpu,
+ SpaprMachineState *spapr,
+ target_ulong mflags,
+ target_ulong value1,
+ target_ulong value2)
+{
+ CPUPPCState *env = &cpu->env;
+
+ assert(tcg_enabled()); /* KVM will have handled this */
+
+ if (mflags) {
+ return H_UNSUPPORTED_FLAG;
+ }
+ if (value2) {
+ return H_P4;
+ }
+ if ((value1 & PPC_BITMASK(62, 63)) == 0x3) {
+ return H_P3;
+ }
+
+ ppc_store_ciabr(env, value1);
+
+ return H_SUCCESS;
+}
+
+static target_ulong h_set_mode_resource_set_dawr0(PowerPCCPU *cpu,
+ SpaprMachineState *spapr,
+ target_ulong mflags,
+ target_ulong value1,
+ target_ulong value2)
+{
+ CPUPPCState *env = &cpu->env;
+
+ assert(tcg_enabled()); /* KVM will have handled this */
+
+ if (mflags) {
+ return H_UNSUPPORTED_FLAG;
+ }
+ if (value2 & PPC_BIT(61)) {
+ return H_P4;
+ }
+
+ ppc_store_dawr0(env, value1);
+ ppc_store_dawrx0(env, value2);
+
+ return H_SUCCESS;
+}
+
static target_ulong h_set_mode_resource_le(PowerPCCPU *cpu,
SpaprMachineState *spapr,
target_ulong mflags,
@@ -858,6 +907,14 @@ static target_ulong h_set_mode(PowerPCCPU *cpu,
SpaprMachineState *spapr,
target_ulong ret = H_P2;
switch (resource) {
+ case H_SET_MODE_RESOURCE_SET_CIABR:
+ ret = h_set_mode_resource_set_ciabr(cpu, spapr, args[0], args[2],
+ args[3]);
+ break;
+ case H_SET_MODE_RESOURCE_SET_DAWR0:
+ ret = h_set_mode_resource_set_dawr0(cpu, spapr, args[0], args[2],
+ args[3]);
+ break;
case H_SET_MODE_RESOURCE_LE:
ret = h_set_mode_resource_le(cpu, spapr, args[0], args[2], args[3]);
break;
--
2.41.0
- [PULL 00/35] ppc queue, Cédric Le Goater, 2023/09/04
- [PULL 02/35] ppc: Add stub implementation of TRIG SPRs, Cédric Le Goater, 2023/09/04
- [PULL 03/35] target/ppc: Remove single-step suppression inside 0x100-0xf00, Cédric Le Goater, 2023/09/04
- [PULL 06/35] target/ppc: Implement breakpoint debug facility for v2.07S, Cédric Le Goater, 2023/09/04
- [PULL 01/35] target/ppc: Generate storage interrupts for radix RC changes, Cédric Le Goater, 2023/09/04
- [PULL 05/35] target/ppc: Suppress single step interrupts on rfi-type instructions, Cédric Le Goater, 2023/09/04
- [PULL 04/35] target/ppc: Improve book3s branch trace interrupt for v2.07S, Cédric Le Goater, 2023/09/04
- [PULL 07/35] target/ppc: Implement watchpoint debug facility for v2.07S, Cédric Le Goater, 2023/09/04
- [PULL 08/35] spapr: implement H_SET_MODE debug facilities,
Cédric Le Goater <=
- [PULL 09/35] ppc/vhyp: reset exception state when handling vhyp hcall, Cédric Le Goater, 2023/09/04
- [PULL 10/35] ppc/vof: Fix missed fields in VOF cleanup, Cédric Le Goater, 2023/09/04
- [PULL 11/35] hw/ppc/ppc.c: Tidy over-long lines, Cédric Le Goater, 2023/09/04
- [PULL 12/35] hw/ppc: Introduce functions for conversion between timebase and nanoseconds, Cédric Le Goater, 2023/09/04
- [PULL 13/35] host-utils: Add muldiv64_round_up, Cédric Le Goater, 2023/09/04
- [PULL 14/35] hw/ppc: Round up the decrementer interval when converting to ns, Cédric Le Goater, 2023/09/04
- [PULL 15/35] hw/ppc: Avoid decrementer rounding errors, Cédric Le Goater, 2023/09/04
- [PULL 16/35] target/ppc: Sign-extend large decrementer to 64-bits, Cédric Le Goater, 2023/09/04
- [PULL 17/35] hw/ppc: Always store the decrementer value, Cédric Le Goater, 2023/09/04
- [PULL 18/35] target/ppc: Migrate DECR SPR, Cédric Le Goater, 2023/09/04