Sunday, June 8, 2014

IOMMU support in upstream qemu-system-sparc64

I didn't write about SPARC emulation lately because I didn't work on it. But Mark Cave-Ayland is still working hard, so there is a lot of new stuff. The sun4m emulation has a new graphic adapter: cg3. Also the old adapter (tcx) supports acceleration.

And now, something really cool for the sun4u emulation. As of today git master has a working IOMMU support in qemu-system-sparc64! This means that you don't need to follow all the steps in
Debian/sparc64 Wheezy under QEMU How-To. Just insert your image into -cdrom and voilĂ !
Well done, Mark!

Now, while using an IDE drive simplifies the installation process a lot, using virtio still makes sense. Quick performance test:

root@debian-wheezy:~#  dd if=/dev/vdb of=/dev/null bs=1024k count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 1.56761 s, 66.9 MB/s

root@debian-wheezy:~#  dd if=/dev/sda of=/dev/null bs=1024k count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 9.59107 s, 10.9 MB/s

Yes, IDE is slower, as the emulated kernel has to do more work, but still, the performance is pretty much ok.

Also, not every OS running on sun4u machines has support for virtio. From an undisclosed source I know that Mark is working on booting NetBSD/sparc64 under vanilla QEMU. Stay tuned. ;-)


Anonymous said...

i've got an git qemu sparc64 build and the weezy-sparc-dvd-iso ready

but its not clear to me what steps and qemu commandline parameters from the old post are still needed

can you update your post to an more full installation description


atar said...

Well, no special steps is necessary. You can just start
qemu-system-sparc64 -hda yourhda -cdrom weezy-sparc-dvd-iso -boot d

and it'll work. But if you'd like to have a faster IO (virtio) follow the instructions here:

Anonymous said...

so i followed your advice

qemu-system-sparc64 -hda ./Downloads/my_sparc_hda -cdrom ./Downloads/debian-7.6.0-sparc-DVD-1.iso -boot d

i can see some kernel init stuff after pressing ENTER on the debian boot menu
but then qemu seems to hang - maybe my system (quad-core i7, 2.8ghz, 8gb ram) isn't powerfull enough?

these are my installation steps

fresh ubuntu 14.04 installation

sudo apt-get install gcc4.8
sudo apt-get install g++

sudo apt-get install git
sudo apt-get install glib2.0-dev
sudo apt-get install libfdt-dev

sudo apt-get install libsdl1.2-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libvte-dev

sudo apt-get update
sudo apt-get upgrade

-->current debian weezy sparc

-->get qemu git head revision c15a34eda0f270888a0e4676997317e1bd7894b8 from 2014/07/14, ~15:25

git clone git://
cd qemu
./configure --target-list=sparc64-softmmu

./qemu/qemu-img create my_sparc_hda 4G

atar said...

My system is much older, so the performance shouldn't be a problem. Please ask it on qemu-devel mailing list. It looks like a bug.

Things you can try:
a) use -nographic switch to exclude problems with the graphic card emulation.
b) use -m 512 to make sure the guest OS has enough RAM.
c) Do it as described in the old how-to, to exclude problems with IOMMU.


Anonymous said...

i can fully install with the help of -nographic - thx

posted a bug report the the mailinglist