A Step-by-Step Guide to Running Hardware-Assisted Arm Virtual Machines on s390 Hosts
Introduction
Recent developments in the Linux kernel have opened up exciting possibilities for running Arm-based virtual machines (VMs) on s390 (IBM Z) hardware with near-native performance. A patch set by Steffen Eiden and colleagues lays the groundwork for hardware-assisted emulation of Arm CPUs on s390 systems. This guide walks you through understanding, preparing, and leveraging this technology to transparently execute Arm VMs on your s390 host. While the patches are still under review (version two fixes minor issues), they promise to bridge two architectures seamlessly. Follow these steps to get started.
What You Need
- s390 (IBM Z) hardware – A system capable of running recent Linux kernels with virtualization extensions.
- Recent Linux kernel source – Includes the hardware-assisted Arm VM patches from Steffen Eiden's set (version 2 or later).
- KVM (Kernel-based Virtual Machine) support – Ensure your kernel is compiled with KVM for s390 and the new Arm emulation module.
- Arm VM image – A compatible disk image or ISO of an Arm operating system (e.g., aarch64 Linux distribution).
- QEMU – The userspace hypervisor component (must support the new hardware-assisted backend for s390).
- Root or sudo access – To load kernel modules and run VMs.
- Familiarity with compilation and system administration – Basic knowledge of building kernels, configuring virtualization, and troubleshooting.
Step-by-Step Instructions
Step 1: Understand the Technology
Before diving in, grasp the core concept: The patch set enables the s390 CPU to directly assist in emulating Arm instructions, rather than relying on slower full software emulation. This yields near-native performance for Arm VMs. The Arm maintainers have welcomed the approach but are discussing collaboration structures to avoid maintainability issues on the Arm side. When those details are resolved, transparent Arm VM execution on s390 will become a reality.
Step 2: Obtain the Latest Kernel with Arm VM Support
- Clone the mainline Linux kernel repository:
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git - Check for the patch set: as of now, it's in the virtualization mailing list. You may need to apply the patches from Steffen Eiden's posting (version two fixes small problems).
- Build the kernel with appropriate configuration: enable
CONFIG_KVM,CONFIG_KVM_S390, and the new Arm emulation options (likely underCONFIG_KVM_ARM_S390or similar). - Install and boot the new kernel. Verify modules load.
Step 3: Configure s390 Hardware Virtualization
- Ensure virtualization extensions are enabled in your s390 firmware (LPAR or z/VM).
- Load the KVM module:
modprobe kvm - Load the s390-specific KVM module:
modprobe kvm_s390 - Load the new Arm hardware-assisted module (if separate):
modprobe kvm_arm_s390. Check dmesg for success. - Verify that the host supports the feature:
cat /sys/module/kvm_arm_s390/parameters/for version info.
Step 4: Prepare an Arm VM Image
- Obtain a standard aarch64 (64-bit Arm) disk image – for example, from an Ubuntu or Debian cloud image.
- Ensure the image uses QEMU's
virtmachine type (most modern Arm VMs do). - Optionally, convert the image to raw or qcow2 format for compatibility.
- Place the image in a directory accessible to your user (e.g.,
/var/lib/libvirt/images/or any path).
Step 5: Launch the Arm VM with QEMU
- Install QEMU with s390 support (most distributions include it).
- Use a command like:
Note: Theqemu-system-aarch64 \ -M virt \ -cpu host \ -enable-kvm \ -m 2G \ -drive file=arm-vm.qcow2,format=qcow2,if=none,id=drive0 \ -device virtio-blk-device,drive=drive0 \ -netdev user,id=net0 \ -device virtio-net-device,netdev=net0 \ -nographic-cpu hostflag is critical – it enables hardware-assisted Arm emulation using the s390's new feature. - If the patches are fully integrated, QEMU will automatically use the hardware assist; otherwise, you may need a QEMU built with the corresponding backend.
- Monitor output: the VM should boot at near-native speed.
Step 6: Verify Performance and Stability
- Inside the Arm VM, run benchmarks (e.g.,
sysbench,stress) to compare with software emulation. - Check host resource usage:
toporhtop– expect lower CPU usage for emulation. - Test multiple VMs to assess scalability.
- If you encounter issues, consult the kernel mailing list archives or the patch discussion for known problems (version two fixes small glitches).
Tips for Success
- Stay updated: Follow the patch set's evolution on the LKML. The Arm maintainers are working with s390 developers to finalize collaboration – expect refinements.
- Build a test kernel: Use a separate partition or VM for the new kernel to avoid breaking production.
- Use the latest QEMU: Upstream QEMU often adds support for new kernel features ahead of distributions.
- Check hardware support: Not all s390 models have the needed instructions; verify with your vendor.
- Contribute feedback: If you test the patches, report success or bugs to the mailing list – the maintainers welcome community involvement.
- Leverage libvirt: For easier management, define an Arm VM in libvirt with
domain type='kvm'andarch='aarch64', using thecpu mode='host-passthrough'.
Related Articles
- Mastering the Priestess Boss in Saros: A Complete Q&A Guide
- Meta Breaks Free from WebRTC 'Forking Trap' with Dual-Stack Architecture for 50+ Use Cases
- Understanding GitHub Copilot's Latest Plan Updates: What You Need to Know
- Python 3.13.10 Maintenance Release: What's New and How to Upgrade
- Blockchain and Natural Language: Startup Unveils Open-Source OS for Humanoid Robots
- Enhancing Deployment Safety at GitHub with eBPF: Breaking Circular Dependencies
- Flutter and Dart’s 2026 Vision: A New Era of Multi-Platform Development
- Breaking Free from the Fork: Meta's Journey to Upstream WebRTC Across 50+ Applications