[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/34] target/ppc: Clarify the meaning of return values in kvm_han
From: |
David Gibson |
Subject: |
[PULL 05/34] target/ppc: Clarify the meaning of return values in kvm_handle_debug |
Date: |
Fri, 31 Jan 2020 17:08:55 +1100 |
From: Fabiano Rosas <address@hidden>
The kvm_handle_debug function can return 0 to go back into the guest
or return 1 to notify the gdbstub thread and pass control to GDB.
Signed-off-by: Fabiano Rosas <address@hidden>
Message-Id: <address@hidden>
Tested-by: Leonardo Bras <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/kvm.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 06fd0cc162..c05dde5985 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -53,6 +53,9 @@
#define PROC_DEVTREE_CPU "/proc/device-tree/cpus/"
+#define DEBUG_RETURN_GUEST 0
+#define DEBUG_RETURN_GDB 1
+
const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
KVM_CAP_LAST_INFO
};
@@ -1564,7 +1567,7 @@ void kvm_arch_update_guest_debug(CPUState *cs, struct
kvm_guest_debug *dbg)
static int kvm_handle_hw_breakpoint(CPUState *cs,
struct kvm_debug_exit_arch *arch_info)
{
- int handle = 0;
+ int handle = DEBUG_RETURN_GUEST;
int n;
int flag = 0;
@@ -1572,13 +1575,13 @@ static int kvm_handle_hw_breakpoint(CPUState *cs,
if (arch_info->status & KVMPPC_DEBUG_BREAKPOINT) {
n = find_hw_breakpoint(arch_info->address, GDB_BREAKPOINT_HW);
if (n >= 0) {
- handle = 1;
+ handle = DEBUG_RETURN_GDB;
}
} else if (arch_info->status & (KVMPPC_DEBUG_WATCH_READ |
KVMPPC_DEBUG_WATCH_WRITE)) {
n = find_hw_watchpoint(arch_info->address, &flag);
if (n >= 0) {
- handle = 1;
+ handle = DEBUG_RETURN_GDB;
cs->watchpoint_hit = &hw_watchpoint;
hw_watchpoint.vaddr = hw_debug_points[n].addr;
hw_watchpoint.flags = flag;
@@ -1590,12 +1593,12 @@ static int kvm_handle_hw_breakpoint(CPUState *cs,
static int kvm_handle_singlestep(void)
{
- return 1;
+ return DEBUG_RETURN_GDB;
}
static int kvm_handle_sw_breakpoint(void)
{
- return 1;
+ return DEBUG_RETURN_GDB;
}
static int kvm_handle_debug(PowerPCCPU *cpu, struct kvm_run *run)
@@ -1647,7 +1650,7 @@ static int kvm_handle_debug(PowerPCCPU *cpu, struct
kvm_run *run)
env->error_code = POWERPC_EXCP_INVAL;
ppc_cpu_do_interrupt(cs);
- return 0;
+ return DEBUG_RETURN_GUEST;
}
int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
--
2.24.1
- [PULL 00/34] ppc-for-5.0 queue 20200131, David Gibson, 2020/01/31
- [PULL 03/34] ppc:virtex_ml507: remove unused arguments, David Gibson, 2020/01/31
- [PULL 02/34] ppc/pnv: improve error logging when a PNOR update fails, David Gibson, 2020/01/31
- [PULL 10/34] ppc/pnv: Add support for HRMOR on Radix host, David Gibson, 2020/01/31
- [PULL 01/34] ppc/pnv: use QEMU unit definition MiB, David Gibson, 2020/01/31
- [PULL 05/34] target/ppc: Clarify the meaning of return values in kvm_handle_debug,
David Gibson <=
- [PULL 06/34] spapr: Fail CAS if option vector table cannot be parsed, David Gibson, 2020/01/31
- [PULL 11/34] ppc/pnv: remove useless "core-pir" property alias., David Gibson, 2020/01/31
- [PULL 12/34] ppc/pnv: Add support for "hostboot" mode, David Gibson, 2020/01/31
- [PULL 16/34] tpm_spapr: Support suspend and resume, David Gibson, 2020/01/31
- [PULL 09/34] spapr: Don't allow multiple active vCPUs at CAS, David Gibson, 2020/01/31
- [PULL 08/34] target/ppc: add support for Hypervisor Facility Unavailable Exception, David Gibson, 2020/01/31
- [PULL 13/34] tpm: Move tpm_tis_show_buffer to tpm_util.c, David Gibson, 2020/01/31
- [PULL 15/34] tpm_spapr: Support TPM for ppc64 using CRQ based interface, David Gibson, 2020/01/31
- [PULL 07/34] target/ppc: Add privileged message send facilities, David Gibson, 2020/01/31
- [PULL 22/34] spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine, David Gibson, 2020/01/31