[RFC PATCH 00/10] OPAL V4

Nicholas Piggin npiggin at gmail.com
Sat May 2 21:19:04 AEST 2020


"OPAL V4" is a proposed new approach to running and calling PowerNV
OPAL firmware.

OPAL calls use the caller's (kernel) stack, which vastly simplifies
re-entrancy concerns around doing things like idle and machine check
OPAL drivers.

The OS can get at symbol and assert metadata to help with debugging
firmware.

OPAL may be called (and will run in) virtual mode in its own address
space.

And the operating system provides some services to the firmware,
message logging, for example.

This fairly close to the point where we could run OPAL in user-mode
with a few services (scv could be used to call back to the OS) for
privileged instructions, we may yet do this, but one thing that's
stopped me is it would require a slower API. As it is now with LE
skiboot and LE Linux, the OPAL call is basically a shared-library
function call, which is fast enough that it's feasible to
implement a performant CPU idle driver, which is a significant
motivation.

Anyway this is up and running, coming together pretty well just needs
a bit of polishing and more documentation. I'll post the skiboot
patches on the skiboot list.

Nicholas Piggin (10):
  kallsyms: architecture specific symbol lookups
  powerpc/powernv: Wire up OPAL address lookups
  powerpc/powernv: Use OPAL_REPORT_TRAP to cope with trap interrupts
    from OPAL
  powerpc/powernv: avoid polling in opal_get_chars
  powerpc/powernv: Don't translate kernel addresses to real addresses
    for OPAL
  powerpc/powernv: opal use new opal call entry point if it exists
  powerpc/powernv: Add OPAL_FIND_VM_AREA API
  powerpc/powernv: Set up an mm context to call OPAL in
  powerpc/powernv: OPAL V4 OS services
  powerpc/powernv: OPAL V4 Implement vm_map/unmap service

 arch/powerpc/Kconfig                          |   1 +
 arch/powerpc/boot/opal.c                      |   5 +
 arch/powerpc/include/asm/opal-api.h           |  29 +-
 arch/powerpc/include/asm/opal.h               |   8 +
 arch/powerpc/kernel/traps.c                   |  39 ++-
 arch/powerpc/perf/imc-pmu.c                   |   4 +-
 arch/powerpc/platforms/powernv/npu-dma.c      |   2 +-
 arch/powerpc/platforms/powernv/opal-call.c    |  58 ++++
 arch/powerpc/platforms/powernv/opal-dump.c    |   2 +-
 arch/powerpc/platforms/powernv/opal-elog.c    |   4 +-
 arch/powerpc/platforms/powernv/opal-flash.c   |   6 +-
 arch/powerpc/platforms/powernv/opal-hmi.c     |   2 +-
 arch/powerpc/platforms/powernv/opal-nvram.c   |   4 +-
 .../powerpc/platforms/powernv/opal-powercap.c |   2 +-
 arch/powerpc/platforms/powernv/opal-psr.c     |   2 +-
 arch/powerpc/platforms/powernv/opal-xscom.c   |   2 +-
 arch/powerpc/platforms/powernv/opal.c         | 289 ++++++++++++++++--
 arch/powerpc/platforms/powernv/pci-ioda.c     |   2 +-
 arch/powerpc/sysdev/xive/native.c             |   2 +-
 drivers/char/powernv-op-panel.c               |   3 +-
 drivers/i2c/busses/i2c-opal.c                 |  12 +-
 drivers/mtd/devices/powernv_flash.c           |   4 +-
 include/linux/kallsyms.h                      |  20 ++
 kernel/kallsyms.c                             |  13 +-
 lib/Kconfig                                   |   3 +
 25 files changed, 461 insertions(+), 57 deletions(-)

-- 
2.23.0



More information about the Linuxppc-dev mailing list