diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index f2a6ea6a68..b3dc7743db 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -22,6 +22,7 @@
 #include "qemu/atomic.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
+#include "qemu/cutils.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "hw/pci/msi.h"
@@ -315,7 +316,7 @@ err:
         error_report("%s: KVM_SET_USER_MEMORY_REGION failed, slot=%d,"
                      " start=0x%" PRIx64 ", size=0x%" PRIx64 ": %s",
                      __func__, mem.slot, slot->start_addr,
-                     (uint64_t)mem.memory_size, strerror(errno));
+                     (uint64_t)mem.memory_size, qemu_strerror(errno));
     }
     return ret;
 }
@@ -1366,7 +1367,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml,
             err = kvm_set_user_memory_region(kml, mem, false);
             if (err) {
                 fprintf(stderr, "%s: error unregistering slot: %s\n",
-                        __func__, strerror(-err));
+                        __func__, qemu_strerror(-err));
                 abort();
             }
             start_addr += slot_size;
@@ -1389,7 +1390,7 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml,
         err = kvm_set_user_memory_region(kml, mem, true);
         if (err) {
             fprintf(stderr, "%s: error registering slot: %s\n", __func__,
-                    strerror(-err));
+                    qemu_strerror(-err));
             abort();
         }
         start_addr += slot_size;
@@ -1613,7 +1614,7 @@ static void kvm_mem_ioeventfd_add(MemoryListener *listener,
                                match_data);
     if (r < 0) {
         fprintf(stderr, "%s: error adding ioeventfd: %s (%d)\n",
-                __func__, strerror(-r), -r);
+                __func__, qemu_strerror(-r), -r);
         abort();
     }
 }
@@ -1649,7 +1650,7 @@ static void kvm_io_ioeventfd_add(MemoryListener *listener,
                               match_data);
     if (r < 0) {
         fprintf(stderr, "%s: error adding ioeventfd: %s (%d)\n",
-                __func__, strerror(-r), -r);
+                __func__, qemu_strerror(-r), -r);
         abort();
     }
 }
@@ -1668,7 +1669,7 @@ static void kvm_io_ioeventfd_del(MemoryListener *listener,
                               match_data);
     if (r < 0) {
         fprintf(stderr, "%s: error deleting ioeventfd: %s (%d)\n",
-                __func__, strerror(-r), -r);
+                __func__, qemu_strerror(-r), -r);
         abort();
     }
 }
@@ -2278,7 +2279,8 @@ static void kvm_irqchip_create(KVMState *s)
     } else if (kvm_check_extension(s, KVM_CAP_S390_IRQCHIP)) {
         ret = kvm_vm_enable_cap(s, KVM_CAP_S390_IRQCHIP, 0);
         if (ret < 0) {
-            fprintf(stderr, "Enable kernel irqchip failed: %s\n", strerror(-ret));
+            fprintf(stderr, "Enable kernel irqchip failed: %s\n",
+                    qemu_strerror(-ret));
             exit(1);
         }
     } else {
@@ -2297,7 +2299,8 @@ static void kvm_irqchip_create(KVMState *s)
         }
     }
     if (ret < 0) {
-        fprintf(stderr, "Create kernel irqchip failed: %s\n", strerror(-ret));
+        fprintf(stderr, "Create kernel irqchip failed: %s\n",
+                qemu_strerror(-ret));
         exit(1);
     }
 
@@ -2446,7 +2449,7 @@ static int kvm_init(MachineState *ms)
 
     if (ret < 0) {
         fprintf(stderr, "ioctl(KVM_CREATE_VM) failed: %d %s\n", -ret,
-                strerror(-ret));
+                qemu_strerror(-ret));
 
 #ifdef TARGET_S390X
         if (ret == -EINVAL) {
@@ -2532,7 +2535,8 @@ static int kvm_init(MachineState *ms)
             ret = kvm_vm_enable_cap(s, KVM_CAP_DIRTY_LOG_RING, 0, ring_bytes);
             if (ret) {
                 error_report("Enabling of KVM dirty ring failed: %s. "
-                             "Suggested minimum value is 1024.", strerror(-ret));
+                             "Suggested minimum value is 1024.",
+                             qemu_strerror(-ret));
                 goto err;
             }
 
