[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 3/4] xen/ppc: Implement early serial printk on pseries
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |