qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 6dc6b5: target/ppc: Improve syscall exception


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 6dc6b5: target/ppc: Improve syscall exception logging
Date: Thu, 07 May 2020 06:30:31 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 6dc6b557913f29e012880e381c0a3f452b415f1d
      
https://github.com/qemu/qemu/commit/6dc6b557913f29e012880e381c0a3f452b415f1d
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/excp_helper.c

  Log Message:
  -----------
  target/ppc: Improve syscall exception logging

system calls (at least in Linux) use registers r3-r8 for inputs, so
include those registers in the dump.

This also adds a mode for PAPR hcalls, which have a different calling
convention.

Signed-off-by: Nicholas Piggin <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 86962462f89b2abbba18e5c2243d59bd408f04d4
      
https://github.com/qemu/qemu/commit/86962462f89b2abbba18e5c2243d59bd408f04d4
  Author: Greg Kurz <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr_hcall.c

  Log Message:
  -----------
  spapr: Don't check capabilities removed between CAS calls

We currently check if some capability in OV5 was removed by the guest
since the previous CAS, and we trigger a CAS reboot in that case. This
was required because it could call for a device-tree property or node
removal, that we didn't support until recently (see commit 6787d27b04a7
"spapr: add option vector handling in CAS-generated resets" for details).

Now that we render a full FDT at CAS and that SLOF is able to handle
node removal, we don't need to do a CAS reset in this case anymore.
Also, this check can only return true if the guest has already called
CAS since the last full system reset (otherwise spapr->ov5_cas is
empty). Linux doesn't do that so this can be considered as dead code
for the vast majority of existing setups.

Drop the check. Since the only use of the ov5_cas_old variable is
precisely the check itself, drop the variable as well.

Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: b5b7f391817558f645034ea2e26bbed1e75eb731
      
https://github.com/qemu/qemu/commit/b5b7f391817558f645034ea2e26bbed1e75eb731
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M target/ppc/cpu.h
    M target/ppc/excp_helper.c

  Log Message:
  -----------
  ppc/spapr: tweak change system reset helper

Rather than have the helper take an optional vector address
override, instead have its caller modify env->nip itself.
This is more consistent when adding pnv nmi support, and also
with mce injection added later.

Signed-off-by: Nicholas Piggin <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 01b552b05b0f21f8ff57a508f7ad26f7abbcd123
      
https://github.com/qemu/qemu/commit/01b552b05b0f21f8ff57a508f7ad26f7abbcd123
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/pnv.c

  Log Message:
  -----------
  ppc/pnv: Add support for NMI interface

This implements the NMI interface for the PNV machine, similarly to
commit 3431648272d ("spapr: Add support for new NMI interface") for
SPAPR.

Signed-off-by: Nicholas Piggin <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Cédric Le Goater <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: b4b83312e72461540ee155006f0d49e33bf0c58d
      
https://github.com/qemu/qemu/commit/b4b83312e72461540ee155006f0d49e33bf0c58d
  Author: Greg Kurz <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c

  Log Message:
  -----------
  spapr: Simplify selection of radix/hash during CAS

The guest can select the MMU mode by setting bits 0-1 of byte 24
in OV5 to to 0b00 for hash or 0b01 for radix. As required by the
architecture, we terminate the boot process if any other value
is found there.

The usual way to negotiate features in OV5 is basically ANDing
the bitfield provided by the guest and the bitfield of features
supported by QEMU, previously populated at machine init.

For some not documented reason, MMU is treated differently : bit 1
of byte 24 (the radix/hash bit) is cleared from the guest OV5 and
explicitely set in the final negotiated OV5 if radix was requested.

Since the only expected input from the guest is the radix/hash bit
being set or not, it seems more appropriate to handle this like we
do for XIVE.

Set the radix bit in spapr->ov5 at machine init if it has a chance
to work (ie. power9, either TCG or a radix capable KVM) and rely
exclusively on spapr_ovec_intersect() to set the radix bit in
spapr->ov5_cas.

Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 91067db1abcdc6caf951494b8d7e4bfaaa0cb61d
      