@@ -2949,7 +2953,7 @@ int kvm_cpu_exec(CPUState *cpu)
                 break;
             }
             fprintf(stderr, "error: kvm run failed %s\n",
-                    strerror(-run_ret));
+                    qemu_strerror(-run_ret));
 #ifdef TARGET_PPC
             if (run_ret == -EBUSY) {
                 fprintf(stderr,
@@ -3455,7 +3459,7 @@ void kvm_init_cpu_signals(CPUState *cpu)
         r = kvm_set_signal_mask(cpu, &set);
     }
     if (r) {
-        fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
+        fprintf(stderr, "kvm_set_signal_mask: %s\n", qemu_strerror(-r));
         exit(1);
     }
 }
@@ -3538,7 +3542,7 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source)
     reg.addr = (uintptr_t) source;
     r = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
     if (r) {
-        trace_kvm_failed_reg_set(id, strerror(-r));
+        trace_kvm_failed_reg_set(id, qemu_strerror(-r));
     }
     return r;
 }
@@ -3552,7 +3556,7 @@ int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target)
     reg.addr = (uintptr_t) target;
     r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
     if (r) {
-        trace_kvm_failed_reg_get(id, strerror(-r));
+        trace_kvm_failed_reg_get(id, qemu_strerror(-r));
     }
     return r;
 }
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index e984a98dc4..6cf888cdf1 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -40,6 +40,7 @@
 #include "qemu/plugin-memory.h"
 #endif
 #include "tcg/tcg-ldst.h"
+#include "qemu/cutils.h"
 
 /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */
 /* #define DEBUG_TLB */
@@ -215,7 +216,7 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast,
      */
     while (fast->table == NULL || desc->fulltlb == NULL) {
         if (new_size == (1 << CPU_TLB_DYN_MIN_BITS)) {
-            error_report("%s: %s", __func__, strerror(errno));
+            error_report("%s: %s", __func__, qemu_strerror(errno));
             abort();
         }
         new_size = MAX(new_size >> 1, 1 << CPU_TLB_DYN_MIN_BITS);
diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c
index 65e35ea3b9..0c7a3a8822 100644
--- a/accel/tcg/perf.c
+++ b/accel/tcg/perf.c
@@ -13,6 +13,7 @@
 #include "exec/exec-all.h"
 #include "qemu/timer.h"
 #include "tcg/tcg.h"
+#include "qemu/cutils.h"
 
 #include "debuginfo.h"
 #include "perf.h"
@@ -54,7 +55,7 @@ void perf_enable_perfmap(void)
     perfmap = safe_fopen_w(map_file);
     if (perfmap == NULL) {
         warn_report("Could not open %s: %s, proceeding without perfmap",
-                    map_file, strerror(errno));
+                    map_file, qemu_strerror(errno));
     }
 }
 
@@ -201,7 +202,7 @@ void perf_enable_jitdump(void)
     jitdump = safe_fopen_w(jitdump_file);
     if (jitdump == NULL) {
         warn_report("Could not open %s: %s, proceeding without jitdump",
-                    jitdump_file, strerror(errno));
+                    jitdump_file, qemu_strerror(errno));
         return;
     }
 
@@ -214,7 +215,7 @@ void perf_enable_jitdump(void)
                        MAP_PRIVATE, fileno(jitdump), 0);
     if (perf_marker == MAP_FAILED) {
         warn_report("Could not map %s: %s, proceeding without jitdump",
-                    jitdump_file, strerror(errno));
+                    jitdump_file, qemu_strerror(errno));
         fclose(jitdump);
         jitdump = NULL;
         return;
