Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / accel / hvf / hvf-all.c
blob6ca0850b20ed0955ce08e316efa49a512af0b060
1 /*
2 * QEMU Hypervisor.framework support
4 * This work is licensed under the terms of the GNU GPL, version 2. See
5 * the COPYING file in the top-level directory.
7 * Contributions after 2012-01-13 are licensed under the terms of the
8 * GNU GPL, version 2 or (at your option) any later version.
9 */
11 #include "qemu/osdep.h"
12 #include "qemu/error-report.h"
13 #include "sysemu/hvf.h"
14 #include "sysemu/hvf_int.h"
16 const char *hvf_return_string(hv_return_t ret)
18 switch (ret) {
19 case HV_SUCCESS: return "HV_SUCCESS";
20 case HV_ERROR: return "HV_ERROR";
21 case HV_BUSY: return "HV_BUSY";
22 case HV_BAD_ARGUMENT: return "HV_BAD_ARGUMENT";
23 case HV_NO_RESOURCES: return "HV_NO_RESOURCES";
24 case HV_NO_DEVICE: return "HV_NO_DEVICE";
25 case HV_UNSUPPORTED: return "HV_UNSUPPORTED";
26 case HV_DENIED: return "HV_DENIED";
27 default: return "[unknown hv_return value]";
31 void assert_hvf_ok_impl(hv_return_t ret, const char *file, unsigned int line,
32 const char *exp)
34 if (ret == HV_SUCCESS) {
35 return;
38 error_report("Error: %s = %s (0x%x, at %s:%u)",
39 exp, hvf_return_string(ret), ret, file, line);
41 abort();
44 struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, vaddr pc)
46 struct hvf_sw_breakpoint *bp;
48 QTAILQ_FOREACH(bp, &hvf_state->hvf_sw_breakpoints, entry) {
49 if (bp->pc == pc) {
50 return bp;
53 return NULL;
56 int hvf_sw_breakpoints_active(CPUState *cpu)
58 return !QTAILQ_EMPTY(&hvf_state->hvf_sw_breakpoints);
61 int hvf_update_guest_debug(CPUState *cpu)
63 hvf_arch_update_guest_debug(cpu);
64 return 0;