mbox

[PULL,00/20] ppc-for-6.0 queue 20210310

Message ID 20210310041002.333813-1-david@gibson.dropbear.id.au (mailing list archive)
State New, archived
Headers show

Pull-request

https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310

Message

David Gibson March 10, 2021, 4:09 a.m. UTC
The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:

  Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)

are available in the Git repository at:

  https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310

for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:

  spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)

----------------------------------------------------------------
ppc patch queue for 2021-03-10

Next batch of patches for the ppc target and machine types.  Includes:
 * Several cleanups for sm501 from Peter Maydell
 * An update to the SLOF guest firmware
 * Improved handling of hotplug failures in spapr, associated cleanups
   to the hotplug handling code
 * Several etsec fixes and cleanups from Bin Meng
 * Assorted other fixes and cleanups

----------------------------------------------------------------
Alexey Kardashevskiy (1):
      pseries: Update SLOF firmware image

Bin Meng (2):
      hw/net: fsl_etsec: Fix build error when HEX_DUMP is on
      hw/ppc: e500: Add missing <ranges> in the eTSEC node

Cédric Le Goater (1):
      docs/system: Extend PPC section

Daniel Henrique Barboza (11):
      spapr_drc.c: do not call spapr_drc_detach() in drc_isolate_logical()
      spapr_drc.c: use spapr_drc_release() in isolate_physical/set_unusable
      spapr: rename spapr_drc_detach() to spapr_drc_unplug_request()
      spapr_drc.c: introduce unplug_timeout_timer
      spapr_drc.c: add hotunplug timeout for CPUs
      spapr_drc.c: use DRC reconfiguration to cleanup DIMM unplug state
      spapr.c: add 'unplug already in progress' message for PHB unplug
      spapr_pci.c: add 'unplug already in progress' message for PCI unplug
      qemu_timer.c: add timer_deadline_ms() helper
      spapr.c: remove duplicated assert in spapr_memory_unplug_request()
      spapr.c: send QAPI event when memory hotunplug fails

Fabiano Rosas (1):
      target/ppc: Fix bcdsub. emulation when result overflows

Peter Maydell (3):
      hw/display/sm501: Remove dead code for non-32-bit RGB surfaces
      hw/display/sm501: Expand out macros in template header
      hw/display/sm501: Inline template header into C file

Vitaly Cheptsov (1):
      target/ppc: fix icount support on Book-e vms accessing SPRs

 docs/system/ppc/embedded.rst      |  10 ++
 docs/system/ppc/powermac.rst      |  34 +++++++
 docs/system/ppc/powernv.rst       | 193 ++++++++++++++++++++++++++++++++++++++
 docs/system/ppc/prep.rst          |  18 ++++
 docs/system/ppc/pseries.rst       |  12 +++
 docs/system/target-ppc.rst        |  53 +++--------
 hw/display/sm501.c                | 160 +++++++++++++++----------------
 hw/display/sm501_template.h       | 131 --------------------------
 hw/net/fsl_etsec/etsec.c          |   1 +
 hw/net/fsl_etsec/rings.c          |   1 +
 hw/ppc/e500.c                     |   1 +
 hw/ppc/spapr.c                    |  67 ++++++++++++-
 hw/ppc/spapr_drc.c                | 110 ++++++++++++++++------
 hw/ppc/spapr_pci.c                |   8 +-
 hw/ppc/trace-events               |   2 +-
 include/hw/ppc/spapr.h            |   1 +
 include/hw/ppc/spapr_drc.h        |   7 +-
 include/qemu/timer.h              |   8 ++
 pc-bios/README                    |   2 +-
 pc-bios/slof.bin                  | Bin 968368 -> 968888 bytes
 roms/SLOF                         |   2 +-
 target/ppc/int_helper.c           |  13 ++-
 target/ppc/translate_init.c.inc   |  36 +++++++
 tests/tcg/configure.sh            |   6 ++
 tests/tcg/ppc64/Makefile.target   |  13 +++
 tests/tcg/ppc64le/Makefile.target |  12 +++
 tests/tcg/ppc64le/bcdsub.c        | 130 +++++++++++++++++++++++++
 util/qemu-timer.c                 |  13 +++
 28 files changed, 751 insertions(+), 293 deletions(-)
 create mode 100644 docs/system/ppc/embedded.rst
 create mode 100644 docs/system/ppc/powermac.rst
 create mode 100644 docs/system/ppc/powernv.rst
 create mode 100644 docs/system/ppc/prep.rst
 create mode 100644 docs/system/ppc/pseries.rst
 delete mode 100644 hw/display/sm501_template.h
 create mode 100644 tests/tcg/ppc64/Makefile.target
 create mode 100644 tests/tcg/ppc64le/Makefile.target
 create mode 100644 tests/tcg/ppc64le/bcdsub.c

