xref: /openbmc/qemu/docs/system/ppc/powernv.rst (revision 4921d0a7)
1PowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``)
2==================================================================
3
4PowerNV (as Non-Virtualized) is the "bare metal" platform using the
5OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can
6be used as an hypervisor OS, running KVM guests, or simply as a host
7OS.
8
9The PowerNV QEMU machine tries to emulate a PowerNV system at the
10level of the skiboot firmware, which loads the OS and provides some
11runtime services. Power Systems have a lower firmware (HostBoot) that
12does low level system initialization, like DRAM training. This is
13beyond the scope of what QEMU addresses today.
14
15Supported devices
16-----------------
17
18 * Multi processor support for POWER8, POWER8NVL and POWER9.
19 * XSCOM, serial communication sideband bus to configure chiplets.
20 * Simple LPC Controller.
21 * Processor Service Interface (PSI) Controller.
22 * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10).
23 * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge.
24 * Simple OCC is an on-chip micro-controller used for power management tasks.
25 * iBT device to handle BMC communication, with the internal BMC simulator
26   provided by QEMU or an external BMC such as an Aspeed QEMU machine.
27 * PNOR containing the different firmware partitions.
28
29Missing devices
30---------------
31
32A lot is missing, among which :
33
34 * I2C controllers (yet to be merged).
35 * NPU/NPU2/NPU3 controllers.
36 * EEH support for PCIe Host bridge controllers.
37 * NX controller.
38 * VAS controller.
39 * chipTOD (Time Of Day).
40 * Self Boot Engine (SBE).
41 * FSI bus.
42
43Firmware
44--------
45
46The OPAL firmware (OpenPower Abstraction Layer) for OpenPower systems
47includes the runtime services ``skiboot`` and the bootloader kernel and
48initramfs ``skiroot``. Source code can be found on the `OpenPOWER account at
49GitHub <https://github.com/open-power>`_.
50
51Prebuilt images of ``skiboot`` and ``skiroot`` are made available on the
52`OpenPOWER <https://github.com/open-power/op-build/releases/>`__ site.
53
54QEMU includes a prebuilt image of ``skiboot`` which is updated when a
55more recent version is required by the models.
56
57Current acceleration status
58---------------------------
59
60KVM acceleration in Linux Power hosts is provided by the kvm-hv and
61kvm-pr modules. kvm-hv is adherent to PAPR and it's not compliant with
62powernv. kvm-pr in theory could be used as a valid accel option but
63this isn't supported by kvm-pr at this moment.
64
65To spare users from dealing with not so informative errors when attempting
66to use accel=kvm, the powernv machine will throw an error informing that
67KVM is not supported. This can be revisited in the future if kvm-pr (or
68any other KVM alternative) is usable as KVM accel for this machine.
69
70Boot options
71------------
72
73Here is a simple setup with one e1000e NIC :
74
75.. code-block:: bash
76
77  $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 \
78  -accel tcg,thread=single \
79  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0 \
80  -netdev user,id=net0,hostfwd=::20022-:22,hostname=pnv \
81  -kernel ./zImage.epapr  \
82  -initrd ./rootfs.cpio.xz \
83  -nographic
84
85and a SATA disk :
86
87.. code-block:: bash
88
89  -device ich9-ahci,id=sata0,bus=pcie.1,addr=0x0 \
90  -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \
91  -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \
92
93Complex PCIe configuration
94~~~~~~~~~~~~~~~~~~~~~~~~~~
95
96Six PHBs are defined per chip (POWER9) but no default PCI layout is
97provided (to be compatible with libvirt). One PCI device can be added
98on any of the available PCIe slots using command line options such as:
99
100.. code-block:: bash
101
102  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0
103  -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=hostnet0
104
105  -device megasas,id=scsi0,bus=pcie.0,addr=0x0
106  -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none
107  -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2
108
109Here is a full example with two different storage controllers on
110different PHBs, each with a disk, the second PHB is empty :
111
112.. code-block:: bash
113
114  $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 -accel tcg,thread=single \
115  -kernel ./zImage.epapr -initrd ./rootfs.cpio.xz -bios ./skiboot.lid \
116  \
117  -device megasas,id=scsi0,bus=pcie.0,addr=0x0 \
118  -drive file=./rhel7-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none \
119  -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=2 \
120  \
121  -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 \
122  \
123  -device ich9-ahci,id=sata0,bus=bridge1,addr=0x1 \
124  -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \
125  -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \
126  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=bridge1,addr=0x2 \
127  -netdev bridge,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=net0 \
128  -device nec-usb-xhci,bus=bridge1,addr=0x7 \
129  \
130  -serial mon:stdio -nographic
131
132You can also use VIRTIO devices :
133
134.. code-block:: bash
135
136  -drive file=./fedora-ppc64le.qcow2,if=none,snapshot=on,id=drive0 \
137  -device virtio-blk-pci,drive=drive0,id=blk0,bus=pcie.0 \
138  \
139  -netdev tap,helper=/usr/lib/qemu/qemu-bridge-helper,br=virbr0,id=netdev0 \
140  -device virtio-net-pci,netdev=netdev0,id=net0,bus=pcie.1 \
141  \
142  -fsdev local,id=fsdev0,path=$HOME,security_model=passthrough \
143  -device virtio-9p-pci,fsdev=fsdev0,mount_tag=host,bus=pcie.2
144
145Multi sockets
146~~~~~~~~~~~~~
147
148The number of sockets is deduced from the number of CPUs and the
149number of cores. ``-smp 2,cores=1`` will define a machine with 2
150sockets of 1 core, whereas ``-smp 2,cores=2`` will define a machine
151with 1 socket of 2 cores. ``-smp 8,cores=2``, 4 sockets of 2 cores.
152
153BMC configuration
154~~~~~~~~~~~~~~~~~
155
156OpenPOWER systems negotiate the shutdown and reboot with their
157BMC. The QEMU PowerNV machine embeds an IPMI BMC simulator using the
158iBT interface and should offer the same power features.
159
160If you want to define your own BMC, use ``-nodefaults`` and specify
161one on the command line :
162
163.. code-block:: bash
164
165  -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10
166
167The files `palmetto-SDR.bin <http://www.kaod.org/qemu/powernv/palmetto-SDR.bin>`__
168and `palmetto-FRU.bin <http://www.kaod.org/qemu/powernv/palmetto-FRU.bin>`__
169define a Sensor Data Record repository and a Field Replaceable Unit
170inventory for a Palmetto BMC. They can be used to extend the QEMU BMC
171simulator.
172
173.. code-block:: bash
174
175  -device ipmi-bmc-sim,sdrfile=./palmetto-SDR.bin,fruareasize=256,frudatafile=./palmetto-FRU.bin,id=bmc0 \
176  -device isa-ipmi-bt,bmc=bmc0,irq=10
177
178The PowerNV machine can also be run with an external IPMI BMC device
179connected to a remote QEMU machine acting as BMC, using these options
180:
181
182.. code-block:: bash
183
184  -chardev socket,id=ipmi0,host=localhost,port=9002,reconnect=10 \
185  -device ipmi-bmc-extern,id=bmc0,chardev=ipmi0 \
186  -device isa-ipmi-bt,bmc=bmc0,irq=10 \
187  -nodefaults
188
189NVRAM
190~~~~~
191
192Use a MTD drive to add a PNOR to the machine, and get a NVRAM :
193
194.. code-block:: bash
195
196  -drive file=./witherspoon.pnor,format=raw,if=mtd
197
198Maintainer contact information
199------------------------------
200
201Cédric Le Goater <clg@kaod.org>
202