Re: [PULL v2 00/35] ppc queue

2023-09-10 Thread Michael Tokarev

08.09.2023 07:24, Nicholas Piggin wrote:


Nicholas Piggin (26):
    target/ppc: Remove single-step suppression inside 0x100-0xf00
    target/ppc: Improve book3s branch trace interrupt for v2.07S
    target/ppc: Suppress single step interrupts on rfi-type instructions
    target/ppc: Implement breakpoint debug facility for v2.07S
    target/ppc: Implement watchpoint debug facility for v2.07S
    spapr: implement H_SET_MODE debug facilities
    ppc/vhyp: reset exception state when handling vhyp hcall
    ppc/vof: Fix missed fields in VOF cleanup
    hw/ppc/ppc.c: Tidy over-long lines
    hw/ppc: Introduce functions for conversion between timebase and 
nanoseconds
    host-utils: Add muldiv64_round_up
    hw/ppc: Round up the decrementer interval when converting to ns
    hw/ppc: Avoid decrementer rounding errors
    target/ppc: Sign-extend large decrementer to 64-bits
    hw/ppc: Always store the decrementer value
    target/ppc: Migrate DECR SPR
    hw/ppc: Reset timebase facilities on machine reset
    hw/ppc: Read time only once to perform decrementer write
    target/ppc: Fix CPU reservation migration for record-replay
    target/ppc: Fix timebase reset with record-replay
    spapr: Fix machine reset deadlock from replay-record
    spapr: Fix record-replay machine reset consuming too many events
    tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount
    tests/avocado: reverse-debugging cope with re-executing breakpoints
    tests/avocado: ppc64 reverse debugging tests for pseries and powernv
    target/ppc: Fix LQ, STQ register-pair order for big-endian

...

The decrementer fixes are good candidates but there are quite a few
patches and you might encounter conflicts.


So, there are 6 patches in there:

 7798f5c576 hw/ppc: Introduce functions for conversion between timebase and 
nanoseconds
 47de6c4c28 host-utils: Add muldiv64_round_up
 eab0888418 hw/ppc: Round up the decrementer interval when converting to ns
 8e0a5ac878 hw/ppc: Avoid decrementer rounding errors
 c8fbc6b9f2 target/ppc: Sign-extend large decrementer to 64-bits
 febb71d543 hw/ppc: Always store the decrementer value

It all applies cleanly to 8.1 (running ci now), which is fine.
For 8.0 and 7.2 things are a bit fun though.  6th patch (febb71d543)
has minor context conflict with this commit:

commit 17dd1354c1d1aba9caf4af01e11aa7dbe128474f
Author: Nicholas Piggin 
Date:   Tue May 30 23:12:13 2023 +1000

target/ppc: Decrementer fix BookE semantics

Technically, while the two touches nearby areas in
hw/ppc/ppc.c:__cpu_ppc_store_decr(), they don't actually
conflict, it is just the comment context.  But git is unable
to figure this out by its own.  With commit 17dd1354c1d applied,
everything goes flawlessly.  It looks like 17dd1354c1d can be
picked up too for stable just fine, without resorting to context
fixing.

Also, 2 more patches applies cleanly (to 8.1 anyway):

 30d0647bcf hw/ppc: Reset timebase facilities on machine reset
 ea62f8a517 hw/ppc: Read time only once to perform decrementer write

but it does not look like you mean these, esp. ea62f8a517.



Decrementer I was nervous about since there were quite a lot of
interacting issues. Decrementer has worked okay for a while, so
even though there are some bugs, they're mostly in edge cases
that most OSes don't hit or care so much about.


Ok.


Possibly the decrementer migration patch could be a candidate.


I'm guessing this is this change:

 578912ad73 target/ppc: Migrate DECR SPR

This one is a bit more difficult.   First it requires the following:

 d5ee641cfc target/ppc: Implement watchpoint debug facility for v2.07S
 14192307ef target/ppc: Implement breakpoint debug facility for v2.07S

which aren't present in 8.1.  And second, I'm not sure for the
migration compatibility here, - will whole thing become unmigratable
between 8.1.0 and some 8.1.x this way?  (and how about 8.1 and 8.2?).


In any case I would like them to get more testing upstream for
a while first.


Ok, let's give it a try.

Thanks,

/mjt



Re: [PULL v2 00/35] ppc queue

2023-09-08 Thread Michael Tokarev

08.09.2023 07:24, Nicholas Piggin wrote:

