Browse Source

hvf: arm: disable debug features for iOS

osy 10 months ago
parent
commit
849e1db096
1 changed files with 45 additions and 0 deletions
  1. 45 0
      target/arm/hvf/hvf.c

+ 45 - 0
target/arm/hvf/hvf.c

@@ -115,6 +115,8 @@ static const uint16_t dbgwvr_regs[] = {
     HV_SYS_REG_DBGWVR15_EL1,
 };
 
+#if !defined(CONFIG_HVF_PRIVATE)
+
 static inline int hvf_arm_num_brps(hv_vcpu_config_t config)
 {
     uint64_t val;
@@ -149,6 +151,8 @@ void hvf_arm_init_debug(void)
         g_array_sized_new(true, true, sizeof(HWWatchpoint), max_hw_wps);
 }
 
+#endif
+
 #define HVF_SYSREG(crn, crm, op0, op1, op2) \
         ENCODE_AA64_CP_REG(CP_REG_ARM64_SYSREG_CP, crn, crm, op0, op1, op2)
 
@@ -2081,11 +2085,15 @@ int hvf_arch_init(void)
     vmstate_register(NULL, 0, &vmstate_hvf_vtimer, &vtimer);
     qemu_add_vm_change_state_handler(hvf_vm_state_change, &vtimer);
 
+#if !defined(CONFIG_HVF_PRIVATE)
     hvf_arm_init_debug();
+#endif
 
     return 0;
 }
 
+#if !defined(CONFIG_HVF_PRIVATE)
+
 static const uint32_t brk_insn = 0xd4200000;
 
 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
@@ -2290,3 +2298,40 @@ bool hvf_arch_supports_guest_debug(void)
 {
     return true;
 }
+
+#else
+
+int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
+{
+    return -ENOSYS;
+}
+
+int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
+{
+    return -ENOSYS;
+}
+
+int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
+{
+    return -ENOSYS;
+}
+
+int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
+{
+    return -ENOSYS;
+}
+
+void hvf_arch_remove_all_hw_breakpoints(void)
+{
+}
+
+void hvf_arch_update_guest_debug(CPUState *cpu)
+{
+}
+
+bool hvf_arch_supports_guest_debug(void)
+{
+    return false;
+}
+
+#endif