Comments

Bin Meng March 10, 2021, 4:43 a.m. UTC | #1
Hi David,

On Wed, Mar 10, 2021 at 12:10 PM David Gibson
<david@gibson.dropbear.id.au> wrote:
>
> The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:
>
>   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310
>
> for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:
>
>   spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)
>
> ----------------------------------------------------------------
> ppc patch queue for 2021-03-10
>
> Next batch of patches for the ppc target and machine types.  Includes:
>  * Several cleanups for sm501 from Peter Maydell
>  * An update to the SLOF guest firmware
>  * Improved handling of hotplug failures in spapr, associated cleanups
>    to the hotplug handling code
>  * Several etsec fixes and cleanups from Bin Meng
>  * Assorted other fixes and cleanups
>
> ----------------------------------------------------------------
> Alexey Kardashevskiy (1):
>       pseries: Update SLOF firmware image
>
> Bin Meng (2):
>       hw/net: fsl_etsec: Fix build error when HEX_DUMP is on
>       hw/ppc: e500: Add missing <ranges> in the eTSEC node

It seems the following patch was missing?
http://patchwork.ozlabs.org/project/qemu-devel/patch/1613660319-76960-1-git-send-email-bmeng.cn@gmail.com/

>
> Cédric Le Goater (1):
>       docs/system: Extend PPC section
>
> Daniel Henrique Barboza (11):
>       spapr_drc.c: do not call spapr_drc_detach() in drc_isolate_logical()
>       spapr_drc.c: use spapr_drc_release() in isolate_physical/set_unusable
>       spapr: rename spapr_drc_detach() to spapr_drc_unplug_request()
>       spapr_drc.c: introduce unplug_timeout_timer
>       spapr_drc.c: add hotunplug timeout for CPUs
>       spapr_drc.c: use DRC reconfiguration to cleanup DIMM unplug state
>       spapr.c: add 'unplug already in progress' message for PHB unplug
>       spapr_pci.c: add 'unplug already in progress' message for PCI unplug
>       qemu_timer.c: add timer_deadline_ms() helper
>       spapr.c: remove duplicated assert in spapr_memory_unplug_request()
>       spapr.c: send QAPI event when memory hotunplug fails
>
> Fabiano Rosas (1):
>       target/ppc: Fix bcdsub. emulation when result overflows
>
> Peter Maydell (3):
>       hw/display/sm501: Remove dead code for non-32-bit RGB surfaces
>       hw/display/sm501: Expand out macros in template header
>       hw/display/sm501: Inline template header into C file
>
> Vitaly Cheptsov (1):
>       target/ppc: fix icount support on Book-e vms accessing SPRs
>

Regards,
Bin
David Gibson March 10, 2021, 6 a.m. UTC | #2
On Wed, Mar 10, 2021 at 12:43:53PM +0800, Bin Meng wrote:
> Hi David,
> 
> On Wed, Mar 10, 2021 at 12:10 PM David Gibson
> <david@gibson.dropbear.id.au> wrote:
> >
> > The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:
> >
> >   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)
> >
> > are available in the Git repository at:
> >
> >   https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310
> >
> > for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:
> >
> >   spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)
> >
> > ----------------------------------------------------------------
> > ppc patch queue for 2021-03-10
> >
> > Next batch of patches for the ppc target and machine types.  Includes:
> >  * Several cleanups for sm501 from Peter Maydell
> >  * An update to the SLOF guest firmware
> >  * Improved handling of hotplug failures in spapr, associated cleanups
> >    to the hotplug handling code
> >  * Several etsec fixes and cleanups from Bin Meng
> >  * Assorted other fixes and cleanups
> >
> > ----------------------------------------------------------------
> > Alexey Kardashevskiy (1):
> >       pseries: Update SLOF firmware image
> >
> > Bin Meng (2):
> >       hw/net: fsl_etsec: Fix build error when HEX_DUMP is on
> >       hw/ppc: e500: Add missing <ranges> in the eTSEC node
> 
> It seems the following patch was missing?
> http://patchwork.ozlabs.org/project/qemu-devel/patch/1613660319-76960-1-git-send-email-bmeng.cn@gmail.com/