On Fri Sep 8, 2023 at 8:15 AM AEST, Cédric Le Goater wrote:

..

The decrementer fixes are good candidates but there are quite a few
patches and you might encounter conflicts.


Decrementer I was nervous about since there were quite a lot of
interacting issues. Decrementer has worked okay for a while, so
even though there are some bugs, they're mostly in edge cases
that most OSes don't hit or care so much about.

Possibly the decrementer migration patch could be a candidate.

In any case I would like them to get more testing upstream for
a while first.


Yeah, got it, thank you for the explanation! Let's see how it goes.


or some of these:

   ppc/vof: Fix missed fields in VOF cleanup


vof patch I think is a candidate. Simple and fixes leaks.


   spapr: Fix machine reset deadlock from replay-record
   hw/ppc/e500: fix broken snapshot replay


I can not tell if replay-record is important for stable. Nick ?


It seems to have been broken in many ways for long enough that
nobody was really using it (at least on pseries). Maybe e500
because an issue was filed for that and the fix looked small.

   

or something else?


These are :

target/ppc: Flush inputs to zero with NJ in ppc_store_vscr
target/ppc: Fix LQ, STQ register-pair order for big-endian


Yes definitely these two.


The "LQ, STQ on big-endian" has been Cc'd to stable so I picked it
up right away.  I now also added

  ppc/vof: Fix missed fields in VOF cleanup
  hw/ppc/e500: fix broken snapshot replay
  target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

to the mix, and also put a few of decrementer on hold to check
later.

Thank you!

/mjt



Re: [PULL v2 00/35] ppc queue

2023-09-07 Thread Nicholas Piggin
On Fri Sep 8, 2023 at 8:15 AM AEST, Cédric Le Goater wrote:
> On 9/7/23 21:10, Michael Tokarev wrote:
> > 06.09.2023 17:36, Cédric Le Goater wrote:
> > ...
> >> ppc queue :
> >>
> >> * debug facility improvements
> >> * timebase and decrementer fixes
> >> * record-replay fixes
> >> * TCG fixes
> >> * XIVE model improvements for multichip
> >>
> >> 
> >> Cédric Le Goater (4):
> >>    ppc/xive: Use address_space routines to access the machine RAM
> >>    ppc/xive: Introduce a new XiveRouter end_notify() handler
> >>    ppc/xive: Handle END triggers between chips with MMIOs
> >>    ppc/xive: Add support for the PC MMIOs
> >>
> >> Joel Stanley (1):
> >>    ppc: Add stub implementation of TRIG SPRs
> >>
> >> Maksim Kostin (1):
> >>    hw/ppc/e500: fix broken snapshot replay
> >>
> >> Nicholas Piggin (26):
> >>    target/ppc: Remove single-step suppression inside 0x100-0xf00
> >>    target/ppc: Improve book3s branch trace interrupt for v2.07S
> >>    target/ppc: Suppress single step interrupts on rfi-type instructions
> >>    target/ppc: Implement breakpoint debug facility for v2.07S
> >>    target/ppc: Implement watchpoint debug facility for v2.07S
> >>    spapr: implement H_SET_MODE debug facilities
> >>    ppc/vhyp: reset exception state when handling vhyp hcall
> >>    ppc/vof: Fix missed fields in VOF cleanup
> >>    hw/ppc/ppc.c: Tidy over-long lines
> >>    hw/ppc: Introduce functions for conversion between timebase and 
> >> nanoseconds
> >>    host-utils: Add muldiv64_round_up
> >>    hw/ppc: Round up the decrementer interval when converting to ns
> >>    hw/ppc: Avoid decrementer rounding errors
> >>    target/ppc: Sign-extend large decrementer to 64-bits
> >>    hw/ppc: Always store the decrementer value
> >>    target/ppc: Migrate DECR SPR
> >>    hw/ppc: Reset timebase facilities on machine reset
> >>    hw/ppc: Read time only once to perform decrementer write
> >>    target/ppc: Fix CPU reservation migration for record-replay
> >>    target/ppc: Fix timebase reset with record-replay
> >>    spapr: Fix machine reset deadlock from replay-record
> >>    spapr: Fix record-replay machine reset consuming too many events
> >>    tests/avocado: boot ppc64 pseries replay-record test to Linux VFS 
> >> mount
> >>    tests/avocado: reverse-debugging cope with re-executing breakpoints
> >>    tests/avocado: ppc64 reverse debugging tests for pseries and powernv
> >>    target/ppc: Fix LQ, STQ register-pair order for big-endian
> >>
> >> Richard Henderson (1):
> >>    target/ppc: Flush inputs to zero with NJ in ppc_store_vscr
> >>
> >> Shawn Anastasio (1):
> >>    target/ppc: Generate storage interrupts for radix RC changes
> >>
> >> jianchunfu (1):
> >>    target/ppc: Fix the order of kvm_enable judgment about 
> >> kvmppc_set_interrupt()
> > 
> > Is there anything in there worth to pick for -stable?
> > Like, for example, some decrementer fixes, 
>
> The decrementer fixes are good candidates but there are quite a few
> patches and you might encounter conflicts.

