No description
  • C 88.5%
  • Shell 5.3%
  • Batchfile 2.8%
  • Makefile 0.9%
  • Python 0.8%
  • Other 1.7%
Find a file
Aditya Gupta 181c672b49 platforms/astbmc: Fix a double-free bug
When booting on an everest system, the following MCE came up:

    [  334.315296915,6] IPMI: Requesting IPMI_BMC_GET_DEVICE_ID
    [  334.315370226,6] IPMI: setting power state: sys 80, dev 7f
    [  334.361601128,7] IPMI: Got error response. cmd=0x6, netfn=0x7, rc=0xff
    [  334.366806544,7] IPMI: Got error response. cmd=0x2e, netfn=0x7, rc=0xd5
    [  334.371997654,3] ***********************************************
    [  334.372091331,3] Fatal MCE at 0000000030044f40   .ipmi_free_msg+0x6c  MSR 9000000000201002
    [  334.372180466,3] Cause: load/store to control real address
    [  334.372238658,3] CFAR : 0000000030044f08 MSR  : 9000000000201002
    [  334.372298247,3] SRR0 : 0000000030044f40 SRR1 : 9000000000201002
    [  334.372365988,3] HSRR0: 0000000030020024 HSRR1: 9000000000001000
    [  334.372425367,3] DSISR: 00000008         DAR  : 99999999999999a9
    [  334.372463651,3] LR   : 0000000030044ee8 CTR  : 000000003000336c
    [  334.372510261,3] CR   : 40000004         XER  : 20040000
    ...
    [  334.373063187,3] GPR09: 9999999999999999 GPR25: 00000000301205f5
    ...
    CPU 0848 Backtrace:
     S: 0000000035e53bf0 R: 0000000030044ee8   .ipmi_free_msg+0x14
     S: 0000000035e53c80 R: 00000000300b7e84   .astbmc_ipmi_enable_bits.isra.0+0x140
     S: 0000000035e53d10 R: 00000000300b801c   .astbmc_init+0xdc
     S: 0000000035e53d90 R: 00000000300415dc   .generic_platform_init+0x7c
     S: 0000000035e53e10 R: 0000000030023dd8   .main_cpu_entry+0x754
     S: 0000000035e53f00 R: 000000003000322c   go_primary+0x114
     --- OPAL boot ---

Above MCE happens due to 'astbmc_ipmi_enable_bits' trying to free the
message with 'ipmi_free_msg', in case of any ipmi errors.

But 'ipmi_queue_msg_sync' already frees the message (with msg->error(),
which points to ipmi_free_msg), in case of errors.

So the free done by astbmc_ipmi_enable_bits in case of errors is not
required, as ipmi code already takes care of freeing the message in case
of errors.

