qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc: add helpful message when KVM fails to start VCPU
@ 2015-05-18 19:06 Laurent Vivier
  2015-05-19  8:07 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2015-05-18 19:06 UTC (permalink / raw)
  To: qemu-ppc; +Cc: Laurent Vivier, Paolo Bonzini, dgibson, qemu-devel,
	Alexander Graf

On POWER8 systems, KVM checks if VCPU is running on primary threads,
and that secondary threads are offline. If this is not the case,
ioctl() fails with errno set to EBUSY.

QEMU aborts with a non explicit error message:
$ ./qemu-system-ppc64 --nographic -machine pseries,accel=kvm
error: kvm run failed Device or resource busy

To help user to diagnose the problem, this patch adds an informative
error message.

There is no easy way to check if SMT is enabled before starting the VCPU,
and as this case is the only one setting errno to EBUSY, we just check
the errno value to display a message.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 kvm-all.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kvm-all.c b/kvm-all.c
index 17a3771..7b57826 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1828,6 +1828,14 @@ int kvm_cpu_exec(CPUState *cpu)
             }
             fprintf(stderr, "error: kvm run failed %s\n",
                     strerror(-run_ret));
+#ifdef TARGET_PPC
+            if (run_ret == -EBUSY) {
+                fprintf(stderr,
+                        "This is probably because your SMT is enabled.\n"
+                        "VCPU can only run on primary threads with all "
+                        "secondary threads offline.\n");
+            }
+#endif
             ret = -1;
             break;
         }
-- 
2.1.0

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

* Re: [Qemu-devel] [PATCH] ppc: add helpful message when KVM fails to start VCPU
  2015-05-18 19:06 [Qemu-devel] [PATCH] ppc: add helpful message when KVM fails to start VCPU Laurent Vivier
@ 2015-05-19  8:07 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2015-05-19  8:07 UTC (permalink / raw)
  To: Laurent Vivier, qemu-ppc; +Cc: dgibson, qemu-devel, Alexander Graf

On 18/05/2015 21:06, Laurent Vivier wrote:
> On POWER8 systems, KVM checks if VCPU is running on primary threads,
> and that secondary threads are offline. If this is not the case,
> ioctl() fails with errno set to EBUSY.
> 
> QEMU aborts with a non explicit error message:
> $ ./qemu-system-ppc64 --nographic -machine pseries,accel=kvm
> error: kvm run failed Device or resource busy
> 
> To help user to diagnose the problem, this patch adds an informative
> error message.
> 
> There is no easy way to check if SMT is enabled before starting the VCPU,
> and as this case is the only one setting errno to EBUSY, we just check
> the errno value to display a message.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Thanks, applied to my queue for 2.4.

Paolo

> ---
>  kvm-all.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 17a3771..7b57826 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -1828,6 +1828,14 @@ int kvm_cpu_exec(CPUState *cpu)
>              }
>              fprintf(stderr, "error: kvm run failed %s\n",
>                      strerror(-run_ret));
> +#ifdef TARGET_PPC
> +            if (run_ret == -EBUSY) {
> +                fprintf(stderr,
> +                        "This is probably because your SMT is enabled.\n"
> +                        "VCPU can only run on primary threads with all "
> +                        "secondary threads offline.\n");
> +            }
> +#endif
>              ret = -1;
>              break;
>          }
> 

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

end of thread, other threads:[~2015-05-19  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 19:06 [Qemu-devel] [PATCH] ppc: add helpful message when KVM fails to start VCPU Laurent Vivier
2015-05-19  8:07 ` Paolo Bonzini

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).