Decrementer I was nervous about since there were quite a lot of
interacting issues. Decrementer has worked okay for a while, so
even though there are some bugs, they're mostly in edge cases
that most OSes don't hit or care so much about.

Possibly the decrementer migration patch could be a candidate.

In any case I would like them to get more testing upstream for
a while first.

>
> > or some of these:
> > 
> >   ppc/vof: Fix missed fields in VOF cleanup

vof patch I think is a candidate. Simple and fixes leaks.

> >   spapr: Fix machine reset deadlock from replay-record
> >   hw/ppc/e500: fix broken snapshot replay
>
> I can not tell if replay-record is important for stable. Nick ?

It seems to have been broken in many ways for long enough that
nobody was really using it (at least on pseries). Maybe e500
because an issue was filed for that and the fix looked small.

>   
> > or something else?
>
> These are :
>
>target/ppc: Flush inputs to zero with NJ in ppc_store_vscr
>target/ppc: Fix LQ, STQ register-pair order for big-endian

Yes definitely these two.

Thanks,
Nick



Re: [PULL v2 00/35] ppc queue

2023-09-07 Thread Cédric Le Goater

On 9/7/23 21:10, Michael Tokarev wrote:

06.09.2023 17:36, Cédric Le Goater wrote:
...

ppc queue :

* debug facility improvements
* timebase and decrementer fixes
* record-replay fixes
* TCG fixes
* XIVE model improvements for multichip


Cédric Le Goater (4):
   ppc/xive: Use address_space routines to access the machine RAM
   ppc/xive: Introduce a new XiveRouter end_notify() handler
   ppc/xive: Handle END triggers between chips with MMIOs
   ppc/xive: Add support for the PC MMIOs

Joel Stanley (1):
   ppc: Add stub implementation of TRIG SPRs

Maksim Kostin (1):
   hw/ppc/e500: fix broken snapshot replay

Nicholas Piggin (26):
   target/ppc: Remove single-step suppression inside 0x100-0xf00
   target/ppc: Improve book3s branch trace interrupt for v2.07S
   target/ppc: Suppress single step interrupts on rfi-type instructions
   target/ppc: Implement breakpoint debug facility for v2.07S
   target/ppc: Implement watchpoint debug facility for v2.07S
   spapr: implement H_SET_MODE debug facilities
   ppc/vhyp: reset exception state when handling vhyp hcall
   ppc/vof: Fix missed fields in VOF cleanup
   hw/ppc/ppc.c: Tidy over-long lines
   hw/ppc: Introduce functions for conversion between timebase and 
nanoseconds
   host-utils: Add muldiv64_round_up
   hw/ppc: Round up the decrementer interval when converting to ns
   hw/ppc: Avoid decrementer rounding errors
   target/ppc: Sign-extend large decrementer to 64-bits
   hw/ppc: Always store the decrementer value
   target/ppc: Migrate DECR SPR
   hw/ppc: Reset timebase facilities on machine reset
   hw/ppc: Read time only once to perform decrementer write
   target/ppc: Fix CPU reservation migration for record-replay
   target/ppc: Fix timebase reset with record-replay
   spapr: Fix machine reset deadlock from replay-record
   spapr: Fix record-replay machine reset consuming too many events
   tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount
   tests/avocado: reverse-debugging cope with re-executing breakpoints
   tests/avocado: ppc64 reverse debugging tests for pseries and powernv
   target/ppc: Fix LQ, STQ register-pair order for big-endian

Richard Henderson (1):
   target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

Shawn Anastasio (1):
   target/ppc: Generate storage interrupts for radix RC changes

jianchunfu (1):
   target/ppc: Fix the order of kvm_enable judgment about 