https://github.com/qemu/qemu/commit/91067db1abcdc6caf951494b8d7e4bfaaa0cb61d
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M include/hw/ppc/spapr.h

  Log Message:
  -----------
  spapr/cas: Separate CAS handling from rebuilding the FDT

At the moment "ibm,client-architecture-support" ("CAS") is implemented
in SLOF and QEMU assists via the custom H_CAS hypercall which copies
an updated flatten device tree (FDT) blob to the SLOF memory which
it then uses to update its internal tree.

When we enable the OpenFirmware client interface in QEMU, we won't need
to copy the FDT to the guest as the client is expected to fetch
the device tree using the client interface.

This moves FDT rebuild out to a separate helper which is going to be
called from the "ibm,client-architecture-support" handler and leaves
writing FDT to the guest in the H_CAS handler.

This should not cause any behavioral change.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 087820e37f05c391c1ea77b1761ed489c928872e
      
https://github.com/qemu/qemu/commit/087820e37f05c391c1ea77b1761ed489c928872e
  Author: Greg Kurz <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M include/hw/ppc/spapr.h

  Log Message:
  -----------
  spapr: Drop CAS reboot flag

The CAS reboot flag is false by default and all the locations that
could set it to true have been dropped. This means that all code
blocks depending on the flag being set is dead code and the other
code blocks should be executed always.

Just do that and drop the now uneeded CAS reboot flag. Fix a
comment on the way to make checkpatch happy.

Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 933abb9c238726c3f2862affd0d46b043a22c3e0
      
https://github.com/qemu/qemu/commit/933abb9c238726c3f2862affd0d46b043a22c3e0
  Author: Suraj Jitindar Singh <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Enforce that the root page directory size must be at least 5

According to the ISA the root page directory size of a radix tree for
either process- or partition-scoped translation must be >= 5.

Thus add this to the list of conditions checked when validating the
partition table entry in validate_pate();

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: f208ec7160145a77647af9b01a393615e7a9f8c6
      
https://github.com/qemu/qemu/commit/f208ec7160145a77647af9b01a393615e7a9f8c6
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Introduce a relocation bool in ppc_radix64_handle_mmu_fault()

It will ease the introduction of new routines for partition-scoped
Radix translation.

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: beae5e9dc6eedc7d7fda333a3b71aa9f7e6b4a3f
      
https://github.com/qemu/qemu/commit/beae5e9dc6eedc7d7fda333a3b71aa9f7e6b4a3f
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Assert if HV mode is set when running under a pseries machine

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 05af7c77f5f24ef2bec25f2cab22170c29edaf37
      
https://github.com/qemu/qemu/commit/05af7c77f5f24ef2bec25f2cab22170c29edaf37
  Author: David Gibson <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr: Don't allow unplug of NVLink2 devices

Currently, we can't properly handle unplug of NVLink2 devices, because we
don't have code to tear down their special memory resources.  There's not
a lot of impetus to implement that: since hardware NVLink2 devices can't
be hot unplugged, the guest side drivers don't usually support unplug
anyway.

Therefore, simply prevent unplug of NVLink2 devices.

Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>


  Commit: d92baf00aad9bba521c2b3cb23fe388c2067aaa0
      
https://github.com/qemu/qemu/commit/d92baf00aad9bba521c2b3cb23fe388c2067aaa0
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Introduce ppc_radix64_xlate() for Radix tree translation

This is moving code under a new ppc_radix64_xlate() routine shared by
the MMU Radix page fault handler and the 'get_phys_page_debug' PPC
callback. The difference being that 'get_phys_page_debug' does not
generate exceptions.

The specific part of process-scoped Radix translation is moved under
ppc_radix64_process_scoped_xlate() in preparation of the future support
for partition-scoped Radix translation. Routines raising the exceptions
now take a 'cause_excp' bool to cover the 'get_phys_page_debug' case.

