How to obtain a big-endian CPU machine

Last week, I wanted to test whether a trivial function works OK on big-endian CPU. I have ARM and X86_64 machines at hand, but both them are little-endian. After searching online, I come across Running a emulated SparcStation 20 with qemu-sparc, though I heard about qemu before, but never used it, so wanted to give it a spin.

The installation of qemu is straightforward, then I created a NetBSD-10.1-sparc machine in just 3 steps (omit some configurations unneeded for me):

$ qemu-img create -f qcow2 ss20.image 4G
$ qemu-system-sparc -M SS-20 -m 256 -drive file=NetBSD-10.1-sparc.iso,bus=0,unit=2,media=cdrom,readonly=on -drive file=ss20.image,bus=0,unit=0,media=disk -full-screen -boot d
$ qemu-system-sparc -M SS-20 -m 256 -drive file=ss20.image,bus=0,unit=0,media=disk -full-screen -boot c

Then the machine booted successfully and met my requirement perfectly!

Why does qemu complain “No IOMMU found. Unable to assign device”?

When follow How to assign devices with VT-d in KVM tutorial in KVM site, you may encounter qemu-system-x86_64complains:

......No IOMMU found.  Unable to assign device......

The root cause is the KVM_DEVICE_ASSIGNMENT configuration option is deprecated, and the code in kernel KVM part is like this:

#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
    case KVM_CAP_IOMMU:
        r = iommu_present(&pci_bus_type);
        break;
#endif

So you should use VFIO feature instead.

If you still to want to use KVM_DEVICE_ASSIGNMENT feature, please rebuild the kernel with KVM_DEVICE_ASSIGNMENT option on.

Reference:
A question about “CONFIGKVMDEVICE_ASSIGNMENT” configuration