xref: /qemu/docs/system/ppc/powernv.rst (revision 71569cd8aba31fcb3a326c56c307d2b811417c0b)
158c49ef5SLeonardo GarciaPowerNV family boards (``powernv8``, ``powernv9``, ``powernv10``)
2a4ee352fSCédric Le Goater==================================================================
3a4ee352fSCédric Le Goater
4a4ee352fSCédric Le GoaterPowerNV (as Non-Virtualized) is the "bare metal" platform using the
5a4ee352fSCédric Le GoaterOPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can
6a4ee352fSCédric Le Goaterbe used as an hypervisor OS, running KVM guests, or simply as a host
7a4ee352fSCédric Le GoaterOS.
8a4ee352fSCédric Le Goater
9a4ee352fSCédric Le GoaterThe PowerNV QEMU machine tries to emulate a PowerNV system at the
10a4ee352fSCédric Le Goaterlevel of the skiboot firmware, which loads the OS and provides some
11a4ee352fSCédric Le Goaterruntime services. Power Systems have a lower firmware (HostBoot) that
12a4ee352fSCédric Le Goaterdoes low level system initialization, like DRAM training. This is
13a4ee352fSCédric Le Goaterbeyond the scope of what QEMU addresses today.
14a4ee352fSCédric Le Goater
15a4ee352fSCédric Le GoaterSupported devices
16a4ee352fSCédric Le Goater-----------------
17a4ee352fSCédric Le Goater
18a4ee352fSCédric Le Goater * Multi processor support for POWER8, POWER8NVL and POWER9.
1958c49ef5SLeonardo Garcia * XSCOM, serial communication sideband bus to configure chiplets.
2058c49ef5SLeonardo Garcia * Simple LPC Controller.
2158c49ef5SLeonardo Garcia * Processor Service Interface (PSI) Controller.
2258c49ef5SLeonardo Garcia * Interrupt Controller, XICS (POWER8) and XIVE (POWER9) and XIVE2 (Power10).
2358c49ef5SLeonardo Garcia * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge.
2458c49ef5SLeonardo Garcia * Simple OCC is an on-chip micro-controller used for power management tasks.
2558c49ef5SLeonardo Garcia * iBT device to handle BMC communication, with the internal BMC simulator
2658c49ef5SLeonardo Garcia   provided by QEMU or an external BMC such as an Aspeed QEMU machine.
27a4ee352fSCédric Le Goater * PNOR containing the different firmware partitions.
28a4ee352fSCédric Le Goater
29a4ee352fSCédric Le GoaterMissing devices
30a4ee352fSCédric Le Goater---------------
31a4ee352fSCédric Le Goater
32a4ee352fSCédric Le GoaterA lot is missing, among which :
33a4ee352fSCédric Le Goater
3458c49ef5SLeonardo Garcia * I2C controllers (yet to be merged).
3558c49ef5SLeonardo Garcia * NPU/NPU2/NPU3 controllers.
3658c49ef5SLeonardo Garcia * EEH support for PCIe Host bridge controllers.
3758c49ef5SLeonardo Garcia * NX controller.
3858c49ef5SLeonardo Garcia * VAS controller.
3958c49ef5SLeonardo Garcia * chipTOD (Time Of Day).
40a4ee352fSCédric Le Goater * Self Boot Engine (SBE).
4158c49ef5SLeonardo Garcia * FSI bus.
42a4ee352fSCédric Le Goater
43a4ee352fSCédric Le GoaterFirmware
44a4ee352fSCédric Le Goater--------
45a4ee352fSCédric Le Goater
46a4ee352fSCédric Le GoaterThe OPAL firmware (OpenPower Abstraction Layer) for OpenPower systems
476df743dcSPeter Maydellincludes the runtime services ``skiboot`` and the bootloader kernel and
4858c49ef5SLeonardo Garciainitramfs ``skiroot``. Source code can be found on the `OpenPOWER account at
4958c49ef5SLeonardo GarciaGitHub <https://github.com/open-power>`_.
50a4ee352fSCédric Le Goater
5158c49ef5SLeonardo GarciaPrebuilt images of ``skiboot`` and ``skiroot`` are made available on the
5258c49ef5SLeonardo Garcia`OpenPOWER <https://github.com/open-power/op-build/releases/>`__ site.
53a4ee352fSCédric Le Goater
546df743dcSPeter MaydellQEMU includes a prebuilt image of ``skiboot`` which is updated when a
55a4ee352fSCédric Le Goatermore recent version is required by the models.
56a4ee352fSCédric Le Goater
573e8f7158SDaniel Henrique BarbozaCurrent acceleration status
583e8f7158SDaniel Henrique Barboza---------------------------
593e8f7158SDaniel Henrique Barboza
603e8f7158SDaniel Henrique BarbozaKVM acceleration in Linux Power hosts is provided by the kvm-hv and
613e8f7158SDaniel Henrique Barbozakvm-pr modules. kvm-hv is adherent to PAPR and it's not compliant with
623e8f7158SDaniel Henrique Barbozapowernv. kvm-pr in theory could be used as a valid accel option but
633e8f7158SDaniel Henrique Barbozathis isn't supported by kvm-pr at this moment.
643e8f7158SDaniel Henrique Barboza
653e8f7158SDaniel Henrique BarbozaTo spare users from dealing with not so informative errors when attempting
663e8f7158SDaniel Henrique Barbozato use accel=kvm, the powernv machine will throw an error informing that
673e8f7158SDaniel Henrique BarbozaKVM is not supported. This can be revisited in the future if kvm-pr (or
683e8f7158SDaniel Henrique Barbozaany other KVM alternative) is usable as KVM accel for this machine.
693e8f7158SDaniel Henrique Barboza
70a4ee352fSCédric Le GoaterBoot options
71a4ee352fSCédric Le Goater------------
72a4ee352fSCédric Le Goater
73a4ee352fSCédric Le GoaterHere is a simple setup with one e1000e NIC :
74a4ee352fSCédric Le Goater
75a4ee352fSCédric Le Goater.. code-block:: bash
76a4ee352fSCédric Le Goater
77a4ee352fSCédric Le Goater  $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 \
78a4ee352fSCédric Le Goater  -accel tcg,thread=single \
79a4ee352fSCédric Le Goater  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0 \
80a4ee352fSCédric Le Goater  -netdev user,id=net0,hostfwd=::20022-:22,hostname=pnv \
81a4ee352fSCédric Le Goater  -kernel ./zImage.epapr  \
82a4ee352fSCédric Le Goater  -initrd ./rootfs.cpio.xz \
83a4ee352fSCédric Le Goater  -nographic
84a4ee352fSCédric Le Goater
85a4ee352fSCédric Le Goaterand a SATA disk :
86a4ee352fSCédric Le Goater
87a4ee352fSCédric Le Goater.. code-block:: bash
88a4ee352fSCédric Le Goater
89a4ee352fSCédric Le Goater  -device ich9-ahci,id=sata0,bus=pcie.1,addr=0x0 \
90a4ee352fSCédric Le Goater  -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \
91a4ee352fSCédric Le Goater  -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \
92a4ee352fSCédric Le Goater
93a4ee352fSCédric Le GoaterComplex PCIe configuration
94a4ee352fSCédric Le Goater~~~~~~~~~~~~~~~~~~~~~~~~~~
9558c49ef5SLeonardo Garcia
96a4ee352fSCédric Le GoaterSix PHBs are defined per chip (POWER9) but no default PCI layout is
97a4ee352fSCédric Le Goaterprovided (to be compatible with libvirt). One PCI device can be added
98a4ee352fSCédric Le Goateron any of the available PCIe slots using command line options such as:
99a4ee352fSCédric Le Goater
100a4ee352fSCédric Le Goater.. code-block:: bash
101a4ee352fSCédric Le Goater
102a4ee352fSCédric Le Goater  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0
103a4ee352fSCédric Le Goater  -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=hostnet0
104a4ee352fSCédric Le Goater
105a4ee352fSCédric Le Goater  -device megasas,id=scsi0,bus=pcie.0,addr=0x0
106a4ee352fSCédric Le Goater  -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none
107a4ee352fSCédric Le Goater  -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
108a4ee352fSCédric Le Goater
109a4ee352fSCédric Le GoaterHere is a full example with two different storage controllers on
110a4ee352fSCédric Le Goaterdifferent PHBs, each with a disk, the second PHB is empty :
111a4ee352fSCédric Le Goater
112a4ee352fSCédric Le Goater.. code-block:: bash
113a4ee352fSCédric Le Goater
114a4ee352fSCédric Le Goater  $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 -accel tcg,thread=single \
115a4ee352fSCédric Le Goater  -kernel ./zImage.epapr -initrd ./rootfs.cpio.xz -bios ./skiboot.lid \
116a4ee352fSCédric Le Goater  \
117a4ee352fSCédric Le Goater  -device megasas,id=scsi0,bus=pcie.0,addr=0x0 \
118a4ee352fSCédric Le Goater  -drive file=./rhel7-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none \
119a4ee352fSCédric Le Goater  -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 \
120a4ee352fSCédric Le Goater  \
121a4ee352fSCédric Le Goater  -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 \
122a4ee352fSCédric Le Goater  \
123a4ee352fSCédric Le Goater  -device ich9-ahci,id=sata0,bus=bridge1,addr=0x1 \
124a4ee352fSCédric Le Goater  -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \
125a4ee352fSCédric Le Goater  -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \
126a4ee352fSCédric Le Goater  -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=bridge1,addr=0x2 \
127a4ee352fSCédric Le Goater  -netdev bridge,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=net0 \
128a4ee352fSCédric Le Goater  -device nec-usb-xhci,bus=bridge1,addr=0x7 \
129a4ee352fSCédric Le Goater  \
130a4ee352fSCédric Le Goater  -serial mon:stdio -nographic
131a4ee352fSCédric Le Goater
132a4ee352fSCédric Le GoaterYou can also use VIRTIO devices :
133a4ee352fSCédric Le Goater
134a4ee352fSCédric Le Goater.. code-block:: bash
135a4ee352fSCédric Le Goater
136a4ee352fSCédric Le Goater  -drive file=./fedora-ppc64le.qcow2,if=none,snapshot=on,id=drive0 \
137a4ee352fSCédric Le Goater  -device virtio-blk-pci,drive=drive0,id=blk0,bus=pcie.0 \
138a4ee352fSCédric Le Goater  \
139a4ee352fSCédric Le Goater  -netdev tap,helper=/usr/lib/qemu/qemu-bridge-helper,br=virbr0,id=netdev0 \
140a4ee352fSCédric Le Goater  -device virtio-net-pci,netdev=netdev0,id=net0,bus=pcie.1 \
141a4ee352fSCédric Le Goater  \
142a4ee352fSCédric Le Goater  -fsdev local,id=fsdev0,path=$HOME,security_model=passthrough \
143a4ee352fSCédric Le Goater  -device virtio-9p-pci,fsdev=fsdev0,mount_tag=host,bus=pcie.2
144a4ee352fSCédric Le Goater
145a4ee352fSCédric Le GoaterMulti sockets
146a4ee352fSCédric Le Goater~~~~~~~~~~~~~
147a4ee352fSCédric Le Goater
148a4ee352fSCédric Le GoaterThe number of sockets is deduced from the number of CPUs and the
149a4ee352fSCédric Le Goaternumber of cores. ``-smp 2,cores=1`` will define a machine with 2
150a4ee352fSCédric Le Goatersockets of 1 core, whereas ``-smp 2,cores=2`` will define a machine
151a4ee352fSCédric Le Goaterwith 1 socket of 2 cores. ``-smp 8,cores=2``, 4 sockets of 2 cores.
152a4ee352fSCédric Le Goater
153a4ee352fSCédric Le GoaterBMC configuration
154a4ee352fSCédric Le Goater~~~~~~~~~~~~~~~~~
155a4ee352fSCédric Le Goater
156a4ee352fSCédric Le GoaterOpenPOWER systems negotiate the shutdown and reboot with their
157a4ee352fSCédric Le GoaterBMC. The QEMU PowerNV machine embeds an IPMI BMC simulator using the
158a4ee352fSCédric Le GoateriBT interface and should offer the same power features.
159a4ee352fSCédric Le Goater
160a4ee352fSCédric Le GoaterIf you want to define your own BMC, use ``-nodefaults`` and specify
161a4ee352fSCédric Le Goaterone on the command line :
162a4ee352fSCédric Le Goater
163a4ee352fSCédric Le Goater.. code-block:: bash
164a4ee352fSCédric Le Goater
165a4ee352fSCédric Le Goater  -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10
166a4ee352fSCédric Le Goater
167a4ee352fSCédric Le GoaterThe files `palmetto-SDR.bin <http://www.kaod.org/qemu/powernv/palmetto-SDR.bin>`__
168a4ee352fSCédric Le Goaterand `palmetto-FRU.bin <http://www.kaod.org/qemu/powernv/palmetto-FRU.bin>`__
169a4ee352fSCédric Le Goaterdefine a Sensor Data Record repository and a Field Replaceable Unit
17058c49ef5SLeonardo Garciainventory for a Palmetto BMC. They can be used to extend the QEMU BMC
171a4ee352fSCédric Le Goatersimulator.
172a4ee352fSCédric Le Goater
173a4ee352fSCédric Le Goater.. code-block:: bash
174a4ee352fSCédric Le Goater
175a4ee352fSCédric Le Goater  -device ipmi-bmc-sim,sdrfile=./palmetto-SDR.bin,fruareasize=256,frudatafile=./palmetto-FRU.bin,id=bmc0 \
176a4ee352fSCédric Le Goater  -device isa-ipmi-bt,bmc=bmc0,irq=10
177a4ee352fSCédric Le Goater
178a4ee352fSCédric Le GoaterThe PowerNV machine can also be run with an external IPMI BMC device
179a4ee352fSCédric Le Goaterconnected to a remote QEMU machine acting as BMC, using these options
180a4ee352fSCédric Le Goater:
181a4ee352fSCédric Le Goater
182a4ee352fSCédric Le Goater.. code-block:: bash
183a4ee352fSCédric Le Goater
18496e610b2SDaniil Tatianin  -chardev socket,id=ipmi0,host=localhost,port=9002,reconnect-ms=10000 \
185a4ee352fSCédric Le Goater  -device ipmi-bmc-extern,id=bmc0,chardev=ipmi0 \
186a4ee352fSCédric Le Goater  -device isa-ipmi-bt,bmc=bmc0,irq=10 \
187a4ee352fSCédric Le Goater  -nodefaults
188a4ee352fSCédric Le Goater
189a4ee352fSCédric Le GoaterNVRAM
190a4ee352fSCédric Le Goater~~~~~
191a4ee352fSCédric Le Goater
192a4ee352fSCédric Le GoaterUse a MTD drive to add a PNOR to the machine, and get a NVRAM :
193a4ee352fSCédric Le Goater
194a4ee352fSCédric Le Goater.. code-block:: bash
195a4ee352fSCédric Le Goater
196a4ee352fSCédric Le Goater  -drive file=./witherspoon.pnor,format=raw,if=mtd
197a4ee352fSCédric Le Goater
198*80f93213SNicholas PigginIf no mtd drive is provided, the powernv platform will create a default
199*80f93213SNicholas PigginPNOR device using a tiny formatted PNOR in pc-bios/pnv-pnor.bin opened
200*80f93213SNicholas Pigginread-only (PNOR changes will be persistent across reboots but not across
201*80f93213SNicholas Piggininvocations of QEMU). If no defaults are used, an erased 128MB PNOR is
202*80f93213SNicholas Pigginprovided (which skiboot will probably not recognize since it is not
203*80f93213SNicholas Pigginformatted).
204*80f93213SNicholas Piggin
20558c49ef5SLeonardo GarciaMaintainer contact information
20658c49ef5SLeonardo Garcia------------------------------
20758c49ef5SLeonardo Garcia
20858c49ef5SLeonardo GarciaCédric Le Goater <clg@kaod.org>
209