Remove the ipmi_free_msg call in astbmc_ipmi_enable_bits as the message
is already freed by ipmi code in case of errors

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
2026-09-04 09:02:41 -05:00
.github opal-ci: Add ubuntu-26.04 2026-05-29 14:02:54 -05:00
asm Initial Power11 enablement 2025-03-07 08:40:53 -06:00
ccan ccan: sync to upstream ccan.git commit ca7c5a9e04f3 2021-12-09 11:09:01 +01:00
core mem_region: Fix unused-but-set-variable error 2026-05-29 14:03:22 -05:00
doc gcov: Document sysfs interface 2025-04-02 10:35:28 -05:00
external external: Avoid parallelized 'make check' issues 2026-09-04 09:02:41 -05:00
hdata Revert "hdata/test: Build with -Wno-error=unterminated-string-initialization" 2025-04-04 09:02:39 -05:00
hw uart: Handle read failure case in UART communication 2025-05-16 09:44:44 -05:00
include external/opal-prd: Fix compilation error 2025-09-23 09:09:49 -05:00
libc libc: Add ENXIO error code 2023-09-12 14:22:11 -05:00
libfdt libfdt: sync to upstream dtc.git commit 45f3d1a095dd 2021-12-09 11:09:01 +01:00
libflash ipmi: Return error from ipmi_queue_msg_sync 2025-04-18 09:42:50 -05:00
libmctp libmctp: Import libmctp library handling MCTP protocol 2023-09-12 14:22:11 -05:00
libpore hw/slw: Move P8 bits behind CONFIG_P8 2022-01-03 16:12:45 +01:00
libstb crypto/mbedtls: Fix unused-but-set-variable error 2026-05-29 14:02:55 -05:00
libxz build: use thin archives rather than incremental linking 2018-02-28 20:28:39 -06:00
opal-ci opal-ci: Add ubuntu-26.04 2026-05-29 14:02:54 -05:00
platforms platforms/astbmc: Fix a double-free bug 2026-09-04 09:02:41 -05:00
pldm external/opal-prd: Fix compilation error 2025-09-23 09:09:49 -05:00
test opal-ci: Update qemu command line to test booting up 2023-01-19 09:47:16 -06:00
.gitignore ci: Remove debian-jessie boot test. 2019-03-28 18:19:41 +11:00
CONTRIBUTING.md doc: Further document development and release process 2018-05-22 02:50:56 -05:00
coverity-model.c lock: Add additional lock auditing code 2017-12-20 22:15:36 -06:00
extract-gcov.c extract-gcov: Add checksum field 2025-04-02 10:35:28 -05:00
LICENCE Initial commit of Open Source release 2014-07-02 15:36:20 +10:00
make_offsets.sh Re-license IBM written files as Apache 2.0 OR GPLv2+ 2020-03-12 20:33:18 +11:00
make_version.sh Use $() rather than backticks in all shell 2018-09-13 15:19:36 +10:00
Makefile libmctp: Import libmctp library handling MCTP protocol 2023-09-12 14:22:11 -05:00
Makefile.main Support cross compiling on AArch64 2025-12-23 08:36:17 -06:00
Makefile.rules Fix grep warning in Makefile.rules 2026-05-13 08:51:45 -05:00
README.md README: Update path to fetch a kernel image 2021-11-05 18:51:12 +01:00
skiboot.lds.S hdata: Remove legacy SPIRA structure 2023-10-11 15:07:23 -05:00
skiboot.spec skiboot.spec: Update to v5.10 release 2018-03-01 20:17:54 -06:00

skiboot

Firmware for OpenPower systems.

Source: https://github.com/open-power/skiboot

Mailing list: skiboot@lists.ozlabs.org

Info/subscribe: https://lists.ozlabs.org/listinfo/skiboot

Archives: https://lists.ozlabs.org/pipermail/skiboot/

Patchwork: http://patchwork.ozlabs.org/project/skiboot/list/

Documentation: http://open-power.github.io/skiboot/doc/index.html

Overview

OPAL firmware (OpenPower Abstraction Layer) comes in several parts.

A simplified flow of what happens when the power button is pressed is:

  1. The baseboard management controller (BMC) powers the system on.
  2. The BMC selects the master chip and releases the self-boot engines (SBEs) on the POWER8 chips, master last.
  3. The BMC relinquishes control of the flexible service interface (FSI) SCAN/SCOM engines.
  4. The hostboot firmware IPLs the system. It initiates a secondary power-on sequence through a digital power systems sweep (DPSS).
  5. The hostboot firmware loads the OPAL image and moves all processors to their execution starting points.

Here, the OPAL image is three parts:

  1. skiboot (includes OPAL runtime services)
  2. skiroot - the bootloader environment
    • kernel
    • initramfs (containing petitboot bootloader)

They may be all part of one payload or three separate images (depending on platform).

The bootloader will kexec a host kernel (probably linux). The host OS can make OPAL calls. The OPAL API is documented in doc/opal-api/ (there are missing parts, patches are welcome!)

See doc/overview.rst for a more in depth overview of skiboot.

Building