kvmppc_set_interrupt()


Is there anything in there worth to pick for -stable?
Like, for example, some decrementer fixes, 


The decrementer fixes are good candidates but there are quite a few
patches and you might encounter conflicts.


or some of these:

  ppc/vof: Fix missed fields in VOF cleanup
  spapr: Fix machine reset deadlock from replay-record
  hw/ppc/e500: fix broken snapshot replay


I can not tell if replay-record is important for stable. Nick ?
 

or something else?


These are :

  target/ppc: Flush inputs to zero with NJ in ppc_store_vscr
  target/ppc: Fix LQ, STQ register-pair order for big-endian

Thanks,

C.



Thanks!

/mjt





Re: [PULL v2 00/35] ppc queue

2023-09-07 Thread Michael Tokarev

06.09.2023 17:36, Cédric Le Goater wrote:
...

ppc queue :

* debug facility improvements
* timebase and decrementer fixes
* record-replay fixes
* TCG fixes
* XIVE model improvements for multichip


Cédric Le Goater (4):
   ppc/xive: Use address_space routines to access the machine RAM
   ppc/xive: Introduce a new XiveRouter end_notify() handler
   ppc/xive: Handle END triggers between chips with MMIOs
   ppc/xive: Add support for the PC MMIOs

Joel Stanley (1):
   ppc: Add stub implementation of TRIG SPRs

Maksim Kostin (1):
   hw/ppc/e500: fix broken snapshot replay

Nicholas Piggin (26):
   target/ppc: Remove single-step suppression inside 0x100-0xf00
   target/ppc: Improve book3s branch trace interrupt for v2.07S
   target/ppc: Suppress single step interrupts on rfi-type instructions
   target/ppc: Implement breakpoint debug facility for v2.07S
   target/ppc: Implement watchpoint debug facility for v2.07S
   spapr: implement H_SET_MODE debug facilities
   ppc/vhyp: reset exception state when handling vhyp hcall
   ppc/vof: Fix missed fields in VOF cleanup
   hw/ppc/ppc.c: Tidy over-long lines
   hw/ppc: Introduce functions for conversion between timebase and 
nanoseconds
   host-utils: Add muldiv64_round_up
   hw/ppc: Round up the decrementer interval when converting to ns
   hw/ppc: Avoid decrementer rounding errors
   target/ppc: Sign-extend large decrementer to 64-bits
   hw/ppc: Always store the decrementer value
   target/ppc: Migrate DECR SPR
   hw/ppc: Reset timebase facilities on machine reset
   hw/ppc: Read time only once to perform decrementer write
   target/ppc: Fix CPU reservation migration for record-replay
   target/ppc: Fix timebase reset with record-replay
   spapr: Fix machine reset deadlock from replay-record
   spapr: Fix record-replay machine reset consuming too many events
   tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount
   tests/avocado: reverse-debugging cope with re-executing breakpoints
   tests/avocado: ppc64 reverse debugging tests for pseries and powernv
   target/ppc: Fix LQ, STQ register-pair order for big-endian

Richard Henderson (1):
   target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

Shawn Anastasio (1):
   target/ppc: Generate storage interrupts for radix RC changes

jianchunfu (1):
   target/ppc: Fix the order of kvm_enable judgment about 
kvmppc_set_interrupt()


Is there anything in there worth to pick for -stable?
Like, for example, some decrementer fixes, or some of these:

 ppc/vof: Fix missed fields in VOF cleanup
 spapr: Fix machine reset deadlock from replay-record
 hw/ppc/e500: fix broken snapshot replay

or something else?

Thanks!

/mjt



Re: [PULL v2 00/35] ppc queue

2023-09-07 Thread Stefan Hajnoczi
Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any 
user-visible changes.


signature.asc
Description: PGP signature


[PULL v2 00/35] ppc queue

2023-09-06 Thread Cédric Le Goater
The following changes since commit 2d8fbcb1eecd8d39171f457e583428758321d69d:

  Merge tag 'pull-request-2023-08-31' of https://gitlab.com/thuth/qemu into 
staging (2023-09-05 09:22:13 -0400)

are available in the Git repository at:

  https://github.com/legoater/qemu/ tags/pull-ppc-20230906

for you to fetch changes up to b68147b7a5bf6ea2c2b8a8830465e7e90bb2a77c:

  ppc/xive: Add support for the PC MMIOs (2023-09-06 11:19:33 +0200)


