mbox series

[v2,0/3] Early serial on Power

Message ID cover.1687466822.git.sanastasio@raptorengineering.com (mailing list archive)
Headers show
Series Early serial on Power | expand

Message

Shawn Anastasio June 22, 2023, 8:57 p.m. UTC
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 and a cleared .bss while the second sets up an Open
Firmware serial console and primitive early_printk infrastructure.

Of note is that this series is currently based on the following series
from Andrew Cooper: '[PATCH 0/2] xen/types: Cleanup'
(https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg01601.html)

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.

Thanks,
Shawn

--
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 (3):
  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                    |   3 +
 xen/arch/ppc/boot-of.c                   | 100 +++++++++++++++++
 xen/arch/ppc/configs/ppc64_defconfig     |   1 +
 xen/arch/ppc/early_printk.c              |  28 +++++
 xen/arch/ppc/include/asm/asm-defns.h     |  53 +++++++++
 xen/arch/ppc/include/asm/boot.h          |  23 ++++
 xen/arch/ppc/include/asm/byteorder.h     |  12 ++
 xen/arch/ppc/include/asm/early_printk.h  |  15 +++
 xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
 xen/arch/ppc/include/asm/processor.h     | 136 +++++++++++++++++++++++
 xen/arch/ppc/include/asm/types.h         |  21 ++++
 xen/arch/ppc/ppc64/Makefile              |   1 +
 xen/arch/ppc/ppc64/asm-offsets.c         |  55 +++++++++
 xen/arch/ppc/ppc64/head.S                |  55 +++++----
 xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
 xen/arch/ppc/setup.c                     |  28 +++++
 19 files changed, 697 insertions(+), 20 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

Comments

Jan Beulich June 23, 2023, 6:42 a.m. UTC | #1
On 22.06.2023 22:57, Shawn Anastasio wrote:
> 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

What is this about? There's no change to non-ppc files here
according to ...

>  automation/gitlab-ci/test.yaml           |  20 ++++
>  automation/scripts/qemu-smoke-ppc64le.sh |  27 +++++
>  xen/arch/ppc/Kconfig.debug               |   5 +
>  xen/arch/ppc/Makefile                    |   3 +
>  xen/arch/ppc/boot-of.c                   | 100 +++++++++++++++++
>  xen/arch/ppc/configs/ppc64_defconfig     |   1 +
>  xen/arch/ppc/early_printk.c              |  28 +++++
>  xen/arch/ppc/include/asm/asm-defns.h     |  53 +++++++++
>  xen/arch/ppc/include/asm/boot.h          |  23 ++++
>  xen/arch/ppc/include/asm/byteorder.h     |  12 ++
>  xen/arch/ppc/include/asm/early_printk.h  |  15 +++
>  xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
>  xen/arch/ppc/include/asm/processor.h     | 136 +++++++++++++++++++++++
>  xen/arch/ppc/include/asm/types.h         |  21 ++++
>  xen/arch/ppc/ppc64/Makefile              |   1 +
>  xen/arch/ppc/ppc64/asm-offsets.c         |  55 +++++++++
>  xen/arch/ppc/ppc64/head.S                |  55 +++++----
>  xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
>  xen/arch/ppc/setup.c                     |  28 +++++
>  19 files changed, 697 insertions(+), 20 deletions(-)

... this. Plus lib.h already includes stdarg.h.

Jan
Shawn Anastasio June 23, 2023, 2:27 p.m. UTC | #2
On 6/23/23 1:42 AM, Jan Beulich wrote:
> On 22.06.2023 22:57, Shawn Anastasio wrote:
>> 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
> 
> What is this about? There's no change to non-ppc files here
> according to ...
> 
>>  automation/gitlab-ci/test.yaml           |  20 ++++
>>  automation/scripts/qemu-smoke-ppc64le.sh |  27 +++++
>>  xen/arch/ppc/Kconfig.debug               |   5 +
>>  xen/arch/ppc/Makefile                    |   3 +
>>  xen/arch/ppc/boot-of.c                   | 100 +++++++++++++++++
>>  xen/arch/ppc/configs/ppc64_defconfig     |   1 +
>>  xen/arch/ppc/early_printk.c              |  28 +++++
>>  xen/arch/ppc/include/asm/asm-defns.h     |  53 +++++++++
>>  xen/arch/ppc/include/asm/boot.h          |  23 ++++
>>  xen/arch/ppc/include/asm/byteorder.h     |  12 ++
>>  xen/arch/ppc/include/asm/early_printk.h  |  15 +++
>>  xen/arch/ppc/include/asm/msr.h           |  51 +++++++++
>>  xen/arch/ppc/include/asm/processor.h     | 136 +++++++++++++++++++++++
>>  xen/arch/ppc/include/asm/types.h         |  21 ++++
>>  xen/arch/ppc/ppc64/Makefile              |   1 +
>>  xen/arch/ppc/ppc64/asm-offsets.c         |  55 +++++++++
>>  xen/arch/ppc/ppc64/head.S                |  55 +++++----
>>  xen/arch/ppc/ppc64/of-call.S             |  83 ++++++++++++++
>>  xen/arch/ppc/setup.c                     |  28 +++++
>>  19 files changed, 697 insertions(+), 20 deletions(-)
> 
> ... this. Plus lib.h already includes stdarg.h.

Sorry, that was a bit ambiguous on my part. I meant that I changed

  #include <xen/lib.h>

to

  #include <xen/stdarg.h>

in arch/ppc/boot-of.c to reduce the number of headers
that I needed to create in arch/ppc/include/asm in order for the build
to work. lib.h includes (directly and indirectly) many things from asm/
but stdarg.h is mostly standalone.

> Jan

Thanks,
Shawn