diff options
author | Mads Ynddal <m.ynddal@samsung.com> | 2023-03-02 18:58:05 -0800 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2023-03-07 20:44:09 +0000 |
commit | 412ae12647d1086c713e13841fd25d10d5418c7f (patch) | |
tree | b6db82a148295a5165f8208dc628589c06986797 /accel/kvm | |
parent | 2d3d2517cc78763cc31da053a29786c53ccd90a2 (diff) | |
download | qemu-412ae12647d1086c713e13841fd25d10d5418c7f.zip qemu-412ae12647d1086c713e13841fd25d10d5418c7f.tar.gz qemu-412ae12647d1086c713e13841fd25d10d5418c7f.tar.bz2 |
gdbstub: move update guest debug to accel ops
Continuing the refactor of a48e7d9e52 (gdbstub: move guest debug support
check to ops) by removing hardcoded kvm_enabled() from generic cpu.c
code, and replace it with a property of AccelOpsClass.
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230207131721.49233-1-mads@ynddal.dk>
[AJB: add ifdef around update_guest_debug_ops, fix brace]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230302190846.2593720-27-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-30-richard.henderson@linaro.org>
Diffstat (limited to 'accel/kvm')
-rw-r--r-- | accel/kvm/kvm-accel-ops.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index fbf4fe3..457eafa 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -86,6 +86,13 @@ static bool kvm_cpus_are_resettable(void) return !kvm_enabled() || kvm_cpu_check_are_resettable(); } +#ifdef KVM_CAP_SET_GUEST_DEBUG +static int kvm_update_guest_debug_ops(CPUState *cpu) +{ + return kvm_update_guest_debug(cpu, 0); +} +#endif + static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -99,6 +106,7 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm; #ifdef KVM_CAP_SET_GUEST_DEBUG + ops->update_guest_debug = kvm_update_guest_debug_ops; ops->supports_guest_debug = kvm_supports_guest_debug; ops->insert_breakpoint = kvm_insert_breakpoint; ops->remove_breakpoint = kvm_remove_breakpoint; |