It should be functionally equivalent.

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 522ad21875ac48426c282ef2b7dfe87adb40afb4
      
https://github.com/qemu/qemu/commit/522ad21875ac48426c282ef2b7dfe87adb40afb4
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Extend ppc_radix64_check_prot() with a 'partition_scoped' bool

This prepares ground for partition-scoped Radix translation.

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 6bffd48b9e8efcd6977c86f2ea8437771d15043c
      
https://github.com/qemu/qemu/commit/6bffd48b9e8efcd6977c86f2ea8437771d15043c
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Rework ppc_radix64_walk_tree() for partition-scoped translation

The ppc_radix64_walk_tree() routine walks through the nested radix
tables to look for a PTE.

Split it in two and introduce a new routine ppc_radix64_next_level()
which we will use for partition-scoped Radix translation when
translating the process tree addresses. The prototypes are slightly
change to use a 'AddressSpace *' parameter, instead of a 'PowerPCCPU *'
which is not required, and to return an error code instead of a PTE
value. It clarifies error handling in the callers.

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: d04ea940c597201a6610c5d1712809ed35dd77ec
      
https://github.com/qemu/qemu/commit/d04ea940c597201a6610c5d1712809ed35dd77ec
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/cpu.h
    M target/ppc/excp_helper.c
    M target/ppc/mmu-radix64.c

  Log Message:
  -----------
  target/ppc: Add support for Radix partition-scoped translation

The Radix tree translation model currently supports process-scoped
translation for the PowerNV machine (Hypervisor mode) and for the
pSeries machine (Guest mode). Guests running under an emulated
Hypervisor (PowerNV machine) require a new type of Radix translation,
called partition-scoped, which is missing today.

The Radix tree translation is a 2 steps process. The first step,
process-scoped translation, converts an effective Address to a guest
real address, and the second step, partition-scoped translation,
converts a guest real address to a host real address.

There are difference cases to covers :

* Hypervisor real mode access: no Radix translation.

* Hypervisor or host application access (quadrant 0 and 3) with
  relocation on: process-scoped translation.

* Guest OS real mode access: only partition-scoped translation.

* Guest OS real or guest application access (quadrant 0 and 3) with
  relocation on: both process-scoped translation and partition-scoped
  translations.

* Hypervisor access in quadrant 1 and 2 with relocation on: both
  process-scoped translation and partition-scoped translations.

The radix tree partition-scoped translation is performed using tables
pointed to by the first double-word of the Partition Table Entries and
process-scoped translation uses tables pointed to by the Process Table
Entries (second double-word of the Partition Table Entries).

Both partition-scoped and process-scoped translations process are
identical and thus the radix tree traversing code is largely reused.
However, errors in partition-scoped translations generate hypervisor
exceptions.

Signed-off-by: Suraj Jitindar Singh <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
[dwg: Fixup from Greg Kurz folded in]
Signed-off-by: David Gibson <address@hidden>


  Commit: 70fc9cb0920fce3c2c0a090e69bf06d39f4b2362
      
https://github.com/qemu/qemu/commit/70fc9cb0920fce3c2c0a090e69bf06d39f4b2362
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr_nvdimm.c

  Log Message:
  -----------
  spapr_nvdimm.c: make 'label-size' mandatory

The pseries machine does not support NVDIMM modules without label.
Attempting to do so, even if the overall block size is aligned with
256MB, will seg fault the guest kernel during NVDIMM probe. This
can be avoided by forcing 'label-size' to always be present for
sPAPR NVDIMMs.

The verification was put before the alignment check because the
presence of label-size affects the alignment calculation, so
it's not optimal to warn the user about an alignment error,
then about the lack of label-size, then about a new alignment
error when the user sets a label-size.

Signed-off-by: Daniel Henrique Barboza <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 6c0f0cb319bd9f906d461a2e12a2b5d1eb588fa2
      
