qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Daniel Black <daniel@linux.ibm.com>
Cc: "open list:sPAPR" <qemu-ppc@nongnu.org>,
	qemu-devel@nongnu.org, Greg Kurz <groug@kaod.org>
Subject: Re: [Qemu-devel] [PATCH v3] spapr: quantify error messages regarding capability settings
Date: Fri, 9 Aug 2019 14:58:25 +1000	[thread overview]
Message-ID: <20190809045825.GQ5465@umbus.fritz.box> (raw)
In-Reply-To: <20190805050959.19935-1-daniel@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 7362 bytes --]

On Mon, Aug 05, 2019 at 03:09:58PM +1000, Daniel Black wrote:
> Its not immediately obvious how cap-X=Y setting need to be applied
> to the command line so, for spapr capability hints, this has been clarified to:
> 
>   ..try appending -machine cap-X=Y
> 
> The wrong value messages have been left as is, as the user has found the right
> location.
> 
> Warning messages have been left as is for now.
> 
> Reviewed-by: Greg Kurz <groug@kaod.org>
> Signed-off-by: Daniel Black <daniel@linux.ibm.com>

So, I'm sorry to nitpick, but..
[snip]
> diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
> index bbb001f84a..b06faee7f6 100644
> --- a/hw/ppc/spapr_caps.c
> +++ b/hw/ppc/spapr_caps.c
> @@ -37,6 +37,8 @@
>  
>  #include "hw/ppc/spapr.h"
>  
> +#define CAPABILITY_HINT(X) " try appending -machine " X

.. I'd prefer to see the new messages just written inline rather than
this macro.  I think the increased duplication is less important than
the reduced greppability that the macro introduces.

