Skip to content

Commit

Permalink
target/arm/kvm: Merge kvm_arm_init_debug into kvm_arch_init
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
rth7680 authored and pm215 committed Dec 19, 2023
1 parent b16620c commit dd2157d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
8 changes: 7 additions & 1 deletion target/arm/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,13 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
}
}

kvm_arm_init_debug(s);
max_hw_wps = kvm_check_extension(s, KVM_CAP_GUEST_DEBUG_HW_WPS);
hw_watchpoints = g_array_sized_new(true, true,
sizeof(HWWatchpoint), max_hw_wps);

max_hw_bps = kvm_check_extension(s, KVM_CAP_GUEST_DEBUG_HW_BPS);
hw_breakpoints = g_array_sized_new(true, true,
sizeof(HWBreakpoint), max_hw_bps);

return ret;
}
Expand Down
12 changes: 0 additions & 12 deletions target/arm/kvm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@
#include "hw/acpi/ghes.h"


void kvm_arm_init_debug(KVMState *s)
{
max_hw_wps = kvm_check_extension(s, KVM_CAP_GUEST_DEBUG_HW_WPS);
hw_watchpoints = g_array_sized_new(true, true,
sizeof(HWWatchpoint), max_hw_wps);

max_hw_bps = kvm_check_extension(s, KVM_CAP_GUEST_DEBUG_HW_BPS);
hw_breakpoints = g_array_sized_new(true, true,
sizeof(HWBreakpoint), max_hw_bps);
return;
}

int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
{
switch (type) {
Expand Down
8 changes: 0 additions & 8 deletions target/arm/kvm_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
#define KVM_ARM_VGIC_V2 (1 << 0)
#define KVM_ARM_VGIC_V3 (1 << 1)

/**
* kvm_arm_init_debug() - initialize guest debug capabilities
* @s: KVMState
*
* Should be called only once before using guest debug capabilities.
*/
void kvm_arm_init_debug(KVMState *s);

/**
* kvm_arm_vcpu_init:
* @cs: CPUState
Expand Down

0 comments on commit dd2157d

Please sign in to comment.