[Skiboot] [PATCH v8 00/28] little endian skiboot
Nicholas Piggin
npiggin at gmail.com
Thu Nov 28 17:24:14 AEDT 2019
A few reasons for this:
- The rest of the software is moving (moved) to LE. BE is still
supported, but the fact is LE will be better tested from now on in
terms of toolchain.
- ELFv2 ABI is a smaller image, nicer asm code. We can use ELFv2 with BE
but toolchain won't officially support or test it.
- Some levels of OpenPOWER ISA allow a conforming implementation to
implement LE only.
- Less stack usage of ELFv2 facilitates OPAL call convention that uses
the host kernel stack (which is a whole different story but has
benefits).
- Common endian with the host kernel can help with debugging skiboot
with host kernel facilities (like BUG, xmon). We could achieve the
same by teaching kernel about different endianness, but it's more work.
Notably missing from conversion:
- PHB3
- NPU and CAPI code
- PEL logs
POWER8 / XICS, XICS-on-XIVE, VAS, and niche features have not been
tested with LE yet, but at this point it's complete enough that it's
easy to work on and improve so I think it is ready for proper submission
now. For the most part, big endian builds should be minimally impacted.
Since v1:
- Addressed review comments
- Added a missed endian conversion in hw/fsp/fsp.c
- Added a patch on the end to tidy up dt access
- xive patch is not for merge, (pending Cedric's stuff) but included
so the series can boot on real hardware.
Since v2:
- Remove a few bits of dead POWER7 code
Since v3:
- Several fixes to cvc code, including a stack trashing bug that would
sometimes result in skiboots that failed container verification,
depending on where the compiler put things.
Since v4:
- Converted several more pieces, ELF kernel loading (so LE skiboot can
load BE kernel), HMI, IPMI, SBE, MPIPL, FSP, ECC, PRD, etc.
- Paid more attention to sparse warnings, folded in some fixes found
by sparse, added some larger sparse cleanup patches.
- Sparse warnings have gone from 406 to 126 after this series, incorrect
type warnings from 296 to 66, and those all come from PHB3 and one HB
source file.
Since v5:
- Rebased on upstream.
- Cleaned up xive conversion with helper macros.
- Fix a memory scribble in upstream code.
- Squashed a few more sparse errors.
Since v6:
- Rebased on upstream and accounted for a bunch of comments.
- Moved preliminary patches out into another series.
- Fixed make check, prd, and some intermediate breakage.
Since v7:
- Reworked the sensor conversion a little bit to fit better with FSP
sensor code.
- Significant FSP additions and fixes, now boots on ZZ with BE and LE builds.
- Added debug_descriptor conversions.
- Minor fixes to a few places where diffing skiboot console between BE and LE
boot on ZZ showed some differences (e.g., some printf endian conversions).
- I left Vasant's ack on the FSP conversion patch even though it's
had a lot of changes, he may want to withdraw it.
Thanks,
Nick
Nicholas Piggin (28):
asm/cvc_entry.S: r2 save fix
capp: fix endian conversion
cpu: use dt accessor device tree access
opal-api: add endian conversions to most opal calls
elf: endian conversions
spira: fix endian conversions in spira data structures
hdata: endian conversions
naca: move naca definition from asm to C
io: endian conversions for io accessors
hmi: endian conversions
cvc: allow BE cvc code to be called from LE context
xive: make endian-clean
phb4: make endian-clean
occ sensors: make endian-clean
memconsole: make endian-clean
debug descriptor: make endian-clean
ipmi: endian conversion
sbe-p9: endian conversion
fsp: endian conversions
libflash: ecc endian conversions
prd: endian conversions
opal-dump: MPIPL endan conversions
sfc-ctrl: endian conversions
add little endian support
dt: assorted cleanups
add more sparse endian annotations
fix simple sparse warnings
i2c: fix wild dereference
Makefile.main | 38 ++-
asm/asm-offsets.c | 2 -
asm/cvc_entry.S | 51 ++-
asm/head.S | 116 +++----
core/console.c | 41 ++-
core/cpu.c | 26 +-
core/device.c | 25 +-
core/fdt.c | 6 +-
core/flash.c | 36 ++-
core/hmi.c | 20 +-
core/i2c.c | 4 +-
core/init.c | 106 +++---
core/interrupts.c | 15 +-
core/ipmi-opal.c | 6 +-
core/mem_region.c | 2 +-
core/opal-dump.c | 90 +++---
core/pci-opal.c | 98 ++++--
core/pci.c | 40 +--
core/platform.c | 2 +-
core/powercap.c | 14 +-
core/psr.c | 14 +-
core/sensor.c | 52 +--
core/trace.c | 25 +-
doc/stb.rst | 2 +-
hdata/Makefile.inc | 2 +-
hdata/fsp.c | 9 +-
hdata/hdata.h | 2 +
hdata/iohub.c | 33 +-
hdata/memory.c | 18 +-
hdata/naca.c | 26 ++
hdata/naca.h | 54 ++++
hdata/spira.c | 74 +++--
hdata/spira.h | 6 +-
hdata/test/hdata_to_dt.c | 3 +
hdata/test/op920.wsp.dts | 20 +-
hdata/test/p8-840-spira.dts | 14 +-
hdata/test/p81-811.spira.dts | 23 +-
hdata/tpmrel.c | 2 +-
hw/ast-bmc/ast-sf-ctrl.c | 5 +-
hw/capp.c | 2 +-
hw/dts.c | 12 +-
hw/fake-rtc.c | 11 +-
hw/fsp/fsp-attn.c | 4 +-
hw/fsp/fsp-codeupdate.c | 48 +--
hw/fsp/fsp-codeupdate.h | 86 ++---
hw/fsp/fsp-console.c | 99 +++---
hw/fsp/fsp-diag.c | 2 +-
hw/fsp/fsp-dpo.c | 6 +-
hw/fsp/fsp-dump.c | 33 +-
hw/fsp/fsp-elog-read.c | 18 +-
hw/fsp/fsp-elog-write.c | 11 +-
hw/fsp/fsp-epow.c | 12 +-
hw/fsp/fsp-ipmi.c | 8 +-
hw/fsp/fsp-leds.c | 107 ++++---
hw/fsp/fsp-mem-err.c | 6 +-
hw/fsp/fsp-nvram.c | 14 +-
hw/fsp/fsp-occ.c | 8 +-
hw/fsp/fsp-op-panel.c | 22 +-
hw/fsp/fsp-rtc.c | 42 +--
hw/fsp/fsp-sensor.c | 45 ++-
hw/fsp/fsp-surveillance.c | 1 +
hw/fsp/fsp-sysdump.c | 2 +-
hw/fsp/fsp-sysparam.c | 30 +-
hw/fsp/fsp.c | 44 +--
hw/imc.c | 12 +-
hw/ipmi/ipmi-rtc.c | 11 +-
hw/ipmi/ipmi-sel.c | 2 +-
hw/lpc-rtc.c | 11 +-
hw/lpc-uart.c | 16 +-
hw/lpc.c | 8 +-
hw/npu2-opencapi.c | 12 +-
hw/occ-sensor.c | 113 ++++---
hw/occ.c | 46 +--
hw/phb4.c | 344 ++++++++++----------
hw/prd.c | 64 ++--
hw/psi.c | 10 +-
hw/sbe-p9.c | 2 +-
hw/sfc-ctrl.c | 19 +-
hw/slw.c | 10 +-
hw/vas.c | 8 +-
hw/xive.c | 389 ++++++++++++-----------
hw/xscom.c | 19 +-
include/asm-utils.h | 22 +-
include/console.h | 22 +-
include/cpu.h | 5 +-
include/debug_descriptor.h | 26 +-
include/device.h | 4 +-
include/dts.h | 2 +-
include/elf.h | 235 +++++++++-----
include/fsp-attn.h | 2 +-
include/fsp-elog.h | 4 +-
include/fsp-leds.h | 24 +-
include/fsp.h | 14 +-
include/io.h | 79 ++++-
include/ipmi.h | 2 +-
include/mem-map.h | 2 +
include/occ.h | 52 +--
include/opal-api.h | 14 +-
include/opal-internal.h | 4 +-
include/phb4.h | 2 +-
include/platform.h | 2 +-
include/skiboot.h | 2 +-
include/spcn.h | 18 +-
include/stack.h | 6 +
include/types.h | 4 +
include/xive-p9-regs.h | 51 +--
include/xive-regs.h | 26 ++
include/xive.h | 2 +-
libc/stdlib/labs.c | 2 +-
libflash/ecc.c | 36 ++-
libflash/ecc.h | 8 +-
libflash/ipmi-hiomap.c | 20 +-
libflash/mbox-flash.c | 28 +-
libflash/test/mbox-server.c | 31 +-
libpore/p9_cpu_reg_restore_instruction.H | 23 +-
libstb/cvc.c | 16 +-
libstb/cvc.h | 2 +-
libstb/secureboot.c | 2 +-
platforms/astbmc/common.c | 4 +-
platforms/astbmc/p8dtu.c | 2 +-
platforms/astbmc/p9dsu.c | 2 +-
platforms/astbmc/vesnin.c | 8 +-
platforms/astbmc/witherspoon.c | 6 +-
platforms/ibm-fsp/common.c | 25 +-
platforms/ibm-fsp/firenze-pci.c | 89 +++---
platforms/ibm-fsp/hostservices.c | 16 +-
platforms/ibm-fsp/ibm-fsp.h | 2 +-
platforms/ibm-fsp/lxvpd.c | 6 +-
platforms/ibm-fsp/lxvpd.h | 44 ++-
platforms/mambo/mambo.c | 9 +-
skiboot.lds.S | 5 +
131 files changed, 2281 insertions(+), 1622 deletions(-)
create mode 100644 hdata/naca.c
create mode 100644 hdata/naca.h
--
2.23.0
More information about the Skiboot
mailing list