| 399 | |
| 400 | |
| 401 | class ARMV7QEMURunner(ARMQEMURunner, ARMEFIQEMURunner): |
| 402 | def __init__(self) -> None: |
| 403 | super().__init__() |
| 404 | |
| 405 | self.supports_efi = True |
| 406 | self.use_kvm = self._can_use_kvm() |
| 407 | |
| 408 | self.cmdline += ['console=ttyAMA0', 'earlycon'] |
| 409 | |
| 410 | def _can_use_kvm(self) -> bool: |
| 411 | # 32-bit ARM KVM was ripped out in 5.7, so we do not bother checking |
| 412 | # for it here. |
| 413 | if platform.machine() != 'aarch64': |
| 414 | return False |
| 415 | |
| 416 | # 32-bit EL1 is not supported on all cores so support for it must be |
| 417 | # explicitly queried via the KVM_CHECK_EXTENSION ioctl(). |
| 418 | try: |
| 419 | subprocess.run( |
| 420 | Path(utils.BOOT_UTILS, 'utils', 'aarch64_32_bit_el1_supported'), |
| 421 | check=True, |
| 422 | ) |
| 423 | except subprocess.CalledProcessError: |
| 424 | return False |
| 425 | |
| 426 | return self._have_dev_kvm_access() |
| 427 | |
| 428 | def run(self) -> None: |
| 429 | if self.efi: |
| 430 | aavmf_locations = [ |
| 431 | Path('edk2/arm/QEMU_EFI.fd'), # Arch Linux, Fedora |
| 432 | ] |
| 433 | self._setup_efi(aavmf_locations) |
| 434 | |
| 435 | if self.use_kvm: |
| 436 | self._kvm_cpu.append('aarch64=off') |
| 437 | self._qemu_arch = 'aarch64' |
| 438 | |
| 439 | super().run() |
| 440 | |
| 441 | |
| 442 | class ARM64QEMURunner(ARMEFIQEMURunner): |
nothing calls this directly
no outgoing calls
no test coverage detected