[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] xen/ppc: Implement early serial printk on pseries


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 21 Jun 2023 18:54:11 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3AYRt7QxRC2fSL000Yk2bLEx49lbLczuJNH2BPJKuzk=; b=fYlnlXoPWsgGS/kpop/6y9WWougOLKtu+g5j2mTQQo7smONQGx5rbWVAhoNo8yO63G5cTSBRgdMRwYszPf4yD0NdL7k8WpHuGDovg2CsLWYJnqUPDOnaspG259IdJD5VUC5AkDBoVwLB/ZSQGAgG0RpvCt155tqsP2+GMJKFNMwwS1mQgrErAQwXoSoSlaQSNifGjwffJ+AUS0Kq+Z4aThNcd2W2LK348GtGjS/PskM25MXTVrOcRmh5YqYozDTMerqq5HyU/6l/dN7YQJE7JcwNfpwD8B3KwA7DgDCkiK5vSjb0OTIoKe/phAj3vNtc2ULv54vdTKMo/oXTeV6AxQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HV6GRVJ/CfLXzlqbkus5FaXEVb/Vq4dqx1mnNO3WSP3AJzCQzDzgHilmkjzO1xuzPlHL3s9jXK+fW2kdOCxpP0bRaw5RnhsrG3OLHwBOCTngafDRTUXmmGZn7AECfrZPl473rj+E6zMxsgMJdV+A7Qi0uxUA6PIJW2TSMoJ3LGZkrKE/t+akq5ouxuQLA7nynOkzBxf+VsvT23AzjDvd3CWHfxcpSnygSc7CLQTs75GxbK4sETZOwZtmkwsvYlJu6pQgku3vBp6W0RRn/grG/yQt50Ot0XL3CeOb4NfHdGEAGSulmAROCMGajfzyH+fxX2Msigsw4nf7OLFGkdU8+w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: tpearson@xxxxxxxxxxxxxxxxxxxxx, Shawn Anastasio <shawnanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 21 Jun 2023 17:54:52 +0000
  • Ironport-data: A9a23:Ni9gxKvv2C916gE23Whl8F0yZufnVKJfMUV32f8akzHdYApBsoF/q tZmKW+CPPaKazH1fYhybd+18h9Uv5ODydVhGwFkqS1gQyob+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Fv0gnRkPaoQ5AGEziFJZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwOh0kfh7emb6M3JmWb9VP3ucEIPC2BdZK0p1g5Wmx4fcOZ7nmGv2PyfoGmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osgP60aIa9lt+iHK25mm6xo G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOThraA10AbOlwT/DjUEb2Wmg9OQgHeQQo0Ac EpT6xMn87ULoRnDot7VGkfQTGS/lgUVXdNLD+Qh6Qal0KPM/wGDC24LTzhMZcYnssBwTjsvv neZktWsCTFxvbm9TXOG6qzSvT60ITISL2IJeWkDVwRty8X7rYgplRXJZsxqCLKylNDzFjD2z j2QrS4xwb4UiKYjzKWy4lbOhTu3upHSTwkd/AzPQmW/4wV2ZYioapap71ed5vFFRLt1VXGEt XkA3sSbsuYHCMjVkDTXGb1RWra0+/yCLTvQx0Z1GIUs/Cis/Hjlep1M5DZ5JwFiNcNslSLVX XI/cDh5vPd7VEZGp4cuC25tI6zGFZTdKOk=
  • Ironport-hdrordr: A9a23:+Ee9wq8VDksXe9+IAu9uk+DJI+orL9Y04lQ7vn2ZKCY5TiX8ra vFoB11726WtN9vYgBDpTntAse9qBDnmaKdg7NwAV7KZmCPhILCFu5fBOXZogEIEheOk9Jg6Q ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21/06/2023 5:59 pm, Shawn Anastasio wrote:
>  xen/arch/ppc/Kconfig.debug              |   5 +
>  xen/arch/ppc/Makefile                   |   3 +
>  xen/arch/ppc/boot-of.c                  | 116 +++++++++++++
>  xen/arch/ppc/configs/ppc64_defconfig    |   1 +
>  xen/arch/ppc/early_printk.c             |  28 +++
>  xen/arch/ppc/include/asm/boot.h         |  24 +++
>  xen/arch/ppc/include/asm/bug.h          |   6 +
>  xen/arch/ppc/include/asm/byteorder.h    |  37 ++++
>  xen/arch/ppc/include/asm/cache.h        |   6 +
>  xen/arch/ppc/include/asm/early_printk.h |  15 ++
>  xen/arch/ppc/include/asm/msr.h          |  67 ++++++++
>  xen/arch/ppc/include/asm/processor.h    | 207 ++++++++++++++++++++++
>  xen/arch/ppc/include/asm/reg_defs.h     | 218 ++++++++++++++++++++++++
>  xen/arch/ppc/include/asm/string.h       |   6 +
>  xen/arch/ppc/include/asm/types.h        |  35 ++++
>  xen/arch/ppc/ppc64/Makefile             |   1 +
>  xen/arch/ppc/ppc64/asm-offsets.c        |  55 ++++++
>  xen/arch/ppc/ppc64/head.S               |  48 +++---
>  xen/arch/ppc/ppc64/of-call.S            |  85 +++++++++
>  xen/arch/ppc/setup.c                    |  31 ++++
>  20 files changed, 972 insertions(+), 22 deletions(-)
>  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/boot.h
>  create mode 100644 xen/arch/ppc/include/asm/bug.h
>  create mode 100644 xen/arch/ppc/include/asm/byteorder.h
>  create mode 100644 xen/arch/ppc/include/asm/cache.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/reg_defs.h
>  create mode 100644 xen/arch/ppc/include/asm/string.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

This is a surprising amount of infrastructure.  I'm guessing it's a
consequence of needing byteorder ?

There's a series still out deleting swathes of junk in byteorder.  I
guess I need to kick that thread again, but it mostly boils down to
using __builtin_bswap$N() (and on x86, reimplementing them on old enough
compilers).  Presumably all versions of GCC (and eventually Clang) we
care to support with ppc64 understand this builtin ?

I've noticed a couple of other things.  asm/types.h repeats some
antipatterns which we're trying to delete for MISRA reasons in other
architectures.  I was already planning to fix that up xen-wide, and I
guess now is the better time to do so.

Elsewhere, you've got a number of __inline__'s.  We think those are all
vestigial now, so should be switched to using a plain inline.

Also, there are a bunch of UL() or ULL() macros which encoding a
difference between asm and C.  In Xen, we use _AC() for that, which you
can find in <xen/const.h>.

Similarly, there are some functions which ought to be __init, so it
would be good to get them correct from the start.


Maybe as an intermediate step, just get the infinite loop moved from asm
up into C?  That gets the stack setup, and various of the asm helpers,
without all the rest of the C required to get early_printk() to work.

Something we've been trying very hard to do generally is declutter
processor.h, and on x86, we've got asm-defns.h as a more appropriate
place to have the stuff which is expected to be common to all asm code,
and never encountered in C.

A couple of questions before I dive further in.

Given:

#define r0  0

do the assemblers really not understand register names?  That seems mad.

Also, given the transformations to call into OpenFirmware, presumably
this limits Xen to running below the 4G boundary and on identity mappings?

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.