Huh, sorry.  I don't know how that dropped out of my tree.

I don't really want to delay this batch, so can you resend please, and
I'll include it in the next batch.
Ivan Warren March 10, 2021, 2:09 p.m. UTC | #3
Hey there,

Any chance the MSR[SF] mixed code issue fix gets addressed at some point ?

(Apparently there was a fix but it was breaking some tests for some 
unknown reason)...

--Ivan

On 3/10/2021 5:09 AM, David Gibson wrote:
> The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:
>
>    Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)
>
> are available in the Git repository at:
>
>    https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310
>
> for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:
>
>    spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)
>
> ----------------------------------------------------------------
> ppc patch queue for 2021-03-10
>
> Next batch of patches for the ppc target and machine types.  Includes:
>   * Several cleanups for sm501 from Peter Maydell
>   * An update to the SLOF guest firmware
>   * Improved handling of hotplug failures in spapr, associated cleanups
>     to the hotplug handling code
>   * Several etsec fixes and cleanups from Bin Meng
>   * Assorted other fixes and cleanups
>
> ----------------------------------------------------------------
> Alexey Kardashevskiy (1):
>        pseries: Update SLOF firmware image
>
> Bin Meng (2):
>        hw/net: fsl_etsec: Fix build error when HEX_DUMP is on
>        hw/ppc: e500: Add missing <ranges> in the eTSEC node
>
> Cédric Le Goater (1):
>        docs/system: Extend PPC section
>
> Daniel Henrique Barboza (11):
>        spapr_drc.c: do not call spapr_drc_detach() in drc_isolate_logical()
>        spapr_drc.c: use spapr_drc_release() in isolate_physical/set_unusable
>        spapr: rename spapr_drc_detach() to spapr_drc_unplug_request()
>        spapr_drc.c: introduce unplug_timeout_timer
>        spapr_drc.c: add hotunplug timeout for CPUs
>        spapr_drc.c: use DRC reconfiguration to cleanup DIMM unplug state
>        spapr.c: add 'unplug already in progress' message for PHB unplug
>        spapr_pci.c: add 'unplug already in progress' message for PCI unplug
>        qemu_timer.c: add timer_deadline_ms() helper
>        spapr.c: remove duplicated assert in spapr_memory_unplug_request()
>        spapr.c: send QAPI event when memory hotunplug fails
>
> Fabiano Rosas (1):
>        target/ppc: Fix bcdsub. emulation when result overflows
>
> Peter Maydell (3):
>        hw/display/sm501: Remove dead code for non-32-bit RGB surfaces
>        hw/display/sm501: Expand out macros in template header
>        hw/display/sm501: Inline template header into C file
>
> Vitaly Cheptsov (1):
>        target/ppc: fix icount support on Book-e vms accessing SPRs
>
>   docs/system/ppc/embedded.rst      |  10 ++
>   docs/system/ppc/powermac.rst      |  34 +++++++
>   docs/system/ppc/powernv.rst       | 193 ++++++++++++++++++++++++++++++++++++++
>   docs/system/ppc/prep.rst          |  18 ++++
>   docs/system/ppc/pseries.rst       |  12 +++
>   docs/system/target-ppc.rst        |  53 +++--------
>   hw/display/sm501.c                | 160 +++++++++++++++----------------
>   hw/display/sm501_template.h       | 131 --------------------------
>   hw/net/fsl_etsec/etsec.c          |   1 +
>   hw/net/fsl_etsec/rings.c          |   1 +
>   hw/ppc/e500.c                     |   1 +
>   hw/ppc/spapr.c                    |  67 ++++++++++++-
>   hw/ppc/spapr_drc.c                | 110 ++++++++++++++++------
>   hw/ppc/spapr_pci.c                |   8 +-
>   hw/ppc/trace-events               |   2 +-
>   include/hw/ppc/spapr.h            |   1 +
>   include/hw/ppc/spapr_drc.h        |   7 +-
>   include/qemu/timer.h              |   8 ++
>   pc-bios/README                    |   2 +-
>   pc-bios/slof.bin                  | Bin 968368 -> 968888 bytes
>   roms/SLOF                         |   2 +-
>   target/ppc/int_helper.c           |  13 ++-
>   target/ppc/translate_init.c.inc   |  36 +++++++
>   tests/tcg/configure.sh            |   6 ++
>   tests/tcg/ppc64/Makefile.target   |  13 +++
>   tests/tcg/ppc64le/Makefile.target |  12 +++
>   tests/tcg/ppc64le/bcdsub.c        | 130 +++++++++++++++++++++++++
>   util/qemu-timer.c                 |  13 +++
>   28 files changed, 751 insertions(+), 293 deletions(-)
>   create mode 100644 docs/system/ppc/embedded.rst
>   create mode 100644 docs/system/ppc/powermac.rst
>   create mode 100644 docs/system/ppc/powernv.rst
>   create mode 100644 docs/system/ppc/prep.rst
>   create mode 100644 docs/system/ppc/pseries.rst
>   delete mode 100644 hw/display/sm501_template.h
>   create mode 100644 tests/tcg/ppc64/Makefile.target
>   create mode 100644 tests/tcg/ppc64le/Makefile.target
>   create mode 100644 tests/tcg/ppc64le/bcdsub.c
>
Bin Meng March 11, 2021, 1:26 a.m. UTC | #4
On Thu, Mar 11, 2021 at 7:01 AM David Gibson
<david@gibson.dropbear.id.au> wrote:
>
> On Wed, Mar 10, 2021 at 12:43:53PM +0800, Bin Meng wrote:
> > Hi David,
> >
> > On Wed, Mar 10, 2021 at 12:10 PM David Gibson
> > <david@gibson.dropbear.id.au> wrote:
> > >
> > > The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:
> > >
> > >   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)
> > >
> > > are available in the Git repository at:
> > >
> > >   https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310
> > >
> > > for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:
> > >
> > >   spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)
> > >
> > > ----------------------------------------------------------------
> > > ppc patch queue for 2021-03-10
> > >
> > > Next batch of patches for the ppc target and machine types.  Includes:
> > >  * Several cleanups for sm501 from Peter Maydell
> > >  * An update to the SLOF guest firmware
> > >  * Improved handling of hotplug failures in spapr, associated cleanups
> > >    to the hotplug handling code
> > >  * Several etsec fixes and cleanups from Bin Meng
> > >  * Assorted other fixes and cleanups
> > >
> > > ----------------------------------------------------------------
> > > Alexey Kardashevskiy (1):
> > >       pseries: Update SLOF firmware image
> > >
> > > Bin Meng (2):
> > >       hw/net: fsl_etsec: Fix build error when HEX_DUMP is on
> > >       hw/ppc: e500: Add missing <ranges> in the eTSEC node
> >
> > It seems the following patch was missing?
> > http://patchwork.ozlabs.org/project/qemu-devel/patch/1613660319-76960-1-git-send-email-bmeng.cn@gmail.com/
>
> Huh, sorry.  I don't know how that dropped out of my tree.
>
> I don't really want to delay this batch, so can you resend please, and
> I'll include it in the next batch.

