All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 for-5.2 0/2] spapr: Improve error reporting in spapr_caps.c
@ 2020-07-16 17:10 Greg Kurz
  2020-07-16 17:11 ` [PATCH v4 for-5.2 1/2] spapr: Use error_append_hint() " Greg Kurz
  2020-07-16 17:11 ` [PATCH v4 for-5.2 2/2] spapr: Forbid nested KVM-HV in pre-power9 compat mode Greg Kurz
  0 siblings, 2 replies; 10+ messages in thread
From: Greg Kurz @ 2020-07-16 17:10 UTC (permalink / raw)
  To: David Gibson
  Cc: Markus Armbruster, Vladimir Sementsov-Ogievskiy, qemu-ppc,
	Laurent Vivier, qemu-devel

Nested KVM HV only works if the kernel is using the radix MMU mode, ie.
the CPU is POWER9 and it is not running in some pre-power9 compat mode.
Otherwise, the KVM HV module fails to load in the guest with -ENODEV.
It might be painful for a user to discover this late that nested cannot
work with their setup. It seems a better fit for QEMU to do a sanity
check when applying the nested-hv sPAPR capability and print out an
informative error message.

sPAPR capabilities are checked at machine init. If a capability cannot
be used, an error message is printed and QEMU exits. In most places,
the error message also contains an hint for the user. But we should
use error_append_hint() for that, as explained in the "qapi/error.h"
header.

So this series first converts spapr_caps.c to using error_append_hint().
This requires to add some ERRP_GUARD() because spapr_caps_apply() passes
&error_fatal. Then it adds a sanity check for the nested-hv case with
an error message and hint.

v4: - Same as v3 but rebased on ppc-for-5.2, updated changelogs
      and cover
v3: - Add preliminary patch to use warn_report() instead of
      a convoluted error_setg()+warn_report_err() sequence
v2: - Fix indentation and add some missing \n in patch 2
    - Add ERRP_AUTO_PROPAGATE() to cap_nested_kvm_hv_apply() in
      patch 2 instead of patch 3

---

Greg Kurz (2):
      spapr: Use error_append_hint() in spapr_caps.c
      spapr: Forbid nested KVM-HV in pre-power9 compat mode


 hw/ppc/spapr_caps.c |   99 +++++++++++++++++++++++++++++++--------------------
 1 file changed, 60 insertions(+), 39 deletions(-)

--
Greg



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-28 10:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 17:10 [PATCH v4 for-5.2 0/2] spapr: Improve error reporting in spapr_caps.c Greg Kurz
2020-07-16 17:11 ` [PATCH v4 for-5.2 1/2] spapr: Use error_append_hint() " Greg Kurz
2020-07-17  5:57   ` David Gibson
2020-07-20 15:24   ` Markus Armbruster
2020-07-27 13:04     ` Greg Kurz
2020-07-28  7:26       ` Markus Armbruster
2020-07-28  9:07         ` Greg Kurz
2020-07-28 10:09           ` David Gibson
2020-07-16 17:11 ` [PATCH v4 for-5.2 2/2] spapr: Forbid nested KVM-HV in pre-power9 compat mode Greg Kurz
2020-07-17  5:58   ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.