https://github.com/qemu/qemu/commit/6c0f0cb319bd9f906d461a2e12a2b5d1eb588fa2
  Author: David Gibson <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/spapr_nvdimm.c

  Log Message:
  -----------
  spapr_nvdimm: Tweak error messages

The restrictions here (which are checked at pre-plug time) are PAPR
specific, rather than being inherent to the NVDIMM devices.  Adjust the
error messages to be clearer about this.

Signed-off-by: David Gibson <address@hidden>


  Commit: c4f6a4a3dd5f2aa15329b8158de25f50b5ba3252
      
https://github.com/qemu/qemu/commit/c4f6a4a3dd5f2aa15329b8158de25f50b5ba3252
  Author: Daniele Buono <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M target/ppc/translate.c

  Log Message:
  -----------
  target-ppc: fix rlwimi, rlwinm, rlwnm for Clang-9

Starting with Clang v9, -Wtype-limits is implemented and triggers a
few "result of comparison is always true" errors when compiling PPC32
targets.

The comparisons seem to be necessary only on PPC64, since the
else branch in PPC32 only has a "g_assert_not_reached();" in all cases.

This patch restructures the code so that the actual if/else is done on a
local flag variable, that is set accordingly for PPC64, and always
true for PPC32.

Signed-off-by: Daniele Buono <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: b894c6ed4a38c72dc160977e4bc066e9f643ff0a
      
https://github.com/qemu/qemu/commit/b894c6ed4a38c72dc160977e4bc066e9f643ff0a
  Author: Peter Maydell <address@hidden>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M hw/ppc/pnv.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_hcall.c
    M hw/ppc/spapr_nvdimm.c
    M hw/ppc/spapr_pci.c
    M include/hw/ppc/spapr.h
    M target/ppc/cpu.h
    M target/ppc/excp_helper.c
    M target/ppc/mmu-radix64.c
    M target/ppc/translate.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.1-20200507' into 
staging

ppc patch queue for 2020-04-07

First pull request for qemu-5.1.  This includes:
 * Removal of all remaining cases where we had CAS triggered reboots
 * A number of improvements to NMI injection
 * Support for partition scoped radix translation in softmmu
 * Some fixes for NVDIMM handling
 * A handful of other minor fixes

# gpg: Signature made Thu 07 May 2020 06:00:55 BST
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <address@hidden>" [full]
# gpg:                 aka "David Gibson (Red Hat) <address@hidden>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <address@hidden>" [full]
# gpg:                 aka "David Gibson (kernel.org) <address@hidden>" 
[unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-5.1-20200507:
  target-ppc: fix rlwimi, rlwinm, rlwnm for Clang-9
  spapr_nvdimm: Tweak error messages
  spapr_nvdimm.c: make 'label-size' mandatory
  target/ppc: Add support for Radix partition-scoped translation
  target/ppc: Rework ppc_radix64_walk_tree() for partition-scoped translation
  target/ppc: Extend ppc_radix64_check_prot() with a 'partition_scoped' bool
  target/ppc: Introduce ppc_radix64_xlate() for Radix tree translation
  spapr: Don't allow unplug of NVLink2 devices
  target/ppc: Assert if HV mode is set when running under a pseries machine
  target/ppc: Introduce a relocation bool in ppc_radix64_handle_mmu_fault()
  target/ppc: Enforce that the root page directory size must be at least 5
  spapr: Drop CAS reboot flag
  spapr/cas: Separate CAS handling from rebuilding the FDT
  spapr: Simplify selection of radix/hash during CAS
  ppc/pnv: Add support for NMI interface
  ppc/spapr: tweak change system reset helper
  spapr: Don't check capabilities removed between CAS calls
  target/ppc: Improve syscall exception logging

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/609dd53df540...b894c6ed4a38



reply via email to

[Prev in Thread] Current Thread [Next in Thread]