Sure, will resend.

Regards,
Bin
David Gibson March 11, 2021, 1:47 a.m. UTC | #5
On Wed, Mar 10, 2021 at 03:09:46PM +0100, Ivan Warren wrote:
> Hey there,
> 
> Any chance the MSR[SF] mixed code issue fix gets addressed at some point ?
> 
> (Apparently there was a fix but it was breaking some tests for some unknown
> reason)...

Sorry, I've forgotten this issue.  If you had a patch, can you resend
it please.

> 
> --Ivan
> 
> On 3/10/2021 5:09 AM, David Gibson wrote:
> > The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:
> > 
> >    Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)
> > 
> > are available in the Git repository at:
> > 
> >    https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310
> > 
> > for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:
> > 
> >    spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)
> > 
> > ----------------------------------------------------------------
> > ppc patch queue for 2021-03-10
> > 
> > Next batch of patches for the ppc target and machine types.  Includes:
> >   * Several cleanups for sm501 from Peter Maydell
> >   * An update to the SLOF guest firmware
> >   * Improved handling of hotplug failures in spapr, associated cleanups
> >     to the hotplug handling code
> >   * Several etsec fixes and cleanups from Bin Meng
> >   * Assorted other fixes and cleanups
> > 
> > ----------------------------------------------------------------
> > Alexey Kardashevskiy (1):
> >        pseries: Update SLOF firmware image
> > 
> > Bin Meng (2):
> >        hw/net: fsl_etsec: Fix build error when HEX_DUMP is on
> >        hw/ppc: e500: Add missing <ranges> in the eTSEC node
> > 
> > Cédric Le Goater (1):
> >        docs/system: Extend PPC section
> > 
> > Daniel Henrique Barboza (11):
> >        spapr_drc.c: do not call spapr_drc_detach() in drc_isolate_logical()
> >        spapr_drc.c: use spapr_drc_release() in isolate_physical/set_unusable
> >        spapr: rename spapr_drc_detach() to spapr_drc_unplug_request()
> >        spapr_drc.c: introduce unplug_timeout_timer
> >        spapr_drc.c: add hotunplug timeout for CPUs
> >        spapr_drc.c: use DRC reconfiguration to cleanup DIMM unplug state
> >        spapr.c: add 'unplug already in progress' message for PHB unplug
> >        spapr_pci.c: add 'unplug already in progress' message for PCI unplug
> >        qemu_timer.c: add timer_deadline_ms() helper
> >        spapr.c: remove duplicated assert in spapr_memory_unplug_request()
> >        spapr.c: send QAPI event when memory hotunplug fails
> > 
> > Fabiano Rosas (1):
> >        target/ppc: Fix bcdsub. emulation when result overflows
> > 
> > Peter Maydell (3):
> >        hw/display/sm501: Remove dead code for non-32-bit RGB surfaces
> >        hw/display/sm501: Expand out macros in template header
> >        hw/display/sm501: Inline template header into C file
> > 
> > Vitaly Cheptsov (1):
> >        target/ppc: fix icount support on Book-e vms accessing SPRs
> > 
> >   docs/system/ppc/embedded.rst      |  10 ++
> >   docs/system/ppc/powermac.rst      |  34 +++++++
> >   docs/system/ppc/powernv.rst       | 193 ++++++++++++++++++++++++++++++++++++++
> >   docs/system/ppc/prep.rst          |  18 ++++
> >   docs/system/ppc/pseries.rst       |  12 +++
> >   docs/system/target-ppc.rst        |  53 +++--------
> >   hw/display/sm501.c                | 160 +++++++++++++++----------------
> >   hw/display/sm501_template.h       | 131 --------------------------
> >   hw/net/fsl_etsec/etsec.c          |   1 +
> >   hw/net/fsl_etsec/rings.c          |   1 +
> >   hw/ppc/e500.c                     |   1 +
> >   hw/ppc/spapr.c                    |  67 ++++++++++++-
> >   hw/ppc/spapr_drc.c                | 110 ++++++++++++++++------
> >   hw/ppc/spapr_pci.c                |   8 +-
> >   hw/ppc/trace-events               |   2 +-
> >   include/hw/ppc/spapr.h            |   1 +
> >   include/hw/ppc/spapr_drc.h        |   7 +-
> >   include/qemu/timer.h              |   8 ++
> >   pc-bios/README                    |   2 +-
> >   pc-bios/slof.bin                  | Bin 968368 -> 968888 bytes
> >   roms/SLOF                         |   2 +-
> >   target/ppc/int_helper.c           |  13 ++-
> >   target/ppc/translate_init.c.inc   |  36 +++++++
> >   tests/tcg/configure.sh            |   6 ++
> >   tests/tcg/ppc64/Makefile.target   |  13 +++
> >   tests/tcg/ppc64le/Makefile.target |  12 +++
> >   tests/tcg/ppc64le/bcdsub.c        | 130 +++++++++++++++++++++++++
> >   util/qemu-timer.c                 |  13 +++
> >   28 files changed, 751 insertions(+), 293 deletions(-)
> >   create mode 100644 docs/system/ppc/embedded.rst
> >   create mode 100644 docs/system/ppc/powermac.rst
> >   create mode 100644 docs/system/ppc/powernv.rst
> >   create mode 100644 docs/system/ppc/prep.rst
> >   create mode 100644 docs/system/ppc/pseries.rst
> >   delete mode 100644 hw/display/sm501_template.h
> >   create mode 100644 tests/tcg/ppc64/Makefile.target
> >   create mode 100644 tests/tcg/ppc64le/Makefile.target
> >   create mode 100644 tests/tcg/ppc64le/bcdsub.c
> > 
>
Ivan Warren March 11, 2021, 3:22 a.m. UTC | #6
On 3/11/2021 2:47 AM, David Gibson wrote:
>
> Sorry, I've forgotten this issue.  If you had a patch, can you resend
> it please.