> +
>  typedef struct SpaprCapPossible {
>      int num;            /* size of vals array below */
>      const char *help;   /* help text for vals */
> @@ -194,10 +196,12 @@ static void cap_htm_apply(SpaprMachineState *spapr, uint8_t val, Error **errp)
>      }
>      if (tcg_enabled()) {
>          error_setg(errp,
> -                   "No Transactional Memory support in TCG, try cap-htm=off");
> +                   "No Transactional Memory support in TCG,"
> +                   CAPABILITY_HINT("cap-htm=off"));
>      } else if (kvm_enabled() && !kvmppc_has_cap_htm()) {
>          error_setg(errp,
> -"KVM implementation does not support Transactional Memory, try cap-htm=off"
> +"KVM implementation does not support Transactional Memory,"
> +                   CAPABILITY_HINT("cap-htm=off")
>              );
>      }
>  }
> @@ -215,7 +219,8 @@ static void cap_vsx_apply(SpaprMachineState *spapr, uint8_t val, Error **errp)
>       * rid of anything that doesn't do VMX */
>      g_assert(env->insns_flags & PPC_ALTIVEC);
>      if (!(env->insns_flags2 & PPC2_VSX)) {
> -        error_setg(errp, "VSX support not available, try cap-vsx=off");
> +        error_setg(errp, "VSX support not available,"
> +                   CAPABILITY_HINT("cap-vsx=off"));
>      }
>  }
>  
> @@ -229,7 +234,8 @@ static void cap_dfp_apply(SpaprMachineState *spapr, uint8_t val, Error **errp)
>          return;
>      }
>      if (!(env->insns_flags2 & PPC2_DFP)) {
> -        error_setg(errp, "DFP support not available, try cap-dfp=off");
> +        error_setg(errp, "DFP support not available,"
> +                   CAPABILITY_HINT("cap-dfp=off"));
>      }
>  }
>  
> @@ -253,7 +259,8 @@ static void cap_safe_cache_apply(SpaprMachineState *spapr, uint8_t val,
>                     cap_cfpc_possible.vals[val]);
>      } else if (kvm_enabled() && (val > kvm_val)) {
>          error_setg(errp,
> -"Requested safe cache capability level not supported by kvm, try cap-cfpc=%s",
> +                   "Requested safe cache capability level not supported by kvm,"
> +                   CAPABILITY_HINT("cap-cfpc=%s"),
>                     cap_cfpc_possible.vals[kvm_val]);
>      }
>  
> @@ -281,7 +288,8 @@ static void cap_safe_bounds_check_apply(SpaprMachineState *spapr, uint8_t val,
>                     cap_sbbc_possible.vals[val]);
>      } else if (kvm_enabled() && (val > kvm_val)) {
>          error_setg(errp,
> -"Requested safe bounds check capability level not supported by kvm, try cap-sbbc=%s",
> +"Requested safe bounds check capability level not supported by kvm,"
> +                   CAPABILITY_HINT("cap-sbbc=%s"),
>                     cap_sbbc_possible.vals[kvm_val]);
>      }
>  
> @@ -312,7 +320,8 @@ static void cap_safe_indirect_branch_apply(SpaprMachineState *spapr,
>                     cap_ibs_possible.vals[val]);
>      } else if (kvm_enabled() && (val > kvm_val)) {
>          error_setg(errp,
> -"Requested safe indirect branch capability level not supported by kvm, try cap-ibs=%s",
> +"Requested safe indirect branch capability level not supported by kvm,"
> +                   CAPABILITY_HINT("cap-ibs=%s"),
>                     cap_ibs_possible.vals[kvm_val]);
>      }
>  
> @@ -401,11 +410,13 @@ static void cap_nested_kvm_hv_apply(SpaprMachineState *spapr,
>  
>      if (tcg_enabled()) {
>          error_setg(errp,
> -                   "No Nested KVM-HV support in tcg, try cap-nested-hv=off");
> +                   "No Nested KVM-HV support in tcg,"
> +                   CAPABILITY_HINT("cap-nested-hv=off"));
>      } else if (kvm_enabled()) {
>          if (!kvmppc_has_cap_nested_kvm_hv()) {
>              error_setg(errp,
> -"KVM implementation does not support Nested KVM-HV, try cap-nested-hv=off");
> +"KVM implementation does not support Nested KVM-HV,"
> +                       CAPABILITY_HINT("cap-nested-hv=off"));
>          } else if (kvmppc_set_cap_nested_kvm_hv(val) < 0) {
>                  error_setg(errp,
>  "Error enabling cap-nested-hv with KVM, try cap-nested-hv=off");
> @@ -435,10 +446,12 @@ static void cap_large_decr_apply(SpaprMachineState *spapr,
>  
>          if (!kvm_nr_bits) {
>              error_setg(errp,
> -                       "No large decrementer support, try cap-large-decr=off");
> +                       "No large decrementer support,"
> +                        CAPABILITY_HINT("cap-large-decr=off"));
>          } else if (pcc->lrg_decr_bits != kvm_nr_bits) {
>              error_setg(errp,
> -"KVM large decrementer size (%d) differs to model (%d), try -cap-large-decr=off",
> +"KVM large decrementer size (%d) differs to model (%d),"
> +                CAPABILITY_HINT("cap-large-decr=off"),
>                  kvm_nr_bits, pcc->lrg_decr_bits);
>          }
>      }
> @@ -454,7 +467,8 @@ static void cap_large_decr_cpu_apply(SpaprMachineState *spapr,
>      if (kvm_enabled()) {
>          if (kvmppc_enable_cap_large_decr(cpu, val)) {
>              error_setg(errp,
> -                       "No large decrementer support, try cap-large-decr=off");
> +                       "No large decrementer support,"
> +                       CAPABILITY_HINT("cap-large-decr=off"));
>          }
>      }
>  
> @@ -474,10 +488,12 @@ static void cap_ccf_assist_apply(SpaprMachineState *spapr, uint8_t val,
>      if (tcg_enabled() && val) {
>          /* TODO - for now only allow broken for TCG */
>          error_setg(errp,
> -"Requested count cache flush assist capability level not supported by tcg, try cap-ccf-assist=off");
> +"Requested count cache flush assist capability level not supported by tcg,"
> +                   CAPABILITY_HINT("cap-ccf-assist=off"));
>      } else if (kvm_enabled() && (val > kvm_val)) {
>          error_setg(errp,
> -"Requested count cache flush assist capability level not supported by kvm, try cap-ccf-assist=off");
> +"Requested count cache flush assist capability level not supported by kvm,"
> +                   CAPABILITY_HINT("cap-ccf-assist=off"));
>      }
>  }
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2019-08-09  5:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05  5:09 [Qemu-devel] [PATCH v3] spapr: quantify error messages regarding capability settings Daniel Black
2019-08-09  4:58 ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190809045825.GQ5465@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=daniel@linux.ibm.com \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).