Skip to content

Early serial on Power

Shawn Anastasio xen-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 11 repliesIn review
  2. v44 patches 7 repliesSuperseded
  3. v33 patches 8 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches10 repliesSuperseded
v14 patches13 repliesSuperseded

Changes in v5 from the cover letter

- (xen/macros.h) Add signoff
- (xen/macros.h) Fix up comment formatting and macro parameter names
- (*.S) Use 8-space column alignment for assembly
- (of-call.S) Add missing space after comma
- (asm-offsets.c) Fix DEFINE() macro formatting
- (asm-offsets.c) Replace _Static_assert with BUILD_BUG_ON

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4common: Move a few more standalone macros from xen/lib.h to xen/macros.hxen/include/xen/lib.h xen/include/xen/macros.h+34 -280 replies
2/4xen/ppc: Set up a basic C environmentxen/arch/ppc/Makefile xen/arch/ppc/include/asm/asm-defns.h xen/arch/ppc/include/asm/config.h +2 more+80 -211 reply
3/4xen/ppc: Implement early serial printk on pseriesxen/arch/ppc/Kconfig.debug xen/arch/ppc/Makefile xen/arch/ppc/boot-of.c +15 more+596 -37 replies
4/4automation: Add smoke test for ppc64leautomation/gitlab-ci/test.yaml automation/scripts/qemu-smoke-ppc64le.sh+47 -02 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJan BeulichStefano StabelliniJiamei Xie
1/4R-b
2/4A-b
3/4A-b
4/4R-b R-b R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/4] Early serial on Power

Hello all,

This series adds support for early serial printing on Power, as well as a simple CI smoke test modeled after the riscv one.

The first patch is responsible for setting up a basic C environment with an initial stack while the second sets up an Open Firmware serial console and primitive early_printk infrastructure.

This will currently only run on QEMU pseries VMs, since the firmware interface on bare metal differs significantly. Support for bare metal will be added in a future series along with support for the position-independent code model.

Thanks,
Shawn

--
Changes in v5:
- (xen/macros.h) Add signoff
- (xen/macros.h) Fix up comment formatting and macro parameter names
- (*.S) Use 8-space column alignment for assembly
- (of-call.S) Add missing space after comma
- (asm-offsets.c) Fix DEFINE() macro formatting
- (asm-offsets.c) Replace _Static_assert with BUILD_BUG_ON

Changes in v4:
- Add macros.h patch for ARRAY_SIZE
- Based on v3 of Jan's "common: move a few macros out of xen/lib.h"
- (head.S) Remove unnecessary '.section .init.data'
- (head.S) Fixup spacing, remove unnecessary parens
- (setup.c, processor.h) Fix style of HMT_very_low macro
- (early_printk.c) Build early_printk.c as .init.o
- (early_printk.c) Mark putchar_func as __initdata
- (boot-of.c) Clarify original license in top comment
- (boot-of.c) Add parens around ADDR macro definition
- (boot-of.c) Add missing ADDR() for pointer arguments
- (boot-of.c) Add comment explaining ADDR macro
- (boot-of.c) Fix style (indentation, comment capitalization)
- (boot-of.c) Fix type inconsistency in boot-of.c
- (boot-of.c) Use ARRAY_SIZE instead of hard-coding nrets
- (boot-of.c) Change bof_chosen variable to function-scope
- (processor.h) Remove duplicate <xen/types.h> include
- (processor.h) Remove unnecessary <xen/config.h> include
- (processor.h) Move HMT_very_low macro to !defined(ASSEMBLY) block
- (processor.h) Fixup struct cpu_user_regs comment style