Not mine.. (I reported it, but can't remember who sent it)...

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h

index 2609e4082e..4a05e4e544 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2396,8 +2396,8 @@ static inline void 
cpu_get_tb_cpu_state(CPUPPCState *env, target_ulong *pc,
                                          target_ulong *cs_base, 
uint32_t *flags)
  {
      *pc = env->nip;
-    *cs_base = 0;
-    *flags = env->hflags;
+    *cs_base = env->hflags;
+    *flags = 0;
  }

  void QEMU_NORETURN raise_exception(CPUPPCState *env, uint32_t exception);
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 0984ce637b..1eb2e1b0c6 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7879,47 +7879,37 @@ static void 
ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
  {
      DisasContext *ctx = container_of(dcbase, DisasContext, base);
      CPUPPCState *env = cs->env_ptr;
+    target_ulong hflags = ctx->base.tb->cs_base;
      int bound;

      ctx->exception = POWERPC_EXCP_NONE;
      ctx->spr_cb = env->spr_cb;
-    ctx->pr = msr_pr;
+    ctx->pr = (hflags >> MSR_PR) & 1;
      ctx->mem_idx = env->dmmu_idx;
-    ctx->dr = msr_dr;
-#if !defined(CONFIG_USER_ONLY)
-    ctx->hv = msr_hv || !env->has_hv_mode;
+    ctx->dr = (hflags >> MSR_DR) & 1;
+#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY)
+    ctx->hv = (hflags >> MSR_HV) & 1;
  #endif
      ctx->insns_flags = env->insns_flags;
      ctx->insns_flags2 = env->insns_flags2;
      ctx->access_type = -1;
      ctx->need_access_type = !mmu_is_64bit(env->mmu_model);
-    ctx->le_mode = !!(env->hflags & (1 << MSR_LE));
+    ctx->le_mode = (hflags >> MSR_LE) & 1;
      ctx->default_tcg_memop_mask = ctx->le_mode ? MO_LE : MO_BE;
      ctx->flags = env->flags;
  #if defined(TARGET_PPC64)
-    ctx->sf_mode = msr_is_64bit(env, env->msr);
+    ctx->sf_mode = (hflags >> MSR_SF) & 1;
      ctx->has_cfar = !!(env->flags & POWERPC_FLAG_CFAR);
  #endif
      ctx->lazy_tlb_flush = env->mmu_model == POWERPC_MMU_32B
          || env->mmu_model == POWERPC_MMU_601
          || env->mmu_model & POWERPC_MMU_64;

-    ctx->fpu_enabled = !!msr_fp;
-    if ((env->flags & POWERPC_FLAG_SPE) && msr_spe) {
-        ctx->spe_enabled = !!msr_spe;
-    } else {
-        ctx->spe_enabled = false;
-    }
-    if ((env->flags & POWERPC_FLAG_VRE) && msr_vr) {
-        ctx->altivec_enabled = !!msr_vr;
-    } else {
-        ctx->altivec_enabled = false;
-    }
-    if ((env->flags & POWERPC_FLAG_VSX) && msr_vsx) {
-        ctx->vsx_enabled = !!msr_vsx;
-    } else {
-        ctx->vsx_enabled = false;
-    }
+    ctx->fpu_enabled = (hflags >> MSR_FP) & 1;
+    ctx->spe_enabled = (hflags >> MSR_SPE) & 1;
+    ctx->altivec_enabled = (hflags >> MSR_VR) & 1;
+    ctx->vsx_enabled = (hflags >> MSR_VSX) & 1;
+    /* FIXME: This needs to be stored in env->hflags_nmsr. */
      if ((env->flags & POWERPC_FLAG_SCV)
          && (env->spr[SPR_FSCR] & (1ull << FSCR_SCV))) {
          ctx->scv_enabled = true;
@@ -7927,23 +7917,21 @@ static void 
ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
          ctx->scv_enabled = false;
      }
  #if defined(TARGET_PPC64)
-    if ((env->flags & POWERPC_FLAG_TM) && msr_tm) {
-        ctx->tm_enabled = !!msr_tm;
-    } else {
-        ctx->tm_enabled = false;
-    }
+    ctx->tm_enabled = (hflags >> MSR_TM) & 1;
  #endif
+    /* FIXME: This needs to be stored in env->hflags_nmsr. */
      ctx->gtse = !!(env->spr[SPR_LPCR] & LPCR_GTSE);
-    if ((env->flags & POWERPC_FLAG_SE) && msr_se) {
-        ctx->singlestep_enabled = CPU_SINGLE_STEP;
-    } else {
-        ctx->singlestep_enabled = 0;
-    }
-    if ((env->flags & POWERPC_FLAG_BE) && msr_be) {
-        ctx->singlestep_enabled |= CPU_BRANCH_STEP;
-    }
-    if ((env->flags & POWERPC_FLAG_DE) && msr_de) {
+
+    ctx->singlestep_enabled = ((hflags >> MSR_SE) & 1 ? CPU_SINGLE_STEP 
: 0)
+                            | ((hflags >> MSR_BE) & 1 ? CPU_BRANCH_STEP 
: 0);
+
+    if ((hflags >> MSR_DE) & 1) {
          ctx->singlestep_enabled = 0;
+        /*
+         * FIXME: This needs to be stored in env->hflags_nmsr,
+         * probably overlapping MSR_SE/MSR_BE like we do for
+         * MSR_LE and the ppc 601.
+         */
          target_ulong dbcr0 = env->spr[SPR_BOOKE_DBCR0];
          if (dbcr0 & DBCR0_ICMP) {
              ctx->singlestep_enabled |= CPU_SINGLE_STEP;
@@ -7956,10 +7944,6 @@ static void 
ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
      if (unlikely(ctx->base.singlestep_enabled)) {
          ctx->singlestep_enabled |= GDBSTUB_SINGLE_STEP;
      }
David Gibson March 11, 2021, 4:56 a.m. UTC | #7
On Thu, Mar 11, 2021 at 04:22:44AM +0100, Ivan Warren wrote:
> 
> On 3/11/2021 2:47 AM, David Gibson wrote:
> > 
> > Sorry, I've forgotten this issue.  If you had a patch, can you resend
> > it please.
> 
> Not mine.. (I reported it, but can't remember who sent it)...
> 
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> 
> index 2609e4082e..4a05e4e544 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -2396,8 +2396,8 @@ static inline void cpu_get_tb_cpu_state(CPUPPCState
> *env, target_ulong *pc,
>                                          target_ulong *cs_base, uint32_t
> *flags)
>  {
>      *pc = env->nip;
> -    *cs_base = 0;
> -    *flags = env->hflags;
> +    *cs_base = env->hflags;
> +    *flags = 0;
>  }

Ah, that one.  It caused a regression, so I dropped it. I pinged
Richard Henderson about it, but I don't think I even had a reply.

I'm afraid I don't have the knowledge or the time to debug this
myself.
Richard Henderson March 11, 2021, 1:31 p.m. UTC | #8
On 3/10/21 10:56 PM, David Gibson wrote:
>>       *pc = env->nip;
>> -    *cs_base = 0;
>> -    *flags = env->hflags;
>> +    *cs_base = env->hflags;
>> +    *flags = 0;
>>   }
> 
> Ah, that one.  It caused a regression, so I dropped it. I pinged
> Richard Henderson about it, but I don't think I even had a reply.
> 
> I'm afraid I don't have the knowledge or the time to debug this
> myself.

I missed the regression email, sorry.  Do you recall what it was?

r~
Greg Kurz March 11, 2021, 3:54 p.m. UTC | #9
On Thu, 11 Mar 2021 07:31:40 -0600
Richard Henderson <richard.henderson@linaro.org> wrote:

> On 3/10/21 10:56 PM, David Gibson wrote:
> >>       *pc = env->nip;
> >> -    *cs_base = 0;
> >> -    *flags = env->hflags;
> >> +    *cs_base = env->hflags;
> >> +    *flags = 0;
> >>   }
> > 
> > Ah, that one.  It caused a regression, so I dropped it. I pinged
> > Richard Henderson about it, but I don't think I even had a reply.
> > 
> > I'm afraid I don't have the knowledge or the time to debug this
> > myself.
> 
> I missed the regression email, sorry.  Do you recall what it was?
> 
> r~

This was:

Message-ID: <20210210043453.GI4450@yekko.fritz.box>

On Wed, 10 Feb 2021 15:34:53 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> Well, I don't know why, but somehow this patch is breaking one of the
> acceptance tests:
> 
>  (043/134) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_ppc64_e500: INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{'name': '043-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_ppc64_e500', 'logdir': '/home/dwg/src/qemu/build/normal/tests/results/job-2021-02-10T15.04... (90.26 s)
> 
> From that timeout, I'm guessing something about this is causing the
> boot to wedge.
> 
> So, I've removed this from my tree for now, I'll need a fixed version
> to proceed with.

Cheers,

--
Greg
Greg Kurz March 11, 2021, 6:02 p.m. UTC | #10
On Thu, 11 Mar 2021 16:54:23 +0100
Greg Kurz <groug@kaod.org> wrote:

> On Thu, 11 Mar 2021 07:31:40 -0600
> Richard Henderson <richard.henderson@linaro.org> wrote:
> 
> > On 3/10/21 10:56 PM, David Gibson wrote:
> > >>       *pc = env->nip;
> > >> -    *cs_base = 0;
> > >> -    *flags = env->hflags;
> > >> +    *cs_base = env->hflags;
> > >> +    *flags = 0;
> > >>   }
> > > 
> > > Ah, that one.  It caused a regression, so I dropped it. I pinged
> > > Richard Henderson about it, but I don't think I even had a reply.
> > > 
> > > I'm afraid I don't have the knowledge or the time to debug this
> > > myself.
> > 
> > I missed the regression email, sorry.  Do you recall what it was?
> > 
> > r~
> 
> This was:
> 
> Message-ID: <20210210043453.GI4450@yekko.fritz.box>
> 
> On Wed, 10 Feb 2021 15:34:53 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > Well, I don't know why, but somehow this patch is breaking one of the
> > acceptance tests:
> > 
> >  (043/134) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_ppc64_e500: INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred: Timeout reached\nOriginal status: ERROR\n{'name': '043-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_ppc64_e500', 'logdir': '/home/dwg/src/qemu/build/normal/tests/results/job-2021-02-10T15.04... (90.26 s)
> > 
> > From that timeout, I'm guessing something about this is causing the
> > boot to wedge.
> > 
> > So, I've removed this from my tree for now, I'll need a fixed version
> > to proceed with.
> 

If this can help, I have run two gitlab CI pipelines against current
master (371983c1f).

The one without the patch passes:

https://gitlab.com/gkurz/qemu/-/pipelines/269023228

The one with the patch breaks:

https://gitlab.com/gkurz/qemu/-/pipelines/269077760

> Cheers,
> 
> --
> Greg
>
Peter Maydell March 12, 2021, 1:53 p.m. UTC | #11
On Wed, 10 Mar 2021 at 04:10, David Gibson <david@gibson.dropbear.id.au> wrote:
>
> The following changes since commit b2ae1009d7cca2701e17eae55ae2d44fd22c942a:
>
>   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into staging (2021-03-09 13:50:35 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/dgibson/qemu.git tags/ppc-for-6.0-20210310
>
> for you to fetch changes up to eb7f80fd26d73e7e1af105431da58971b1dba517:
>
>   spapr.c: send QAPI event when memory hotunplug fails (2021-03-10 09:07:09 +1100)
>
> ----------------------------------------------------------------
> ppc patch queue for 2021-03-10
>
> Next batch of patches for the ppc target and machine types.  Includes:
>  * Several cleanups for sm501 from Peter Maydell
>  * An update to the SLOF guest firmware
>  * Improved handling of hotplug failures in spapr, associated cleanups
>    to the hotplug handling code
>  * Several etsec fixes and cleanups from Bin Meng
>  * Assorted other fixes and cleanups
>
> ----------------------------------------------------------------


Applied, thanks.

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

-- PMM