Running OPAL in qemu – the powernv platform

Ben has a qemu tree up with some work-in-progress patches to qemu to support the PowerNV platform. This is the “bare metal” platform like you’d get on real POWER8 hardware running OPAL, and it allows us to use qemu like my previous post used the POWER8 Functional Simulator – to boot OpenPower firmware.

To build qemu for this, follow these steps:

apt-get -y install gcc python g++ pkg-config libz-dev libglib2.0-dev \
  libpixman-1-dev libfdt-dev git
git clone https://github.com/ozbenh/qemu.git
cd qemu
./configure --target-list=ppc64-softmmu
make -j `grep -c processor /proc/cpuinfo`

This will leave you with a ppc64-softmmu/qemu-system-ppc64 binary. Once you’ve built your OpenPower firmware to run in a simulator, you can boot it!

Note that this qemu branch is under development, and is likely to move/change or even break.

I do it like this:

cd ~/op-build/output/images;  # so skiboot.lid is in pwd
~/qemu/ppc64-softmmu/qemu-system-ppc64 -m 1G -M powernv \
-kernel zImage.epapr -nographic \
-cdrom ~/ubuntu-vivid-ppc64el-mini.iso

and this lets me test that we launch the Ubunut vivid installer correctly.

You can easily add other qemu options such as additional disks or networking and verify that it works correctly. This way, you can do development on some skiboot functionality or a variety of kernel and op-build userspace (such as the petitboot bootloader) without needing either real hardware or using the simulator.

This is useful if, say, you’re running on ppc64el, for which the POWER8 functional simulator is currently not available on.

6 thoughts on “Running OPAL in qemu – the powernv platform

  1. There’s a bunch of stuff in qemu that’s still missing, the current strategy is to gradually fix things in qemu to make it more and more useful.

    A big thing will be getting the patches cleaned up and upstream :)

  2. Pingback: Tianocore for OpenPOWER | Firmware Security

  3. BTW you can add to qemu “-bios ~/src/skiboot/skiboot.lid” to specify the location of the skiboot binary

  4. I can’t see the cdrom in the menu. Just the basic petitboot menu as below:

    Petitboot (dev.20151207) IBM PowerNV (emulated by qemu)
    —————————————————————————————–
    System information
    System configuration
    Language
    Rescan devices
    Retrieve config from URL
    *Exit to shell

    Do you know how to solve it?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.