ppc queue :

* debug facility improvements
* timebase and decrementer fixes
* record-replay fixes
* TCG fixes
* XIVE model improvements for multichip


Changes since v1:

* renamed __muldiv64() to muldiv64_rounding()
* removed extra cpu and pcc variables shadowing local variables
* checkpatch.pl fixes


Cédric Le Goater (4):
  ppc/xive: Use address_space routines to access the machine RAM
  ppc/xive: Introduce a new XiveRouter end_notify() handler
  ppc/xive: Handle END triggers between chips with MMIOs
  ppc/xive: Add support for the PC MMIOs

Joel Stanley (1):
  ppc: Add stub implementation of TRIG SPRs

Maksim Kostin (1):
  hw/ppc/e500: fix broken snapshot replay

Nicholas Piggin (26):
  target/ppc: Remove single-step suppression inside 0x100-0xf00
  target/ppc: Improve book3s branch trace interrupt for v2.07S
  target/ppc: Suppress single step interrupts on rfi-type instructions
  target/ppc: Implement breakpoint debug facility for v2.07S
  target/ppc: Implement watchpoint debug facility for v2.07S
  spapr: implement H_SET_MODE debug facilities
  ppc/vhyp: reset exception state when handling vhyp hcall
  ppc/vof: Fix missed fields in VOF cleanup
  hw/ppc/ppc.c: Tidy over-long lines
  hw/ppc: Introduce functions for conversion between timebase and 
nanoseconds
  host-utils: Add muldiv64_round_up
  hw/ppc: Round up the decrementer interval when converting to ns
  hw/ppc: Avoid decrementer rounding errors
  target/ppc: Sign-extend large decrementer to 64-bits
  hw/ppc: Always store the decrementer value
  target/ppc: Migrate DECR SPR
  hw/ppc: Reset timebase facilities on machine reset
  hw/ppc: Read time only once to perform decrementer write
  target/ppc: Fix CPU reservation migration for record-replay
  target/ppc: Fix timebase reset with record-replay
  spapr: Fix machine reset deadlock from replay-record
  spapr: Fix record-replay machine reset consuming too many events
  tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount
  tests/avocado: reverse-debugging cope with re-executing breakpoints
  tests/avocado: ppc64 reverse debugging tests for pseries and powernv
  target/ppc: Fix LQ, STQ register-pair order for big-endian

Richard Henderson (1):
  target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

Shawn Anastasio (1):
  target/ppc: Generate storage interrupts for radix RC changes

jianchunfu (1):
  target/ppc: Fix the order of kvm_enable judgment about 
kvmppc_set_interrupt()

 hw/intc/pnv_xive_regs.h|   1 +
 include/hw/ppc/ppc.h   |   3 +-
 include/hw/ppc/spapr.h |   2 +
 include/hw/ppc/xive.h  |   2 +
 include/qemu/host-utils.h  |  21 ++-
 target/ppc/cpu.h   |  12 ++
 target/ppc/helper.h|   4 +
 target/ppc/internal.h  |   3 +
 target/ppc/spr_common.h|   3 +
 hw/intc/pnv_xive.c | 170 +++-
 hw/intc/pnv_xive2.c|  27 +++-
 hw/intc/xive.c |  28 ++--
 hw/ppc/e500.c  |   2 +-
 hw/ppc/mac_oldworld.c  |   1 +
 hw/ppc/pegasos2.c  |   1 +
 hw/ppc/pnv_core.c  |   2 +
 hw/ppc/ppc.c   | 243 +++--
 hw/ppc/prep.c  |   1 +
 hw/ppc/spapr.c |  32 +++-
 hw/ppc/spapr_cpu_core.c|   2 +
 hw/ppc/spapr_hcall.c   |  57 +++
 hw/ppc/vof.c   |   2 +
 target/ppc/compat.c|  19 +++
 target/ppc/cpu.c   |  87 +++
 target/ppc/cpu_init.c  |  21 ++-
 target/ppc/excp_helper.c   | 111 -
 target/ppc/kvm.c   |   2 +-
 target/ppc/machine.c   |  45 +-
 target/ppc/misc_helper.c   |  15 ++
 target/ppc/mmu-radix64.c   |  74 ++---
 target/ppc/translate.c |  64 ++--
 target/ppc/translate/fixedpoint-impl.c.inc |  16 +-
 tests/avocado/replay_kernel.py |   3 +-