A Step-by-Step Guide to Running Hardware-Assisted Arm Virtual Machines on s390 Hosts

By

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.

A Step-by-Step Guide to Running Hardware-Assisted Arm Virtual Machines on s390 Hosts

What You Need

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

  1. Clone the mainline Linux kernel repository: git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  2. 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).
  3. Build the kernel with appropriate configuration: enable CONFIG_KVM, CONFIG_KVM_S390, and the new Arm emulation options (likely under CONFIG_KVM_ARM_S390 or similar).
  4. Install and boot the new kernel. Verify modules load.

Step 3: Configure s390 Hardware Virtualization

  1. Ensure virtualization extensions are enabled in your s390 firmware (LPAR or z/VM).
  2. Load the KVM module: modprobe kvm
  3. Load the s390-specific KVM module: modprobe kvm_s390
  4. Load the new Arm hardware-assisted module (if separate): modprobe kvm_arm_s390. Check dmesg for success.
  5. Verify that the host supports the feature: cat /sys/module/kvm_arm_s390/parameters/ for version info.

Step 4: Prepare an Arm VM Image

  1. Obtain a standard aarch64 (64-bit Arm) disk image – for example, from an Ubuntu or Debian cloud image.
  2. Ensure the image uses QEMU's virt machine type (most modern Arm VMs do).
  3. Optionally, convert the image to raw or qcow2 format for compatibility.
  4. 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

  1. Install QEMU with s390 support (most distributions include it).
  2. Use a command like:
    qemu-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
        
    Note: The -cpu host flag is critical – it enables hardware-assisted Arm emulation using the s390's new feature.
  3. If the patches are fully integrated, QEMU will automatically use the hardware assist; otherwise, you may need a QEMU built with the corresponding backend.
  4. Monitor output: the VM should boot at near-native speed.

Step 6: Verify Performance and Stability

  1. Inside the Arm VM, run benchmarks (e.g., sysbench, stress) to compare with software emulation.
  2. Check host resource usage: top or htop – expect lower CPU usage for emulation.
  3. Test multiple VMs to assess scalability.
  4. 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

Tags:

Related Articles

Recommended

Discover More

ok99Unveiling the Atomic Secrets of Relaxor Ferroelectrics: A Breakthrough in Materials Sciencebong88Bringing AI-Powered Observability to Every Grafana Environment: Grafana Assistant Expands to Self-Managed Deploymentsok99dv88Understanding Anthropic's Claude Mythos: A New Era in AI-Powered CybersecurityV8 Engine Performance Overhaul: Turbocharging Async Benchmarks with Mutable Heap Numbersdv88iPhone Push Notification Database Exposed Signal Messages Despite App Deletion, FBI Investigation Revealsbong88