gitlab: Extract default build/test jobs templates
[qemu/ar7.git] / docs / system / ppc / powernv.rst
blob43c58bc32e763167c92aa3f0720a37f3bbcc247e
1 PowerNV family boards (``powernv8``, ``powernv9``)
2 ==================================================================
4 PowerNV (as Non-Virtualized) is the "baremetal" platform using the
5 OPAL firmware. It runs Linux on IBM and OpenPOWER systems and it can
6 be used as an hypervisor OS, running KVM guests, or simply as a host
7 OS.
9 The PowerNV QEMU machine tries to emulate a PowerNV system at the
10 level of the skiboot firmware, which loads the OS and provides some
11 runtime services. Power Systems have a lower firmware (HostBoot) that
12 does low level system initialization, like DRAM training. This is
13 beyond the scope of what QEMU addresses today.
15 Supported devices
16 -----------------
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)
23  * POWER8 PHB3 PCIe Host bridge and POWER9 PHB4 PCIe Host bridge
24  * Simple OCC is an on-chip microcontroller used for power management
25    tasks
26  * iBT device to handle BMC communication, with the internal BMC
27    simulator provided by QEMU or an external BMC such as an Aspeed
28    QEMU machine.
29  * PNOR containing the different firmware partitions.
31 Missing devices
32 ---------------
34 A lot is missing, among which :
36  * POWER10 processor
37  * XIVE2 (POWER10) interrupt controller
38  * I2C controllers (yet to be merged)
39  * NPU/NPU2/NPU3 controllers
40  * EEH support for PCIe Host bridge controllers
41  * NX controller
42  * VAS controller
43  * chipTOD (Time Of Day)
44  * Self Boot Engine (SBE).
45  * FSI bus
47 Firmware
48 --------
50 The OPAL firmware (OpenPower Abstraction Layer) for OpenPower systems
51 includes the runtime services `skiboot` and the bootloader kernel and
52 initramfs `skiroot`. Source code can be found on GitHub:
54   https://github.com/open-power.
56 Prebuilt images of `skiboot` and `skiboot` are made available on the `OpenPOWER <https://openpower.xyz/job/openpower/job/openpower-op-build/>`__ site. To boot a POWER9 machine, use the `witherspoon <https://openpower.xyz/job/openpower/job/openpower-op-build/label=slave,target=witherspoon/lastSuccessfulBuild/>`__ images. For POWER8, use
57 the `palmetto <https://openpower.xyz/job/openpower/job/openpower-op-build/label=slave,target=palmetto/lastSuccessfulBuild/>`__ images.
59 QEMU includes a prebuilt image of `skiboot` which is updated when a
60 more recent version is required by the models.
62 Boot options
63 ------------
65 Here is a simple setup with one e1000e NIC :
67 .. code-block:: bash
69   $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 \
70   -accel tcg,thread=single \
71   -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0 \
72   -netdev user,id=net0,hostfwd=::20022-:22,hostname=pnv \
73   -kernel ./zImage.epapr  \
74   -initrd ./rootfs.cpio.xz \
75   -nographic
77 and a SATA disk :
79 .. code-block:: bash
81   -device ich9-ahci,id=sata0,bus=pcie.1,addr=0x0 \
82   -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \
83   -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \
85 Complex PCIe configuration
86 ~~~~~~~~~~~~~~~~~~~~~~~~~~
87 Six PHBs are defined per chip (POWER9) but no default PCI layout is
88 provided (to be compatible with libvirt). One PCI device can be added
89 on any of the available PCIe slots using command line options such as:
91 .. code-block:: bash
93   -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=pcie.0,addr=0x0
94   -netdev bridge,id=net0,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=hostnet0
96   -device megasas,id=scsi0,bus=pcie.0,addr=0x0
97   -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none
98   -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
100 Here is a full example with two different storage controllers on
101 different PHBs, each with a disk, the second PHB is empty :
103 .. code-block:: bash
105   $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 -accel tcg,thread=single \
106   -kernel ./zImage.epapr -initrd ./rootfs.cpio.xz -bios ./skiboot.lid \
107   \
108   -device megasas,id=scsi0,bus=pcie.0,addr=0x0 \
109   -drive file=./rhel7-ppc64le.qcow2,if=none,id=drive-scsi0-0-0-0,format=qcow2,cache=none \
110   -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 \
111   \
112   -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 \
113   \
114   -device ich9-ahci,id=sata0,bus=bridge1,addr=0x1 \
115   -drive file=./ubuntu-ppc64le.qcow2,if=none,id=drive0,format=qcow2,cache=none \
116   -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1 \
117   -device e1000e,netdev=net0,mac=C0:FF:EE:00:00:02,bus=bridge1,addr=0x2 \
118   -netdev bridge,helper=/usr/libexec/qemu-bridge-helper,br=virbr0,id=net0 \
119   -device nec-usb-xhci,bus=bridge1,addr=0x7 \
120   \
121   -serial mon:stdio -nographic
123 You can also use VIRTIO devices :
125 .. code-block:: bash
127   -drive file=./fedora-ppc64le.qcow2,if=none,snapshot=on,id=drive0 \
128   -device virtio-blk-pci,drive=drive0,id=blk0,bus=pcie.0 \
129   \
130   -netdev tap,helper=/usr/lib/qemu/qemu-bridge-helper,br=virbr0,id=netdev0 \
131   -device virtio-net-pci,netdev=netdev0,id=net0,bus=pcie.1 \
132   \
133   -fsdev local,id=fsdev0,path=$HOME,security_model=passthrough \
134   -device virtio-9p-pci,fsdev=fsdev0,mount_tag=host,bus=pcie.2
136 Multi sockets
137 ~~~~~~~~~~~~~
139 The number of sockets is deduced from the number of CPUs and the
140 number of cores. ``-smp 2,cores=1`` will define a machine with 2
141 sockets of 1 core, whereas ``-smp 2,cores=2`` will define a machine
142 with 1 socket of 2 cores. ``-smp 8,cores=2``, 4 sockets of 2 cores.
144 BMC configuration
145 ~~~~~~~~~~~~~~~~~
147 OpenPOWER systems negotiate the shutdown and reboot with their
148 BMC. The QEMU PowerNV machine embeds an IPMI BMC simulator using the
149 iBT interface and should offer the same power features.
151 If you want to define your own BMC, use ``-nodefaults`` and specify
152 one on the command line :
154 .. code-block:: bash
156   -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10
158 The files `palmetto-SDR.bin <http://www.kaod.org/qemu/powernv/palmetto-SDR.bin>`__
159 and `palmetto-FRU.bin <http://www.kaod.org/qemu/powernv/palmetto-FRU.bin>`__
160 define a Sensor Data Record repository and a Field Replaceable Unit
161 inventory for a palmetto BMC. They can be used to extend the QEMU BMC
162 simulator.
164 .. code-block:: bash
166   -device ipmi-bmc-sim,sdrfile=./palmetto-SDR.bin,fruareasize=256,frudatafile=./palmetto-FRU.bin,id=bmc0 \
167   -device isa-ipmi-bt,bmc=bmc0,irq=10
169 The PowerNV machine can also be run with an external IPMI BMC device
170 connected to a remote QEMU machine acting as BMC, using these options
173 .. code-block:: bash
175   -chardev socket,id=ipmi0,host=localhost,port=9002,reconnect=10 \
176   -device ipmi-bmc-extern,id=bmc0,chardev=ipmi0 \
177   -device isa-ipmi-bt,bmc=bmc0,irq=10 \
178   -nodefaults
180 NVRAM
181 ~~~~~
183 Use a MTD drive to add a PNOR to the machine, and get a NVRAM :
185 .. code-block:: bash
187   -drive file=./witherspoon.pnor,format=raw,if=mtd
189 CAVEATS
190 -------
192  * No support for multiple HW threads (SMT=1). Same as pseries.
193  * CPU can hang when doing intensive I/Os. Use ``-append powersave=off`` in that case.