mbox series

[kvm-unit-tests,v3,00/13] powerpc: updates, P10, PNV support

Message ID 20230327124520.2707537-1-npiggin@gmail.com (mailing list archive)
Headers show
Series powerpc: updates, P10, PNV support | expand

Message

Nicholas Piggin March 27, 2023, 12:45 p.m. UTC
This series is growing a bit I'm sorry. v2 series added extra interrupt
vectors support which was actually wrong because interrupt handling
code can only cope with 0x100-size vectors and new ones are 0x80 and
0x20. It managed to work because those alias to the 0x100 boundary, but
if more than one handler were installed in the same 0x100-aligned
block it would crash. So a couple of patches added to cope with that.

Thanks,
Nick

Nicholas Piggin (13):
  MAINTAINERS: Update powerpc list
  powerpc: Add local variant of SPR test
  powerpc: Add some checking to exception handler install
  powerpc: Abstract H_CEDE calls into a sleep functions
  powerpc: Add ISA v3.1 (POWER10) support to SPR test
  powerpc: Extract some common helpers and defines to headers
  powerpc/sprs: Specify SPRs with data rather than code
  powerpc/spapr_vpa: Add basic VPA tests
  powerpc: Expand exception handler vector granularity
  powerpc: Add support for more interrupts including HV interrupts
  powerpc: Discover runtime load address dynamically
  powerpc: Support powernv machine with QEMU TCG
  powerpc/sprs: Test hypervisor registers on powernv machine

 MAINTAINERS                 |   2 +-
 lib/powerpc/asm/handlers.h  |   2 +-
 lib/powerpc/asm/hcall.h     |   1 +
 lib/powerpc/asm/ppc_asm.h   |   6 +
 lib/powerpc/asm/processor.h |  55 ++-
 lib/powerpc/handlers.c      |  10 +-
 lib/powerpc/hcall.c         |   4 +-
 lib/powerpc/io.c            |  27 +-
 lib/powerpc/io.h            |   6 +
 lib/powerpc/processor.c     |  80 ++++-
 lib/powerpc/setup.c         |   8 +-
 lib/ppc64/asm/opal.h        |  15 +
 lib/ppc64/asm/vpa.h         |  62 ++++
 lib/ppc64/opal-calls.S      |  46 +++
 lib/ppc64/opal.c            |  74 +++++
 powerpc/Makefile.ppc64      |   4 +-
 powerpc/cstart64.S          | 105 ++++--
 powerpc/run                 |  35 +-
 powerpc/spapr_hcall.c       |   9 +-
 powerpc/spapr_vpa.c         | 172 ++++++++++
 powerpc/sprs.c              | 645 ++++++++++++++++++++++++++----------
 powerpc/tm.c                |  20 +-
 powerpc/unittests.cfg       |   6 +
 23 files changed, 1138 insertions(+), 256 deletions(-)
 create mode 100644 lib/ppc64/asm/opal.h
 create mode 100644 lib/ppc64/asm/vpa.h
 create mode 100644 lib/ppc64/opal-calls.S
 create mode 100644 lib/ppc64/opal.c
 create mode 100644 powerpc/spapr_vpa.c

Comments

Cédric Le Goater March 27, 2023, 4:09 p.m. UTC | #1
On 3/27/23 14:45, Nicholas Piggin wrote:
> This series is growing a bit I'm sorry. v2 series added extra interrupt
> vectors support which was actually wrong because interrupt handling
> code can only cope with 0x100-size vectors and new ones are 0x80 and
> 0x20. It managed to work because those alias to the 0x100 boundary, but
> if more than one handler were installed in the same 0x100-aligned
> block it would crash. So a couple of patches added to cope with that.
> 

I gave them a try on P9 box

$ ./run_tests.sh
PASS selftest-setup (2 tests)
PASS spapr_hcall (9 tests, 1 skipped)
PASS spapr_vpa (13 tests)
PASS rtas-get-time-of-day (10 tests)
PASS rtas-get-time-of-day-base (10 tests)
PASS rtas-set-time-of-day (5 tests)
PASS emulator (4 tests)
PASS h_cede_tm (2 tests)
FAIL sprs (75 tests, 1 unexpected failures)
FAIL sprs-migration (75 tests, 5 unexpected failures)

And with TCG:

$ ACCEL=tcg ./run_tests.sh
PASS selftest-setup (2 tests)
PASS spapr_hcall (9 tests, 1 skipped)
FAIL spapr_vpa (13 tests, 1 unexpected failures)

The dispatch count seems bogus after unregister

PASS rtas-get-time-of-day (10 tests)
PASS rtas-get-time-of-day-base (10 tests)
PASS rtas-set-time-of-day (5 tests)
PASS emulator (4 tests)
SKIP h_cede_tm (qemu-system-ppc64: TCG cannot support more than 1 thread/core on a pseries machine)
FAIL sprs (75 tests, 16 unexpected failures)
FAIL sprs-migration (75 tests, 16 unexpected failures)


Thanks,