Any host OS can build and test skiboot provided it has a C cross compiler for big endian powerpc64. All good Linux distributions (and several bad ones) provide a packaged compiler that can be installed through the usual package management tools.

To build on Ubuntu:

apt-get install gcc-powerpc64le-linux-gnu gcc valgrind \
	expect libssl-dev device-tree-compiler make \
	xz-utils libmbedtls-dev
CROSS=powerpc64le-linux-gnu- make -j`nproc`

To build on Fedora:

dnf install gcc-powerpc64le-linux-gnu binutils-powerpc64-linux-gnu gcc make \
    diffutils findutils expect valgrind-devel dtc openssl-devel xz \
    mbedtls-devel
CROSS=powerpc64le-linux-gnu- make -j`nproc`

(The little-endian powerpc64le compilers in Ubuntu and Fedora are actually bi-endian and can compile skiboot even though it's big-endian. We recommend installing a little-endian toolchain if you plan on building other projects.)

On any POWER system with a bi-endian system compiler:

CROSS="" make -j`nproc`

Alternatively, pre-built cross compilers for x86 systems can be downloaded from here: https://www.kernel.org/pub/tools/crosstool/ When using these compilers add /opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/ to your PATH. Once this is done skiboot can be compiler by just running make

Building Documentation

We use Sphinx to produce various documentation from reStructuredText (preferred) and Markdown. The Sphinx documentation has a useful primer for reStructuredText here. And the docutils website has a nice quick reference for the basic constructes.

Building on Fedora

dnf install python3-sphinx python3-recommonmark.noarch
pip install -r doc/requirements.txt
make -C doc/ html SPHINXBUILD=sphinx-build-3

On Ubuntu:

Patches welcome!

View the output using doc/_build/html/index.html

Testing

Skiboot comes with a set of unit tests that can be run on your desktop. They can can be run with:

make check

To test in a simulator, install the IBM POWER8 Functional Simulator from: http://www-304.ibm.com/support/customercare/sas/f/pwrfs/home.html Also see external/mambo/README.md

Qemu as of version 2.8 implements the 'powernv' machine model and is sufficient to run skiboot:

qemu-system-ppc64 -M powernv -m 3G -nographic -L /path/to/skiboot/

To run a boot-to-bootloader test you need a Linux kernel image 'zImage.epapr'. Build one using the opal_defconfig config for op-build. See https://github.com/open-power/op-build/ on how to build, or download one from https://github.com/open-power/op-build/releases/ .

Drop zImage.epapr in the skiboot directory and the skiboot test suite will automatically pick it up. You can also run a combined skiboot and Linux test in Qemu (version 3.0+):

qemu-system-ppc64 -M powernv -m 3G -nographic -kernel zImage.epapr -L /path/to/skiboot/

See opal-ci/README for further testing instructions.

To test on real hardware, you will need to understand how to flash new skiboot onto your system. This will vary from platform to platform.

You may want to start with external/boot-tests/boot_test.sh as it can (provided the correct usernames/passwords) automatically flash a new skiboot onto ASTBMC based OpenPower machines.

Hacking

All patches should be sent to the mailing list with linux-kernel style 'Signed-Off-By'. The following git commands are your friends:

git commit -s
git format-patch

You probably want to read the linux https://kernel.org/doc/html/latest/process/submitting-patches.html as much of it applies to skiboot.

Output files

The Skiboot build process produces a bunch of different outputs. This is what they are, and where you should use them:

skiboot.elf: The output of the linker. Don't flash to a system, but useful when debugging

skiboot.lid: The raw binary object, named .lid because IBM. Flash this on really old P8 systems, the POWER Functional Simulator (mambo), or FSP systems

skiboot.lid.stb: Lid wrapped with secure boot header. Use on FSP systems

skiboot.lid.xz: Compressed raw binary. Use this on a OpenPower P8

skiboot.lid.xz.stb: Compressed raw binary wrapped with a secure boot header. Use this on OpenPower P9 systems

License

See LICENSE