Changes in v3:
- Set up r2 TOC pointer in start
- Change indirect call to start_xen to a direct one
- Use 32-bit constant loads for stack pointer, etc. in start
- Our load address is < 4GB so this works fine
- In a future series we'll get -fPIC working and change all of these immediate address loads to TOC-relative ones.
- Move .bss initialization to patch 2
- Move cpu0_boot_stack declaration to setup.c
- Bump stack size down to one page (64k), previous was way overkill.
- Remove unnecessary STACK_FRAME_OVERHEAD component from of-call.S stack frame size calculation
- Add assertion that struct cpu_user_regs is stack-aligned
- Move magic or 31,31,31 to appropriately-named macro
- Fix formatting of loop in setup.c
- Add newline in arch/ppc/Makefile to preserve alphabetical ordering per group
- Rebase on staging, including the final version of 'xen/types: Rework stdint vs __{u,s}$N types'

Changes in v2:
- Split main patch into two - one for basic C environment setup and one for serial
- Mark OpenFirmware functions and early_printk functions as __init and change boot-of.o to boot-of.init.o in Makefile
- Change <xen/lib.h> include to <xen/stdarg.h> and drop skeleton headers that are no longer necessary for build as a result
- Add loop to clear .bss before jumping to C environment that was accidentally excluded from the first series
- Move common asm macros from processor.h to asm-defns.h
- Change note in head.S about preserved registers to a multi-line comment so it's more noticeable
- Drop reg-defs.h and use '%'-prefixed register names in assembly
- This is necessary since -mregnames, which allows standard non-prefixed register names without manual macro definitions, is not supported by LLVM's assembler.
- Drop inline asm swab routines in favor of __builtin_bswap family
- Fix up types.h in accordance with (as of now, unmerged) 'xen/types: Rework stdint vs __{u,s}$N types'
- Remove unnecessary braces for single-line statements
- Remove unnecessary license text when SPDX header is present
- Fix alphabetical ordering of object declarations in Makefile
- Drop 'extern' from enter_of prototype, ensure prototypes have argument names

Shawn Anastasio (4):
common: Move a few more standalone macros from xen/lib.h to
xen/macros.h
xen/ppc: Set up a basic C environment
xen/ppc: Implement early serial printk on pseries
automation: Add smoke test for ppc64le

 automation/gitlab-ci/test.yaml           |  20 ++++
 automation/scripts/qemu-smoke-ppc64le.sh |  27 +++++
 xen/arch/ppc/Kconfig.debug               |   5 +
 xen/arch/ppc/Makefile                    |   4 +
 xen/arch/ppc/boot-of.c                   | 113 +++++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig     |   1 +
 xen/arch/ppc/early_printk.c              |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h     |  57 ++++++++++
 xen/arch/ppc/include/asm/boot.h          |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h     |  12 ++
 xen/arch/ppc/include/asm/config.h        |   5 +-
 xen/arch/ppc/include/asm/early_printk.h  |  15 +++
 xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h     | 138 +++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h         |  21 ++++
 xen/arch/ppc/ppc64/Makefile              |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c         |  58 ++++++++++
 xen/arch/ppc/ppc64/head.S                |  47 ++++----
 xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
 xen/arch/ppc/setup.c                     |  32 ++++++
 xen/include/xen/lib.h                    |  28 -----
 xen/include/xen/macros.h                 |  34 ++++++
 22 files changed, 754 insertions(+), 49 deletions(-)
 create mode 100755 automation/scripts/qemu-smoke-ppc64le.sh
 create mode 100644 xen/arch/ppc/boot-of.c
 create mode 100644 xen/arch/ppc/early_printk.c
 create mode 100644 xen/arch/ppc/include/asm/asm-defns.h
 create mode 100644 xen/arch/ppc/include/asm/boot.h
 create mode 100644 xen/arch/ppc/include/asm/byteorder.h
 create mode 100644 xen/arch/ppc/include/asm/early_printk.h
 create mode 100644 xen/arch/ppc/include/asm/msr.h
 create mode 100644 xen/arch/ppc/include/asm/processor.h
 create mode 100644 xen/arch/ppc/include/asm/types.h
 create mode 100644 xen/arch/ppc/ppc64/of-call.S
 create mode 100644 xen/arch/ppc/setup.c

--
2.30.2