C.
Nicholas Piggin March 28, 2023, 7:15 a.m. UTC | #2
On Tue Mar 28, 2023 at 2:09 AM AEST, Cédric Le Goater wrote:
> On 3/27/23 14:45, Nicholas Piggin wrote:
> > This series is growing a bit I'm sorry. v2 series added extra interrupt
> > vectors support which was actually wrong because interrupt handling
> > code can only cope with 0x100-size vectors and new ones are 0x80 and
> > 0x20. It managed to work because those alias to the 0x100 boundary, but
> > if more than one handler were installed in the same 0x100-aligned
> > block it would crash. So a couple of patches added to cope with that.
> > 
>
> I gave them a try on P9 box

Thanks!

>
> $ ./run_tests.sh
> PASS selftest-setup (2 tests)
> PASS spapr_hcall (9 tests, 1 skipped)
> PASS spapr_vpa (13 tests)
> PASS rtas-get-time-of-day (10 tests)
> PASS rtas-get-time-of-day-base (10 tests)
> PASS rtas-set-time-of-day (5 tests)
> PASS emulator (4 tests)
> PASS h_cede_tm (2 tests)
> FAIL sprs (75 tests, 1 unexpected failures)

Oh you have a SPR failure too? I'll check that on a P9.

> FAIL sprs-migration (75 tests, 5 unexpected failures)
>
> And with TCG:
>
> $ ACCEL=tcg ./run_tests.sh
> PASS selftest-setup (2 tests)
> PASS spapr_hcall (9 tests, 1 skipped)
> FAIL spapr_vpa (13 tests, 1 unexpected failures)
>
> The dispatch count seems bogus after unregister

Yeah, that dispatch count after unregister test may be bogus actually.
PAPR doesn't specify what should happen in that case. It was working
here for me though so interesting it's different for you. I'll
investigate it and maybe just remove that test for now.

>
> PASS rtas-get-time-of-day (10 tests)
> PASS rtas-get-time-of-day-base (10 tests)
> PASS rtas-set-time-of-day (5 tests)
> PASS emulator (4 tests)
> SKIP h_cede_tm (qemu-system-ppc64: TCG cannot support more than 1 thread/core on a pseries machine)
> FAIL sprs (75 tests, 16 unexpected failures)

These should be TCG errors. I have it passing them all with patches
posted to qemu lists. Very simple but effective way to catch a few
classes of errors.

Thanks,
Nick
Cédric Le Goater March 28, 2023, 7:32 a.m. UTC | #3
On 3/28/23 09:15, Nicholas Piggin wrote:
> On Tue Mar 28, 2023 at 2:09 AM AEST, Cédric Le Goater wrote:
>> On 3/27/23 14:45, Nicholas Piggin wrote:
>>> This series is growing a bit I'm sorry. v2 series added extra interrupt
>>> vectors support which was actually wrong because interrupt handling
>>> code can only cope with 0x100-size vectors and new ones are 0x80 and
>>> 0x20. It managed to work because those alias to the 0x100 boundary, but
>>> if more than one handler were installed in the same 0x100-aligned
>>> block it would crash. So a couple of patches added to cope with that.
>>>
>>
>> I gave them a try on P9 box
> 
> Thanks!
> 
>>
>> $ ./run_tests.sh
>> PASS selftest-setup (2 tests)
>> PASS spapr_hcall (9 tests, 1 skipped)
>> PASS spapr_vpa (13 tests)
>> PASS rtas-get-time-of-day (10 tests)
>> PASS rtas-get-time-of-day-base (10 tests)
>> PASS rtas-set-time-of-day (5 tests)
>> PASS emulator (4 tests)
>> PASS h_cede_tm (2 tests)
>> FAIL sprs (75 tests, 1 unexpected failures)
> 
> Oh you have a SPR failure too? I'll check that on a 

I think it was the WORT SPR

> 
>> FAIL sprs-migration (75 tests, 5 unexpected failures)
>>
>> And with TCG:
>>
>> $ ACCEL=tcg ./run_tests.sh
>> PASS selftest-setup (2 tests)
>> PASS spapr_hcall (9 tests, 1 skipped)
>> FAIL spapr_vpa (13 tests, 1 unexpected failures)
>>
>> The dispatch count seems bogus after unregister
> 
> Yeah, that dispatch count after unregister test may be bogus actually.
> PAPR doesn't specify what should happen in that case. It was working
> here for me though so interesting it's different for you. I'll
> investigate it and maybe just remove that test for now.

It would be nice to keep it and skip it until the emulation is fixed.
  
> 
>>
>> PASS rtas-get-time-of-day (10 tests)
>> PASS rtas-get-time-of-day-base (10 tests)
>> PASS rtas-set-time-of-day (5 tests)
>> PASS emulator (4 tests)
>> SKIP h_cede_tm (qemu-system-ppc64: TCG cannot support more than 1 thread/core on a pseries machine)
>> FAIL sprs (75 tests, 16 unexpected failures)
> 
> These should be TCG errors. I have it passing them all with patches
> posted to qemu lists. Very simple but effective way to catch a few
> classes of errors.

Ah  I didn't try with your QEMU patches. Make sense then.

Thanks,

C.