powerpc improvements
v2 cover powerpc improvements
This series aims to add a couple of new powerpc tests and improve the powerpc build structure.
This is originally Nick's work. The last version (v10) of which can be seen here :
https://lore.kernel.org/linuxppc-dev/[email protected]/
Couple of patches from the series are already merged.
Since it has been 2 years since this series was posted, I originally posted this as a RFC. This v1 series has changes accomodating the review comments received in the RFC :
https://lore.kernel.org/kvm/[email protected]/
v1:
https://lore.kernel.org/kvm/[email protected]/
I have rebased the patches to the upstream state.
For the patches which did not require any changes in the existing upstream code, I have retained the "Reviewed-by"s and "Acked-by" (patch 3,5 & 6) from Nick's series. I have also added Andrew's "Reviewed-by" received on patch 2 in the RFC. Nick had originally introduced powernv tests as well. Removed it for now since it was causing CI failure in the current upstream.
Link to Gitlab tree with patches :
https://gitlab.com/rathc/kvm-unit-tests/-/tree/ppc64
Link to Gitlab pipeline :
https://gitlab.com/rathc/kvm-unit-tests/-/pipelines/2688519679
Change log from RFC to v1:
1. Patch 2: Added Andrew's "Reviewed-by".
2. Patch 4: Removed usage of gitlab-ci group to run test - Thomas It would be nice to make use of the gitlab-ci group, but doing the change of all archs would make sense in a separate series. I look forward to doing that.
3. Patch 6: Removed addition of panic test in gitlab-ci group - Thomas
There was a discussion on the build failing in Travis CI with Clang, in the RFC, which I have addressed there.
Change log from v1 to v2:
Patch 4: Addressed all comments by Thomas :
1. Removed extra blank line.
2. Removed accel=kvm test from gitlab-ci.
3. smp = 2 preserved in atmoics test.
Nicholas Piggin (6):
powerpc: add pmu tests
configure: Make arch_libdir a first-class entity
powerpc: Remove remnants of ppc64 directory and build structure
powerpc: gitlab CI update
scripts/arch-run.bash: Fix run_panic() success exit status
powerpc: Add a panic test
.gitlab-ci.yml | 18 +-
MAINTAINERS | 1 -
Makefile | 2 +-
configure | 21 +-
lib/{ppc64 => powerpc}/asm-offsets.c | 0
lib/{ppc64 => powerpc}/asm/asm-offsets.h | 0
lib/{ppc64 => powerpc}/asm/atomic.h | 0
lib/{ppc64 => powerpc}/asm/barrier.h | 4 +-
lib/{ppc64 => powerpc}/asm/bitops.h | 4 +-
lib/{ppc64 => powerpc}/asm/io.h | 4 +-
lib/{ppc64 => powerpc}/asm/mmu.h | 0
lib/{ppc64 => powerpc}/asm/opal.h | 4 +-
lib/{ppc64 => powerpc}/asm/page.h | 6 +-
lib/{ppc64 => powerpc}/asm/pgtable-hwdef.h | 6 +-
lib/{ppc64 => powerpc}/asm/pgtable.h | 2 +-
lib/powerpc/asm/processor.h | 2 +
lib/{ppc64 => powerpc}/asm/ptrace.h | 6 +-
lib/powerpc/asm/reg.h | 9 +
lib/powerpc/asm/rtas.h | 1 +
lib/powerpc/asm/setup.h | 1 +
lib/powerpc/asm/spinlock.h | 6 +
lib/powerpc/asm/stack.h | 3 +
lib/{ppc64 => powerpc}/asm/vpa.h | 0
lib/{ppc64 => powerpc}/mmu.c | 0
lib/{ppc64 => powerpc}/opal-calls.S | 0
lib/{ppc64 => powerpc}/opal.c | 0
lib/powerpc/rtas.c | 16 +
lib/powerpc/setup.c | 20 +
lib/{ppc64 => powerpc}/stack.c | 0
lib/ppc64/.gitignore | 1 -
lib/ppc64/asm/handlers.h | 1 -
lib/ppc64/asm/hcall.h | 1 -
lib/ppc64/asm/memory_areas.h | 6 -
lib/ppc64/asm/ppc_asm.h | 1 -
lib/ppc64/asm/processor.h | 1 -
lib/ppc64/asm/reg.h | 1 -
lib/ppc64/asm/rtas.h | 1 -
lib/ppc64/asm/setup.h | 1 -
lib/ppc64/asm/smp.h | 1 -
lib/ppc64/asm/spinlock.h | 6 -
lib/ppc64/asm/stack.h | 11 -
lib/ppc64/asm/time.h | 1 -
powerpc/Makefile | 111 +++-
powerpc/Makefile.common | 94 ----
powerpc/Makefile.ppc64 | 31 --
powerpc/pmu.c | 567 +++++++++++++++++++++
powerpc/run | 2 +-
powerpc/selftest.c | 17 +-
powerpc/unittests.cfg | 8 +
scripts/arch-run.bash | 1 +
50 files changed, 806 insertions(+), 194 deletions(-)
rename lib/{ppc64 => powerpc}/asm-offsets.c (100%)
rename lib/{ppc64 => powerpc}/asm/asm-offsets.h (100%)
rename lib/{ppc64 => powerpc}/asm/atomic.h (100%)
rename lib/{ppc64 => powerpc}/asm/barrier.h (83%)
rename lib/{ppc64 => powerpc}/asm/bitops.h (69%)
rename lib/{ppc64 => powerpc}/asm/io.h (50%)
rename lib/{ppc64 => powerpc}/asm/mmu.h (100%)
rename lib/{ppc64 => powerpc}/asm/opal.h (90%)
rename lib/{ppc64 => powerpc}/asm/page.h (94%)
rename lib/{ppc64 => powerpc}/asm/pgtable-hwdef.h (93%)
rename lib/{ppc64 => powerpc}/asm/pgtable.h (99%)
rename lib/{ppc64 => powerpc}/asm/ptrace.h (89%)
create mode 100644 lib/powerpc/asm/spinlock.h
rename lib/{ppc64 => powerpc}/asm/vpa.h (100%)
rename lib/{ppc64 => powerpc}/mmu.c (100%)
rename lib/{ppc64 => powerpc}/opal-calls.S (100%)
rename lib/{ppc64 => powerpc}/opal.c (100%)
rename lib/{ppc64 => powerpc}/stack.c (100%)
delete mode 100644 lib/ppc64/.gitignore
delete mode 100644 lib/ppc64/asm/handlers.h
delete mode 100644 lib/ppc64/asm/hcall.h
delete mode 100644 lib/ppc64/asm/memory_areas.h
delete mode 100644 lib/ppc64/asm/ppc_asm.h
delete mode 100644 lib/ppc64/asm/processor.h
delete mode 100644 lib/ppc64/asm/reg.h
delete mode 100644 lib/ppc64/asm/rtas.h
delete mode 100644 lib/ppc64/asm/setup.h
delete mode 100644 lib/ppc64/asm/smp.h
delete mode 100644 lib/ppc64/asm/spinlock.h
delete mode 100644 lib/ppc64/asm/stack.h
delete mode 100644 lib/ppc64/asm/time.h
delete mode 100644 powerpc/Makefile.common
delete mode 100644 powerpc/Makefile.ppc64
create mode 100644 powerpc/pmu.cSignature · 1 line
2.53.0
PATCH v2 1/6 powerpc: add pmu tests
From: Nicholas Piggin <[email protected]>
Add some initial PMU testing.
- PMC5/6 tests
- PMAE / PMI test
- BHRB basic tests
--- lib/powerpc/asm/processor.h | 2 + lib/powerpc/asm/reg.h | 9 + lib/powerpc/asm/setup.h | 1 + lib/powerpc/setup.c | 20 ++ powerpc/Makefile.common | 3 +- powerpc/pmu.c | 567 ++++++++++++++++++++++++++++++++++++ powerpc/unittests.cfg | 3 + 7 files changed, 604 insertions(+), 1 deletion(-) create mode 100644 powerpc/pmu.c
lib/powerpc/asm/processor.h +2 -0
@@ -17,6 +17,8 @@ extern bool cpu_has_hv;extern bool cpu_has_power_mce;extern bool cpu_has_siar;extern bool cpu_has_heai; +extern bool cpu_has_bhrb; +extern bool cpu_has_p10_bhrb;extern bool cpu_has_radix;extern bool cpu_has_prefix;extern bool cpu_has_sc_lev;
lib/powerpc/asm/reg.h +9 -0
@@ -40,10 +40,19 @@#define SPR_LPIDR 0x13f#define SPR_HEIR 0x153#define SPR_PTCR 0x1d0 +#define SPR_MMCRA 0x312 +#define MMCRA_BHRBRD UL(0x0000002000000000) +#define MMCRA_IFM_MASK UL(0x00000000c0000000) +#define SPR_PMC5 0x317 +#define SPR_PMC6 0x318#define SPR_MMCR0 0x31b#define MMCR0_FC UL(0x80000000) +#define MMCR0_FCP UL(0x20000000)#define MMCR0_PMAE UL(0x04000000) +#define MMCR0_BHRBA UL(0x00200000) +#define MMCR0_FCPC UL(0x00001000)#define MMCR0_PMAO UL(0x00000080) +#define MMCR0_FC56 UL(0x00000010)#define SPR_SIAR 0x31c/* Machine State Register definitions: */
lib/powerpc/asm/setup.h +1 -0
@@ -10,6 +10,7 @@#define NR_CPUS 8/* arbitrarily set for now */ extern uint64_t tb_hz; +extern uint64_t cpu_hz;#define NR_MEM_REGIONS 8#define MR_F_PRIMARY (1U << 0)
lib/powerpc/setup.c +20 -0
@@ -33,6 +33,7 @@ u32 initrd_size;u32 cpu_to_hwid[NR_CPUS ] = { [0 ...NR_CPUS -1 ] = (~0U ) };int nr_cpus_present;uint64_t tb_hz; +uint64_t cpu_hz;struct mem_region mem_regions[NR_MEM_REGIONS ];phys_addr_t __physical_start, __physical_end;
@@ -42,6 +43,7 @@ struct cpu_set_params {unsigned icache_bytes;unsigned dcache_bytes;uint64_t tb_hz; +uint64_t cpu_hz; };static void cpu_set (int fdtnode,u64 regval,void *info)
@@ -95,6 +97,19 @@ static void cpu_set(int fdtnode, u64 regval, void *info) data = (u32 *)prop->data; params->tb_hz =fdt32_to_cpu (*data); + prop =fdt_get_property (dt_fdt (), fdtnode, +"ibm,extended-clock-frequency" ,NULL ); +if (prop) { +u64 *data64 = (u64 *)prop->data; + params->cpu_hz =fdt64_to_cpu (*data64); + }else { + prop =fdt_get_property (dt_fdt (), fdtnode, +"clock-frequency" ,NULL ); +assert (prop !=NULL ); + data = (u32 *)prop->data; + params->cpu_hz =fdt32_to_cpu (*data); + } + read_common_info = true; } }
@@ -103,6 +118,8 @@ bool cpu_has_hv;bool cpu_has_power_mce;/* POWER CPU machine checks */ bool cpu_has_siar;bool cpu_has_heai; +bool cpu_has_bhrb; +bool cpu_has_p10_bhrb;bool cpu_has_radix;bool cpu_has_prefix;bool cpu_has_sc_lev;/* sc interrupt has LEV field in SRR1 */
@@ -119,12 +136,14 @@ static void cpu_init_params(void) __icache_bytes = params.icache_bytes; __dcache_bytes = params.dcache_bytes; tb_hz = params.tb_hz; + cpu_hz = params.cpu_hz;switch (mfspr (SPR_PVR ) &PVR_VERSION_MASK ) {case PVR_VER_POWER10 : cpu_has_prefix = true; cpu_has_sc_lev = true; cpu_has_pause_short = true; + cpu_has_p10_bhrb = true;case PVR_VER_POWER9 : cpu_has_radix = true;case PVR_VER_POWER8E :
@@ -133,6 +152,7 @@ static void cpu_init_params(void) cpu_has_power_mce = true; cpu_has_heai = true; cpu_has_siar = true; + cpu_has_bhrb = true;break ;default :break ;
powerpc/Makefile.common +2 -1
@@ -18,7 +18,8 @@ tests-common = \ $(TEST_DIR)/sprs.elf \ $(TEST_DIR)/timebase.elf \ $(TEST_DIR)/interrupts.elf \ - $(TEST_DIR)/mmu.elf + $(TEST_DIR)/mmu.elf \ + $(TEST_DIR)/pmu.elf tests-all = $(tests-common) $(tests) all: directories $(TEST_DIR)/boot_rom.bin $(tests-all)
powerpc/pmu.c new file +567 -0
567 lines not on this page · raw message
powerpc/unittests.cfg +3 -0
@@ -75,6 +75,9 @@ file = interrupts.elf file = mmu.elf smp = 2 +[pmu] +file = pmu.elf + [smp] file = smp.elf smp = 2
Signature · 1 line
2.53.0
PATCH v2 2/6 configure: Make arch_libdir a first-class entity
In reply to Chinmay RathFrom: Nicholas Piggin <[email protected]>
arch_libdir was brought in to improve the heuristic determination of the lib/ directory based on arch and testdir names, but it did not entirely clean that mess up.
Remove the arch_libdir->arch->testdir heuristic and just require everybody sets arch_libdir correctly. Fail if the lib/arch or lib/arch/asm directories can not be found.
--- Makefile | 2 +- configure | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-)
Makefile +1 -1
@@ -12,7 +12,7 @@ vpath %.s $(SRCDIR) vpath %.S $(SRCDIR) libdirs-get = $(shell [ -d "lib/$(1)" ] && echo "lib/$(1) lib/$(1)/asm") -ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) $(call libdirs-get,$(TEST_DIR)) +ARCH_LIBDIRS := $(call libdirs-get,$(ARCH_LIBDIR)) OBJDIRS := $(ARCH_LIBDIRS) DESTDIR := $(PREFIX)/share/kvm-unit-tests/
configure +12 -8
@@ -274,7 +274,6 @@ fi arch_name=$arch [ "$arch" = "aarch64" ] && arch="arm64" [ "$arch_name" = "arm64" ] && arch_name="aarch64" -arch_libdir=$arch if [ "$arch" = "riscv" ]; then echo "riscv32 or riscv64 must be specified"
@@ -373,8 +372,10 @@ fi if [ "$arch" = "i386" ] || [ "$arch" = "x86_64" ]; then testdir=x86 + arch_libdir=x86 elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then testdir=arm + arch_libdir=$arch if [ "$target" = "qemu" ]; then : "${uart_early_addr:=0x9000000}" elif [ "$target" = "kvmtool" ]; then
@@ -385,6 +386,7 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then fi elif [ "$arch" = "ppc64" ]; then testdir=powerpc + arch_libdir=ppc64 firmware="$testdir/boot_rom.bin" if [ "$endian" != "little" ] && [ "$endian" != "big" ]; then echo "You must provide endianness (big or little)!"
@@ -400,6 +402,7 @@ elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then fi elif [ "$arch" = "s390x" ]; then testdir=s390x + arch_libdir=s390x else echo "arch $arch is not supported!" arch=
@@ -409,6 +412,10 @@ if [ ! -d "$srcdir/$testdir" ]; then echo "$srcdir/$testdir does not exist!" exit 1 fi +if [ ! -d "$srcdir/lib/$arch_libdir" ]; then + echo "$srcdir/lib/$arch_libdir does not exist!" + exit 1 +fi if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then ln -fs "$srcdir/$testdir/efi/run" $testdir-run
@@ -471,15 +478,12 @@ fi # link lib/asm for the architecture rm -f lib/asm asm="asm-generic" -if [ -d "$srcdir/lib/$arch/asm" ]; then - asm="$srcdir/lib/$arch/asm" - mkdir -p "lib/$arch" -elif [ -d "$srcdir/lib/$arch_libdir/asm" ]; then +if [ -d "$srcdir/lib/$arch_libdir/asm" ]; then asm="$srcdir/lib/$arch_libdir/asm" mkdir -p "lib/$arch_libdir" -elif [ -d "$srcdir/lib/$testdir/asm" ]; then - asm="$srcdir/lib/$testdir/asm" - mkdir -p "lib/$testdir" +else + echo "$srcdir/lib/$arch_libdir/asm does not exist" + exit 1 fi ln -sf "$asm" lib/asm mkdir -p lib/generated lib/libfdt
Signature · 1 line
2.53.0
PATCH v2 3/6 powerpc: Remove remnants of ppc64 directory and build structure
In reply to Chinmay RathFrom: Nicholas Piggin <[email protected]>
This moves merges ppc64 directories and files into powerpc, and merges the 3 makefiles into one.
The configure --arch=powerpc option is aliased to ppc64 for good measure.
---
MAINTAINERS | 1 -
configure | 3 +-
lib/{ppc64 => powerpc}/asm-offsets.c | 0
lib/{ppc64 => powerpc}/asm/asm-offsets.h | 0
lib/{ppc64 => powerpc}/asm/atomic.h | 0
lib/{ppc64 => powerpc}/asm/barrier.h | 4 +-
lib/{ppc64 => powerpc}/asm/bitops.h | 4 +-
lib/{ppc64 => powerpc}/asm/io.h | 4 +-
lib/{ppc64 => powerpc}/asm/mmu.h | 0
lib/{ppc64 => powerpc}/asm/opal.h | 4 +-
lib/{ppc64 => powerpc}/asm/page.h | 6 +-
lib/{ppc64 => powerpc}/asm/pgtable-hwdef.h | 6 +-
lib/{ppc64 => powerpc}/asm/pgtable.h | 2 +-
lib/{ppc64 => powerpc}/asm/ptrace.h | 6 +-
lib/powerpc/asm/spinlock.h | 6 ++
lib/powerpc/asm/stack.h | 3 +
lib/{ppc64 => powerpc}/asm/vpa.h | 0
lib/{ppc64 => powerpc}/mmu.c | 0
lib/{ppc64 => powerpc}/opal-calls.S | 0
lib/{ppc64 => powerpc}/opal.c | 0
lib/{ppc64 => powerpc}/stack.c | 0
lib/ppc64/.gitignore | 1 -
lib/ppc64/asm/handlers.h | 1 -
lib/ppc64/asm/hcall.h | 1 -
lib/ppc64/asm/memory_areas.h | 6 --
lib/ppc64/asm/ppc_asm.h | 1 -
lib/ppc64/asm/processor.h | 1 -
lib/ppc64/asm/reg.h | 1 -
lib/ppc64/asm/rtas.h | 1 -
lib/ppc64/asm/setup.h | 1 -
lib/ppc64/asm/smp.h | 1 -
lib/ppc64/asm/spinlock.h | 6 --
lib/ppc64/asm/stack.h | 11 --
lib/ppc64/asm/time.h | 1 -
powerpc/Makefile | 111 ++++++++++++++++++++-
powerpc/Makefile.common | 95 ------------------
powerpc/Makefile.ppc64 | 31 ------
37 files changed, 139 insertions(+), 180 deletions(-)
rename lib/{ppc64 => powerpc}/asm-offsets.c (100%)
rename lib/{ppc64 => powerpc}/asm/asm-offsets.h (100%)
rename lib/{ppc64 => powerpc}/asm/atomic.h (100%)
rename lib/{ppc64 => powerpc}/asm/barrier.h (83%)
rename lib/{ppc64 => powerpc}/asm/bitops.h (69%)
rename lib/{ppc64 => powerpc}/asm/io.h (50%)
rename lib/{ppc64 => powerpc}/asm/mmu.h (100%)
rename lib/{ppc64 => powerpc}/asm/opal.h (90%)
rename lib/{ppc64 => powerpc}/asm/page.h (94%)
rename lib/{ppc64 => powerpc}/asm/pgtable-hwdef.h (93%)
rename lib/{ppc64 => powerpc}/asm/pgtable.h (99%)
rename lib/{ppc64 => powerpc}/asm/ptrace.h (89%)
create mode 100644 lib/powerpc/asm/spinlock.h
rename lib/{ppc64 => powerpc}/asm/vpa.h (100%)
rename lib/{ppc64 => powerpc}/mmu.c (100%)
rename lib/{ppc64 => powerpc}/opal-calls.S (100%)
rename lib/{ppc64 => powerpc}/opal.c (100%)
rename lib/{ppc64 => powerpc}/stack.c (100%)
delete mode 100644 lib/ppc64/.gitignore
delete mode 100644 lib/ppc64/asm/handlers.h
delete mode 100644 lib/ppc64/asm/hcall.h
delete mode 100644 lib/ppc64/asm/memory_areas.h
delete mode 100644 lib/ppc64/asm/ppc_asm.h
delete mode 100644 lib/ppc64/asm/processor.h
delete mode 100644 lib/ppc64/asm/reg.h
delete mode 100644 lib/ppc64/asm/rtas.h
delete mode 100644 lib/ppc64/asm/setup.h
delete mode 100644 lib/ppc64/asm/smp.h
delete mode 100644 lib/ppc64/asm/spinlock.h
delete mode 100644 lib/ppc64/asm/stack.h
delete mode 100644 lib/ppc64/asm/time.h
delete mode 100644 powerpc/Makefile.common
delete mode 100644 powerpc/Makefile.ppc64MAINTAINERS +0 -1
@@ -92,7 +92,6 @@ S: Maintained L: [email protected] F: powerpc/ F: lib/powerpc/ -F: lib/ppc64/ RISCV M: Andrew Jones <[email protected]>
configure +2 -1
@@ -273,6 +273,7 @@ fi arch_name=$arch [ "$arch" = "aarch64" ] && arch="arm64" +[ "$arch" = "powerpc" ] && arch="ppc64" [ "$arch_name" = "arm64" ] && arch_name="aarch64" if [ "$arch" = "riscv" ]; then
@@ -386,7 +387,7 @@ elif [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then fi elif [ "$arch" = "ppc64" ]; then testdir=powerpc - arch_libdir=ppc64 + arch_libdir=powerpc firmware="$testdir/boot_rom.bin" if [ "$endian" != "little" ] && [ "$endian" != "big" ]; then echo "You must provide endianness (big or little)!"
lib/powerpc/asm-offsets.c renamed from lib/ppc64/asm-offsets.c +0 -0
lib/powerpc/asm/asm-offsets.h renamed from lib/ppc64/asm/asm-offsets.h +0 -0
lib/powerpc/asm/atomic.h renamed from lib/ppc64/asm/atomic.h +0 -0
lib/powerpc/asm/barrier.h renamed from lib/ppc64/asm/barrier.h +2 -2
@@ -1,5 +1,5 @@ -#ifndef _ASMPPC64_BARRIER_H_ -#define _ASMPPC64_BARRIER_H_ +#ifndef _ASMPOWERPC_BARRIER_H_ +#define _ASMPOWERPC_BARRIER_H_#define cpu_relax () asm volatile("or 1,1,1 ; or 2,2,2" ::: "memory")#define pause_short () asm volatile(".long 0x7c40003c" ::: "memory")
lib/powerpc/asm/bitops.h renamed from lib/ppc64/asm/bitops.h +2 -2
@@ -1,5 +1,5 @@ -#ifndef _ASMPPC64_BITOPS_H_ -#define _ASMPPC64_BITOPS_H_ +#ifndef _ASMPOWERPC_BITOPS_H_ +#define _ASMPOWERPC_BITOPS_H_#ifndef _BITOPS_H_#error only <bitops.h> can be included directly
lib/powerpc/asm/io.h renamed from lib/ppc64/asm/io.h +2 -2
@@ -1,5 +1,5 @@ -#ifndef _ASMPPC64_IO_H_ -#define _ASMPPC64_IO_H_ +#ifndef _ASMPOWERPC_IO_H_ +#define _ASMPOWERPC_IO_H_#define __iomem
lib/powerpc/asm/mmu.h renamed from lib/ppc64/asm/mmu.h +0 -0
lib/powerpc/asm/opal.h renamed from lib/ppc64/asm/opal.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef _ASMPPC64_OPAL_H_ -#define _ASMPPC64_OPAL_H_ +#ifndef _ASMPOWERPC_OPAL_H_ +#define _ASMPOWERPC_OPAL_H_#include <stdint.h>
lib/powerpc/asm/page.h renamed from lib/ppc64/asm/page.h +3 -3
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _ASMPPC64_PAGE_H_ -#define _ASMPPC64_PAGE_H_ +#ifndef _ASMPOWERPC_PAGE_H_ +#define _ASMPOWERPC_PAGE_H_/* * Adapted from * lib/arm64/asm/page.h and Linux kernel defines.
@@ -62,4 +62,4 @@ extern unsigned long __phys_to_virt(phys_addr_t addr);extern void *__ioremap (phys_addr_t phys_addr,size_t size);#endif /* !__ASSEMBLER__ */ -#endif /* _ASMPPC64_PAGE_H_ */ +#endif /* _ASMPOWERPC_PAGE_H_ */
lib/powerpc/asm/pgtable-hwdef.h renamed from lib/ppc64/asm/pgtable-hwdef.h +3 -3
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _ASMPPC64_PGTABLE_HWDEF_H_ -#define _ASMPPC64_PGTABLE_HWDEF_H_ +#ifndef _ASMPOWERPC_PGTABLE_HWDEF_H_ +#define _ASMPOWERPC_PGTABLE_HWDEF_H_/* * Copyright (C) 2024, IBM Inc, Nicholas Piggin <[email protected]> *
@@ -63,4 +63,4 @@#define PHYS_MASK_SHIFT (48)#define PHYS_MASK ((UL(1) << PHYS_MASK_SHIFT) - 1) -#endif /* _ASMPPC64_PGTABLE_HWDEF_H_ */ +#endif /* _ASMPOWERPC_PGTABLE_HWDEF_H_ */
lib/powerpc/asm/pgtable.h renamed from lib/ppc64/asm/pgtable.h +1 -1
@@ -122,4 +122,4 @@ static inline pte_t *pte_alloc(pmd_t *pmd, unsigned long addr) return pte_offset(pmd, addr); } -#endif /* _ASMPPC64_PGTABLE_H_ */ +#endif /* _ASMPOWERPC_PGTABLE_H_ */
lib/powerpc/asm/ptrace.h renamed from lib/ppc64/asm/ptrace.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef _ASMPPC64_PTRACE_H_ -#define _ASMPPC64_PTRACE_H_ +#ifndef _ASMPOWERPC_PTRACE_H_ +#define _ASMPOWERPC_PTRACE_H_#define KERNEL_REDZONE_SIZE 288#define STACK_FRAME_OVERHEAD 112/* size of minimum stack frame */
@@ -38,4 +38,4 @@ static inline void regs_advance_insn(struct pt_regs *regs)#endif /* __ASSEMBLER__ */ -#endif /* _ASMPPC64_PTRACE_H_ */ +#endif /* _ASMPOWERPC_PTRACE_H_ */
lib/powerpc/asm/spinlock.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _ASMPOWERPC_SPINLOCK_H_ +#define _ASMPOWERPC_SPINLOCK_H_ + +#include <asm-generic/spinlock.h> + +#endif /* _ASMPOWERPC_SPINLOCK_H_ */
lib/powerpc/asm/stack.h +3 -0
@@ -5,4 +5,7 @@#error Do not directly include <asm/stack.h>. Just use <stack.h>.#endif +#define HAVE_ARCH_BACKTRACE +#define HAVE_ARCH_BACKTRACE_FRAME +#endif
lib/powerpc/asm/vpa.h renamed from lib/ppc64/asm/vpa.h +0 -0
lib/powerpc/mmu.c renamed from lib/ppc64/mmu.c +0 -0
lib/powerpc/opal-calls.S renamed from lib/ppc64/opal-calls.S +0 -0
lib/powerpc/opal.c renamed from lib/ppc64/opal.c +0 -0
lib/powerpc/stack.c renamed from lib/ppc64/stack.c +0 -0
lib/ppc64/.gitignore deleted +0 -1
@@ -1 +0,0 @@ -asm-offsets.[hs]
lib/ppc64/asm/handlers.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/handlers.h"
lib/ppc64/asm/hcall.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/hcall.h"
lib/ppc64/asm/memory_areas.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASMPPC64_MEMORY_AREAS_H_ -#define _ASMPPC64_MEMORY_AREAS_H_ - -#include <asm-generic/memory_areas.h> - -#endif
lib/ppc64/asm/ppc_asm.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/ppc_asm.h"
lib/ppc64/asm/processor.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/processor.h"
lib/ppc64/asm/reg.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/reg.h"
lib/ppc64/asm/rtas.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/rtas.h"
lib/ppc64/asm/setup.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/setup.h"
lib/ppc64/asm/smp.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/smp.h"
lib/ppc64/asm/spinlock.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _ASMPPC64_SPINLOCK_H_ -#define _ASMPPC64_SPINLOCK_H_ - -#include <asm-generic/spinlock.h> - -#endif /* _ASMPPC64_SPINLOCK_H_ */
lib/ppc64/asm/stack.h deleted +0 -11
@@ -1,11 +0,0 @@ -#ifndef _ASMPPC64_STACK_H_ -#define _ASMPPC64_STACK_H_ - -#ifndef _STACK_H_ -#error Do not directly include <asm/stack.h>. Just use <stack.h>. -#endif - -#define HAVE_ARCH_BACKTRACE -#define HAVE_ARCH_BACKTRACE_FRAME - -#endif
lib/ppc64/asm/time.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../powerpc/asm/time.h"
powerpc/Makefile +110 -1
111 lines not on this page · raw message
powerpc/Makefile.common deleted +0 -95
95 lines not on this page · raw message
powerpc/Makefile.ppc64 deleted +0 -31
@@ -1,31 +0,0 @@ -# -# ppc64 makefile -# -# Authors: Andrew Jones <[email protected]> -# -bits = 64 - -ifeq ($(ENDIAN),little) - arch_CFLAGS = -mlittle-endian - arch_LDFLAGS = -EL -else - arch_CFLAGS = -mbig-endian - arch_LDFLAGS = -EB -endif - -cstart.o = $(TEST_DIR)/cstart64.o -reloc.o = $(TEST_DIR)/reloc64.o - -OBJDIRS += lib/ppc64 -cflatobjs += lib/ppc64/stack.o -cflatobjs += lib/ppc64/mmu.o -cflatobjs += lib/ppc64/opal.o -cflatobjs += lib/ppc64/opal-calls.o - -# ppc64 specific tests -tests = $(TEST_DIR)/spapr_vpa.elf - -include $(SRCDIR)/$(TEST_DIR)/Makefile.common - -arch_clean: powerpc_clean - $(RM) lib/ppc64/.*.d
Signature · 1 line
2.53.0
PATCH v2 4/6 powerpc: gitlab CI update
In reply to Chinmay RathFrom: Nicholas Piggin <[email protected]>
Adds a few additional tests that are known to work in CI.
To control overhead, ppc64be is used to test 64k page size, ppc64le is used to test 4k page size.
--- .gitlab-ci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
.gitlab-ci.yml +11 -5
@@ -190,13 +190,15 @@ build-ppc64be: - dnf install -y qemu-system-ppc gcc-powerpc64-linux-gnu nmap-ncat - mkdir build - cd build - - ../configure --arch=ppc64 --endian=big --cross-prefix=powerpc64-linux-gnu- + - ../configure --arch=ppc64 --endian=big --page-size=64k --cross-prefix=powerpc64-linux-gnu- - make -j2 - - ACCEL=tcg ./run_tests.sh + - ACCEL=tcg MAX_SMP=8 ./run_tests.sh atomics + atomics-migration emulator interrupts mmu + pmu rtas-get-time-of-day rtas-get-time-of-day-base rtas-set-time-of-day
@@ -209,10 +211,11 @@ build-ppc64be: spapr_hcall spapr_vpa sprs + sprs-migration timebase timebase-icount | tee results.txt - - if grep -q FAIL results.txt ; then exit 1 ; fi + - grep -q PASS results.txt && ! grep -q FAIL results.txt build-ppc64le: extends: .intree_template
@@ -220,11 +223,13 @@ build-ppc64le: - dnf install -y qemu-system-ppc gcc-powerpc64-linux-gnu nmap-ncat - ./configure --arch=ppc64 --endian=little --cross-prefix=powerpc64-linux-gnu- - make -j2 - - ACCEL=tcg ./run_tests.sh + - ACCEL=tcg MAX_SMP=8 ./run_tests.sh atomics + atomics-migration emulator interrupts mmu + pmu rtas-get-time-of-day rtas-get-time-of-day-base rtas-set-time-of-day
@@ -237,10 +242,11 @@ build-ppc64le: spapr_hcall spapr_vpa sprs + sprs-migration timebase timebase-icount | tee results.txt - - if grep -q FAIL results.txt ; then exit 1 ; fi + - grep -q PASS results.txt && ! grep -q FAIL results.txt build-riscv32: extends: .outoftree_template
Signature · 1 line
2.53.0
PATCH v2 5/6 scripts/arch-run.bash: Fix run_panic() success exit status
In reply to Chinmay RathFrom: Nicholas Piggin <[email protected]>
run_qemu_status() looks for "EXIT: STATUS=%d" if the harness command returned 1, to determine the final status of the test. In the case of panic tests, QEMU should terminate before successful exit status is known, so the run_panic() command must produce the "EXIT: STATUS" line.
With this change, running a panic test returns 0 on success (panic), and the run_test.sh unit test correctly displays it as PASS rather than FAIL.
--- scripts/arch-run.bash | 1 + 1 file changed, 1 insertion(+)
scripts/arch-run.bash +1 -0
@@ -313,6 +313,7 @@ run_panic () else # some QEMU versions report multiple panic events echo "PASS: guest panicked" + echo "EXIT: STATUS=1" ret=1 fi
Signature · 1 line
2.53.0
PATCH v2 6/6 powerpc: Add a panic test
In reply to Chinmay RathFrom: Nicholas Piggin <[email protected]>
This adds a simple panic test for pseries that works with TCG (unlike the s390x panic tests), making it easier to test this part of the harness code.
--- .gitlab-ci.yml | 2 ++ lib/powerpc/asm/rtas.h | 1 + lib/powerpc/rtas.c | 16 ++++++++++++++++ powerpc/run | 2 +- powerpc/selftest.c | 17 ++++++++++++++++- powerpc/unittests.cfg | 5 +++++ 6 files changed, 41 insertions(+), 2 deletions(-)
.gitlab-ci.yml +2 -0
@@ -204,6 +204,7 @@ build-ppc64be: rtas-set-time-of-day selftest-migration selftest-migration-skip + selftest-panic selftest-setup sieve smp
@@ -235,6 +236,7 @@ build-ppc64le: rtas-set-time-of-day selftest-migration selftest-migration-skip + selftest-panic selftest-setup sieve smp
lib/powerpc/asm/rtas.h +1 -0
@@ -26,6 +26,7 @@ extern int rtas_call(int token, int nargs, int nret, int *outputs, ...);extern int rtas_call_unlocked (struct rtas_args *args,int token,int nargs,int nret,int *outputs, ...);extern void rtas_power_off (void ); +extern void rtas_os_panic (void );extern void rtas_stop_self (void );#endif /* __ASSEMBLER__ */
lib/powerpc/rtas.c +16 -0
@@ -182,3 +182,19 @@ void rtas_power_off(void) ret =rtas_call_unlocked (&args, token,2 ,1 ,NULL ,-1 ,-1 );printf ("RTAS power-off returned %d\n" , ret); } + +void rtas_os_panic (void ) +{ +struct rtas_args args; +uint32_t token; +int ret; + + ret =rtas_token ("ibm,os-term" , &token); +if (ret) { +puts ("RTAS ibm,os-term not available\n" ); +return ; + } + + ret =rtas_call_unlocked (&args, token,1 ,1 ,NULL ,"rtas_os_panic" ); +printf ("RTAS ibm,os-term returned %d\n" , ret); +}
powerpc/run +1 -1
@@ -57,7 +57,7 @@ fi command="$qemu -nodefaults $A $M $B $D" command+=" -display none -serial stdio -kernel" -command="$(migration_cmd) $(timeout_cmd) $command" +command="$(panic_cmd) $(migration_cmd) $(timeout_cmd) $command" # powerpc tests currently exit with rtas-poweroff, which exits with 0. # run_test treats that as a failure exit and returns 1, so we need
powerpc/selftest.c +16 -1
@@ -7,6 +7,7 @@*/ #include <libcflat.h> #include <util.h> +#include <asm/rtas.h> #include <asm/setup.h> #include <asm/smp.h>
@@ -47,6 +48,17 @@ static void check_setup(int argc, char **argv)report_abort ("missing input" ); } +static void do_panic (void ) +{ +if (machine_is_pseries ()) { +rtas_os_panic (); + }else { +/* Cause a checkstop with MSR[ME] disabled */ + *((char *)0x10000000000 ) =0 ; + } +report_fail ("survived panic" ); +} +int main (int argc,char **argv) {report_prefix_push ("selftest" );
@@ -60,7 +72,10 @@ int main(int argc, char **argv)check_setup (argc-2 , &argv[2 ]); + }else if (strcmp (argv[1 ],"panic" ) ==0 ) { +do_panic (); + }else { +report_abort ("unknown test %s" , argv[1 ]); } -return report_summary (); }
powerpc/unittests.cfg +5 -0
@@ -19,6 +19,11 @@ test_args = 'setup smp=2 mem=1024' qemu_params = -m 1g groups = selftest +[selftest-panic] +file = selftest.elf +extra_params = -append 'panic' +groups = selftest panic + [selftest-migration] file = selftest-migration.elf machine = pseries
Signature · 1 line
2.53.0
Quoted 34 lines · Chinmay Rath
This series aims to add a couple of new powerpc tests and improve the powerpc build structure.
This is originally Nick's work. The last version (v10) of which can be seen here :
https://lore.kernel.org/linuxppc-dev/[email protected]/
Couple of patches from the series are already merged.Since it has been 2 years since this series was posted, I originally posted this as a RFC. This v1 series has changes accomodating the review comments received in the RFC :
https://lore.kernel.org/kvm/[email protected]/
v1:
https://lore.kernel.org/kvm/[email protected]/I have rebased the patches to the upstream state.
For the patches which did not require any changes in the existing upstream code, I have retained the "Reviewed-by"s and "Acked-by" (patch 3,5 & 6) from Nick's series. I have also added Andrew's "Reviewed-by" received on patch 2 in the RFC. Nick had originally introduced powernv tests as well. Removed it for now since it was causing CI failure in the current upstream.Link to Gitlab tree with patches :
https://gitlab.com/rathc/kvm-unit-tests/-/tree/ppc64
Link to Gitlab pipeline :
https://gitlab.com/rathc/kvm-unit-tests/-/pipelines/2688519679Change log from RFC to v1:
1. Patch 2: Added Andrew's "Reviewed-by".
2. Patch 4: Removed usage of gitlab-ci group to run test - Thomas It would be nice to make use of the gitlab-ci group, but doing the change of all archs would make sense in a separate series. I look forward to doing that.
3. Patch 6: Removed addition of panic test in gitlab-ci group - Thomas
Quoted 8 lines
There was a discussion on the build failing in Travis CI with Clang, in the RFC, which I have addressed there.
Change log from v1 to v2:
Patch 4: Addressed all comments by Thomas :
1. Removed extra blank line.
2. Removed accel=kvm test from gitlab-ci.
3. smp = 2 preserved in atmoics test.
Thanks, looks fine now, so I pushed it to the repository.
Thomas
Quoted 41 lines · Thomas Huth
Quoted 40 lines · Chinmay Rath
This series aims to add a couple of new powerpc tests and improve the powerpc build structure.
This is originally Nick's work. The last version (v10) of which can be seen here :
https://lore.kernel.org/linuxppc-dev/[email protected]/Couple of patches from the series are already merged.
Since it has been 2 years since this series was posted, I originally posted this as a RFC. This v1 series has changes accomodating the review comments received in the RFC :
https://lore.kernel.org/kvm/[email protected]/v1:
https://lore.kernel.org/kvm/[email protected]/I have rebased the patches to the upstream state.
For the patches which did not require any changes in the existing upstream code, I have retained the "Reviewed-by"s and "Acked-by" (patch 3,5 & 6) from Nick's series. I have also added Andrew's "Reviewed-by" received on patch 2 in the RFC. Nick had originally introduced powernv tests as well. Removed it for now since it was causing CI failure in the current upstream.Link to Gitlab tree with patches :
https://gitlab.com/rathc/kvm-unit-tests/-/tree/ppc64
Link to Gitlab pipeline :
https://gitlab.com/rathc/kvm-unit-tests/-/pipelines/2688519679Change log from RFC to v1:
1. Patch 2: Added Andrew's "Reviewed-by".
2. Patch 4: Removed usage of gitlab-ci group to run test - Thomas It would be nice to make use of the gitlab-ci group, but doing the change of all archs would make sense in a separate series. I look forward to doing that.
3. Patch 6: Removed addition of panic test in gitlab-ci group - ThomasThere was a discussion on the build failing in Travis CI with Clang, in the RFC, which I have addressed there.
Quoted 8 lines
Quoted 5 lines
Change log from v1 to v2:
Patch 4: Addressed all comments by Thomas :
1. Removed extra blank line.
2. Removed accel=kvm test from gitlab-ci.
3. smp = 2 preserved in atmoics test.Thanks, looks fine now, so I pushed it to the repository.
Thomas
Thank you Thomas !
On Sun, 19 Jul 2026, Chinmay Rath wrote: > This series aims to add a couple of new powerpc tests and improve > the powerpc build structure. Tested on POWER10 (native KVM, ppc64le). Tested-by: Aniket Sahu <[email protected]> --- Environment --- Host CPU : POWER10 (architected), altivec supported Kernel : Linux 7.0.0-27-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 18 19:14:19 UTC 2026 ppc64le GNU/Linux OS : Ubuntu 26.04 LTS (Resolute Raccoon) QEMU : 10.2.1 (Debian 1:10.2.1+ds-1ubuntu3.1) Accelerator: KVM (-accel kvm -machine pseries,cap-ccf-assist=off) Branch : origin/ppc64 @ dde8f397 --- Test: pmu (Patch 1) --- $ ./run_tests.sh -a powerpc pmu PASS pmu (22 tests, 1 known failure) Full log: timeout -k 1s --foreground 90s \ /usr/bin/qemu-system-ppc64 -nodefaults -accel kvm \ -machine pseries,cap-ccf-assist=off -bios powerpc/boot_rom.bin \ -display none -serial stdio -kernel powerpc/pmu.elf -smp 1 PASS: pmu: pmc56: PMC5 zeroed PASS: pmu: pmc56: PMC6 zeroed PASS: pmu: pmc56: PMC5 frozen PASS: pmu: pmc56: PMC6 frozen PASS: pmu: pmc56: PMC5 counting PASS: pmu: pmc56: PMC6 counting PASS: pmu: pmc56: PMC6 ratio to reported clock frequency is 116% PASS: pmu: pmc56: PMC5 counts instructions precisely 900 PASS: pmu: pmc56: PMC5 counts instructions exactly 21 PASS: pmu: pmc56: PMC5 counts instructions with branch 21 PASS: pmu: pmc56: PMC5 counts instructions wth conditional branch 24 PASS: pmu: pmc56: PMC5 counts instructions with illegal instruction PASS: pmu: pmc56: PMC5 counts instructions with fault PASS: pmu: pmc56: PMC5 counts instructions with syscall PASS: pmu: pmc56: PMC5 counts instructions with rfid 2 PASS: pmu: pmc56: PMC5 counts instructions with ldat PASS: pmu: pmi: PMAO caused interrupt PASS: pmu: bhrb: BHRB is frozen PASS: pmu: bhrb: BHRB has been written KFAIL: pmu: bhrb: BHRB has written 8 entries PASS: pmu: bhrb: BHRB has written 4 entries PASS: pmu: bhrb: correct conditional branch address SUMMARY: 22 tests, 1 known failure EXIT: STATUS=1 Note: The KFAIL on "BHRB has written 8 entries" is expected. POWER10 records 4 BHRB entries when other threads are active on the core; the test explicitly accounts for this with a fallback 4-entry check which passes. STATUS=1 is the correct exit code when known failures exist. --- Test: selftest-setup (Patch 3/build structure) --- $ ./run_tests.sh -a powerpc selftest-setup PASS selftest-setup (2 tests) Full log: timeout -k 1s --foreground 90s \ /usr/bin/qemu-system-ppc64 -nodefaults -accel kvm \ -machine pseries,cap-ccf-assist=off -bios powerpc/boot_rom.bin \ -display none -serial stdio -kernel powerpc/selftest.elf \ -smp 2 -append setup smp=2 mem=1024 -m 1g PASS: selftest: setup: smp: nr_cpus_present = 2 PASS: selftest: setup: mem: size = 1024 MB SUMMARY: 2 tests EXIT: STATUS=1 --- Test: selftest-panic (Patches 5 & 6) --- $ ./run_tests.sh -a powerpc selftest-panic PASS selftest-panic Full log: run_panic timeout -k 1s --foreground 90s \ /usr/bin/qemu-system-ppc64 -nodefaults -accel kvm \ -machine pseries,cap-ccf-assist=off -bios powerpc/boot_rom.bin \ -display none -serial stdio -kernel powerpc/selftest.elf \ -smp 1 -append panic qemu-system-ppc64: OS terminated: rtas_os_panic PASS: guest panicked EXIT: STATUS=1 Note: The panic test validates both the new rtas_os_panic() RTAS call (Patch 6) and the run_panic() exit status fix (Patch 5). QEMU exits with "OS terminated: rtas_os_panic" confirming the ibm,os-term RTAS token is correctly invoked, and the test runner correctly identifies this as a successful (expected) panic. Aniket Sahu
Aniket Sahu
Tested-bySorry for the formatting mess in my previous email, my mail client stripped the linebreaks. Here is the readable version:
Quoted 2 lines · Chinmay Rath
This series aims to add a couple of new powerpc tests and improve the powerpc build structure.
Tested on POWER10 (native KVM, ppc64le).
--- Environment ---
Host CPU : POWER10 (architected), altivec supported Kernel : Linux 7.0.0-27-generic #27-Ubuntu SMP PREEMPT_DYNAMIC Thu Jun 18 19:14:19 UTC 2026 ppc64le GNU/Linux OS : Ubuntu 26.04 LTS (Resolute Raccoon)
QEMU : 10.2.1 (Debian 1:10.2.1+ds-1ubuntu3.1)
Accelerator: KVM (-accel kvm -machine pseries,cap-ccf-assist=off) Branch : origin/ppc64 @ dde8f397
--- Test: pmu (Patch 1) ---
$ ./run_tests.sh -a powerpc pmu PASS pmu (22 tests, 1 known failure)
Full log:
timeout -k 1s --foreground 90s \
/usr/bin/qemu-system-ppc64 -nodefaults -accel kvm \
-machine pseries,cap-ccf-assist=off -bios powerpc/boot_rom.bin \
-display none -serial stdio -kernel powerpc/pmu.elf -smp 1
PASS: pmu: pmc56: PMC5 zeroed
PASS: pmu: pmc56: PMC6 zeroed
PASS: pmu: pmc56: PMC5 frozen
PASS: pmu: pmc56: PMC6 frozen
PASS: pmu: pmc56: PMC5 counting
PASS: pmu: pmc56: PMC6 counting
PASS: pmu: pmc56: PMC6 ratio to reported clock frequency is 116%
PASS: pmu: pmc56: PMC5 counts instructions precisely 900
PASS: pmu: pmc56: PMC5 counts instructions exactly 21
PASS: pmu: pmc56: PMC5 counts instructions with branch 21
PASS: pmu: pmc56: PMC5 counts instructions wth conditional branch 24
PASS: pmu: pmc56: PMC5 counts instructions with illegal instruction
PASS: pmu: pmc56: PMC5 counts instructions with fault
PASS: pmu: pmc56: PMC5 counts instructions with syscall
PASS: pmu: pmc56: PMC5 counts instructions with rfid 2
PASS: pmu: pmc56: PMC5 counts instructions with ldat
PASS: pmu: pmi: PMAO caused interrupt
PASS: pmu: bhrb: BHRB is frozen
PASS: pmu: bhrb: BHRB has been written
KFAIL: pmu: bhrb: BHRB has written 8 entries
PASS: pmu: bhrb: BHRB has written 4 entries
PASS: pmu: bhrb: correct conditional branch address
SUMMARY: 22 tests, 1 known failure
EXIT: STATUS=1
Note: The KFAIL on "BHRB has written 8 entries" is expected. POWER10 records 4 BHRB entries when other threads are active on the core; the test explicitly accounts for this with a fallback 4-entry check which passes. STATUS=1 is the correct exit code when known failures exist.
--- Test: selftest-setup (Patch 3/build structure) ---
$ ./run_tests.sh -a powerpc selftest-setup PASS selftest-setup (2 tests)
Full log:
timeout -k 1s --foreground 90s \
/usr/bin/qemu-system-ppc64 -nodefaults -accel kvm \
-machine pseries,cap-ccf-assist=off -bios powerpc/boot_rom.bin \
-display none -serial stdio -kernel powerpc/selftest.elf \
-smp 2 -append setup smp=2 mem=1024 -m 1g
PASS: selftest: setup: smp: nr_cpus_present = 2
PASS: selftest: setup: mem: size = 1024 MB
SUMMARY: 2 tests
EXIT: STATUS=1
--- Test: selftest-panic (Patches 5 & 6) ---
$ ./run_tests.sh -a powerpc selftest-panic PASS selftest-panic
Full log:
run_panic timeout -k 1s --foreground 90s \
/usr/bin/qemu-system-ppc64 -nodefaults -accel kvm \
-machine pseries,cap-ccf-assist=off -bios powerpc/boot_rom.bin \
-display none -serial stdio -kernel powerpc/selftest.elf \
-smp 1 -append panic
qemu-system-ppc64: OS terminated: rtas_os_panic
PASS: guest panicked
EXIT: STATUS=1
Note: The panic test validates both the new rtas_os_panic() RTAS call (Patch 6) and the run_panic() exit status fix (Patch 5). QEMU exits with "OS terminated: rtas_os_panic" confirming the ibm,os-term RTAS token is correctly invoked, and the test runner correctly identifies this as a successful (expected) panic.
Aniket Sahu