diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 9909c928cd..0c1a55a4c9 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -288,7 +288,7 @@ def testimage_main(d):
     boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT"))
 
     # Get use_kvm
-    kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
+    kvm = oe.qemu.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
 
     # Get OVMF
     ovmf = d.getVar("QEMU_USE_OVMF")
diff --git a/meta/lib/oe/qemu.py b/meta/lib/oe/qemu.py
index 769865036c..5e0ee6087d 100644
--- a/meta/lib/oe/qemu.py
+++ b/meta/lib/oe/qemu.py
@@ -4,6 +4,11 @@
 # SPDX-License-Identifier: GPL-2.0-only
 #
 
+import os
+import re
+
+import oe.types
+
 def qemu_target_binary(d):
     package_arch = d.getVar("PACKAGE_ARCH")
     qemu_target_binary = (d.getVar("QEMU_TARGET_BINARY_%s" % package_arch) or "")
@@ -52,3 +57,27 @@ def qemu_run_binary(d, rootfs_path, binary):
     base_libdir = rootfs_path + d.getVar("base_libdir", False)
 
     return qemu_wrapper_cmdline(d, rootfs_path, [libdir, base_libdir]) + rootfs_path + binary
+
+def is_x86(arch):
+    """
+    Check whether ``arch`` is ``x86`` or ``x86_64``, return ``True`` if it is,
+    ``False`` otherwise.
+    """
+    if arch.startswith('x86_') or re.match('i.*86', arch):
+        return True
+    else:
+        return False
+
+def qemu_use_kvm(kvm, target_arch):
+    """
+    Enable kvm if target_arch == build_arch or both of them are x86 archs.
+    """
+
+    use_kvm = False
+    if kvm and oe.types.boolean(kvm):
+        build_arch = os.uname()[4]
+        if is_x86(build_arch) and is_x86(target_arch):
+            use_kvm = True
+        elif build_arch == target_arch:
+            use_kvm = True
+    return use_kvm
diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py
index b929afb1f3..c4b338921b 100644
--- a/meta/lib/oe/types.py
+++ b/meta/lib/oe/types.py
@@ -163,26 +163,3 @@ def path(value, relativeto='', normalize='true', mustexist='false'):
                 raise ValueError("{0}: {1}".format(value, os.strerror(errno.ENOENT)))
 
     return value
-
-def is_x86(arch):
-    """
-    Check whether arch is x86 or x86_64
-    """
-    if arch.startswith('x86_') or re.match('i.*86', arch):
-        return True
-    else:
-        return False
-
-def qemu_use_kvm(kvm, target_arch):
-    """
-    Enable kvm if target_arch == build_arch or both of them are x86 archs.
-    """
-
-    use_kvm = False
-    if kvm and boolean(kvm):
-        build_arch = os.uname()[4]
-        if is_x86(build_arch) and is_x86(target_arch):
-            use_kvm = True
-        elif build_arch == target_arch:
-            use_kvm = True
-    return use_kvm
diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py
index fcfcdaf7e4..b896558e62 100644
--- a/meta/lib/oeqa/selftest/cases/efibootpartition.py
+++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py
@@ -8,7 +8,7 @@
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, runqemu, get_bb_var
 from oeqa.core.decorator.data import skipIfNotMachine
-import oe.types
+import oe.qemu
 
 class GenericEFITest(OESelftestTestCase):
     """EFI booting test class"""
@@ -17,7 +17,7 @@ class GenericEFITest(OESelftestTestCase):
         image = "core-image-minimal"
         runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or ""
         cmd = "runqemu %s nographic serial wic ovmf" % (runqemu_params)
-        if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]):
+        if oe.qemu.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]):
             cmd += " kvm"
 
         self.write_config("""
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index bfa76812ae..11bce6ab6a 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -7,7 +7,7 @@
 import os
 import re
 import time
-import oe.types
+import oe.qemu
 from oeqa.core.decorator import OETestTag
 from oeqa.core.decorator.data import skipIfNotArch, skipIfNotMachine
 from oeqa.selftest.case import OESelftestTestCase
@@ -34,7 +34,7 @@ class RunqemuTests(OESelftestTestCase):
             self.fstypes += " wic.vmdk wic.qcow2 wic.vdi wic.zst"
 
         self.cmd_common = "runqemu nographic snapshot"
-        kvm = oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"])
+        kvm = oe.qemu.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"])
         if kvm:
             self.cmd_common += " kvm"
 
diff --git a/meta/lib/oeqa/selftest/cases/uki.py b/meta/lib/oeqa/selftest/cases/uki.py
index fc31fb767a..47ca26a948 100644
--- a/meta/lib/oeqa/selftest/cases/uki.py
+++ b/meta/lib/oeqa/selftest/cases/uki.py
@@ -9,7 +9,7 @@ from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, runqemu, get_bb_var
 from oeqa.core.decorator.data import skipIfNotArch
 from oeqa.core.decorator import OETestTag
-import oe.types
+import oe.qemu
 
 class UkiTest(OESelftestTestCase):
     """Boot Unified Kernel Image (UKI) generated with uki.bbclass on UEFI firmware (omvf/edk2)"""
@@ -21,7 +21,7 @@ class UkiTest(OESelftestTestCase):
         image = "core-image-minimal"
         runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or ""
         cmd = "runqemu %s nographic serial wic ovmf" % (runqemu_params)
-        if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]):
+        if oe.qemu.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]):
             cmd += " kvm"
 
         self.write_config("""
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 1deea2e5ce..7ed3ebd785 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -91,7 +91,7 @@ class QemuTarget(BaseTarget):
 
     def __init__(self, d, logger, image_fstype=None, boot_patterns=None):
 
-        import oe.types
+        import oe.qemu
 
         super(QemuTarget, self).__init__(d, logger)
 
@@ -108,7 +108,7 @@ class QemuTarget(BaseTarget):
         dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
         if not dump_dir:
             dump_dir = os.path.join(d.getVar('LOG_DIR'), 'runtime-hostdump')
-        use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
+        use_kvm = oe.qemu.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH'))
 
         # Log QemuRunner log output to a file
         import oe.path
