All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
@ 2016-05-26 14:31 Cole Robinson
  2016-05-26 14:46 ` Richard W.M. Jones
  2016-06-03 18:34 ` Peter Maydell
  0 siblings, 2 replies; 9+ messages in thread
From: Cole Robinson @ 2016-05-26 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, qemu-arm, Cole Robinson

If you try to gic-version=host with TCG on a KVM aarch64 host,
qemu segfaults, since host requires KVM APIs.

Explicitly reject gic-version=host if KVM is not enabled

https://bugzilla.redhat.com/show_bug.cgi?id=1339977
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 hw/arm/virt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e77ed88..1e82597 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1122,10 +1122,14 @@ static void machvirt_init(MachineState *machine)
      * KVM is not available yet
      */
     if (!gic_version) {
+        if (!kvm_enabled()) {
+            error_report("gic-version=host requires KVM");
+            exit(1);
+        }
+
         gic_version = kvm_arm_vgic_probe();
         if (!gic_version) {
             error_report("Unable to determine GIC version supported by host");
-            error_printf("KVM acceleration is probably not supported\n");
             exit(1);
         }
     }
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-05-26 14:31 [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM Cole Robinson
@ 2016-05-26 14:46 ` Richard W.M. Jones
  2016-05-26 14:53   ` Peter Maydell
  2016-06-03 18:34 ` Peter Maydell
  1 sibling, 1 reply; 9+ messages in thread
From: Richard W.M. Jones @ 2016-05-26 14:46 UTC (permalink / raw)
  To: Cole Robinson; +Cc: qemu-devel, peter.maydell, qemu-arm

On Thu, May 26, 2016 at 10:31:25AM -0400, Cole Robinson wrote:
> If you try to gic-version=host with TCG on a KVM aarch64 host,
> qemu segfaults, since host requires KVM APIs.
> 
> Explicitly reject gic-version=host if KVM is not enabled
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1339977
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  hw/arm/virt.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index e77ed88..1e82597 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1122,10 +1122,14 @@ static void machvirt_init(MachineState *machine)
>       * KVM is not available yet
>       */
>      if (!gic_version) {
> +        if (!kvm_enabled()) {
> +            error_report("gic-version=host requires KVM");
> +            exit(1);
> +        }

The problem with this is if I'm using TCG fallback mode, how
can I specify the right gic-version?  ie:

  -M virt,gic-version=host,accel=kvm:tcg

Only qemu knows if KVM is going to be enabled.

The same problem happens with '-cpu host' BTW.  I really want a "make
it work" option, as I've said on several previous occasions on this
list eg:
https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04173.html

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-05-26 14:46 ` Richard W.M. Jones
@ 2016-05-26 14:53   ` Peter Maydell
  2016-05-26 15:14     ` Richard W.M. Jones
  2016-06-17 14:49     ` Peter Maydell
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Maydell @ 2016-05-26 14:53 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: Cole Robinson, QEMU Developers, qemu-arm

On 26 May 2016 at 15:46, Richard W.M. Jones <rjones@redhat.com> wrote:
> The problem with this is if I'm using TCG fallback mode, how
> can I specify the right gic-version?  ie:
>
>   -M virt,gic-version=host,accel=kvm:tcg
>
> Only qemu knows if KVM is going to be enabled.
>
> The same problem happens with '-cpu host' BTW.  I really want a "make
> it work" option, as I've said on several previous occasions on this
> list eg:
> https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04173.html

I agree that we really need to do better here (thinking about
the problem is on my todo list but generally other more pressing
issues intervene). I'd welcome suggestions for semantics which
(a) do what you want (b) are reasonably in line with what we do
on other host architectures (c) don't break existing command lines.
(I think those are the main requirements.)

In the meantime I think this patch is correct for what we
are currently trying to implement.

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-05-26 14:53   ` Peter Maydell
@ 2016-05-26 15:14     ` Richard W.M. Jones
  2016-06-17 14:49     ` Peter Maydell
  1 sibling, 0 replies; 9+ messages in thread
From: Richard W.M. Jones @ 2016-05-26 15:14 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Cole Robinson, QEMU Developers, qemu-arm

On Thu, May 26, 2016 at 03:53:54PM +0100, Peter Maydell wrote:
> On 26 May 2016 at 15:46, Richard W.M. Jones <rjones@redhat.com> wrote:
> > The problem with this is if I'm using TCG fallback mode, how
> > can I specify the right gic-version?  ie:
> >
> >   -M virt,gic-version=host,accel=kvm:tcg
> >
> > Only qemu knows if KVM is going to be enabled.
> >
> > The same problem happens with '-cpu host' BTW.  I really want a "make
> > it work" option, as I've said on several previous occasions on this
> > list eg:
> > https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04173.html
> 
> I agree that we really need to do better here (thinking about
> the problem is on my todo list but generally other more pressing
> issues intervene). I'd welcome suggestions for semantics which
> (a) do what you want (b) are reasonably in line with what we do
> on other host architectures (c) don't break existing command lines.
> (I think those are the main requirements.)
> 
> In the meantime I think this patch is correct for what we
> are currently trying to implement.

Agreed this patch is an improvement on segfaulting which is
what qemu does at the moment :-(

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-05-26 14:31 [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM Cole Robinson
  2016-05-26 14:46 ` Richard W.M. Jones
@ 2016-06-03 18:34 ` Peter Maydell
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2016-06-03 18:34 UTC (permalink / raw)
  To: Cole Robinson; +Cc: QEMU Developers, qemu-arm

On 26 May 2016 at 15:31, Cole Robinson <crobinso@redhat.com> wrote:
> If you try to gic-version=host with TCG on a KVM aarch64 host,
> qemu segfaults, since host requires KVM APIs.
>
> Explicitly reject gic-version=host if KVM is not enabled
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1339977
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  hw/arm/virt.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>



Applied to target-arm.next, thanks.

-- PMM

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-05-26 14:53   ` Peter Maydell
  2016-05-26 15:14     ` Richard W.M. Jones
@ 2016-06-17 14:49     ` Peter Maydell
  2016-06-17 16:10       ` Richard W.M. Jones
  1 sibling, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2016-06-17 14:49 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: Cole Robinson, QEMU Developers, qemu-arm

On 26 May 2016 at 15:53, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 26 May 2016 at 15:46, Richard W.M. Jones <rjones@redhat.com> wrote:
>> The problem with this is if I'm using TCG fallback mode, how
>> can I specify the right gic-version?  ie:
>>
>>   -M virt,gic-version=host,accel=kvm:tcg
>>
>> Only qemu knows if KVM is going to be enabled.
>>
>> The same problem happens with '-cpu host' BTW.  I really want a "make
>> it work" option, as I've said on several previous occasions on this
>> list eg:
>> https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04173.html
>
> I agree that we really need to do better here (thinking about
> the problem is on my todo list but generally other more pressing
> issues intervene). I'd welcome suggestions for semantics which
> (a) do what you want (b) are reasonably in line with what we do
> on other host architectures (c) don't break existing command lines.
> (I think those are the main requirements.)

...so does anybody have any concrete suggestions? We could fix
this for 2.7 but we're starting to run low on time for that.

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-06-17 14:49     ` Peter Maydell
@ 2016-06-17 16:10       ` Richard W.M. Jones
  2016-06-17 16:31         ` Peter Maydell
  0 siblings, 1 reply; 9+ messages in thread
From: Richard W.M. Jones @ 2016-06-17 16:10 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Cole Robinson, QEMU Developers, qemu-arm

On Fri, Jun 17, 2016 at 03:49:38PM +0100, Peter Maydell wrote:
> On 26 May 2016 at 15:53, Peter Maydell <peter.maydell@linaro.org> wrote:
> > On 26 May 2016 at 15:46, Richard W.M. Jones <rjones@redhat.com> wrote:
> >> The problem with this is if I'm using TCG fallback mode, how
> >> can I specify the right gic-version?  ie:
> >>
> >>   -M virt,gic-version=host,accel=kvm:tcg
> >>
> >> Only qemu knows if KVM is going to be enabled.
> >>
> >> The same problem happens with '-cpu host' BTW.  I really want a "make
> >> it work" option, as I've said on several previous occasions on this
> >> list eg:
> >> https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg04173.html
> >
> > I agree that we really need to do better here (thinking about
> > the problem is on my todo list but generally other more pressing
> > issues intervene). I'd welcome suggestions for semantics which
> > (a) do what you want (b) are reasonably in line with what we do
> > on other host architectures (c) don't break existing command lines.
> > (I think those are the main requirements.)
> 
> ...so does anybody have any concrete suggestions? We could fix
> this for 2.7 but we're starting to run low on time for that.

I have changed libguestfs so it tries to guess if KVM will be used or
not.  We have to do this for the -cpu option too, but the guess is not
too reliable.  Only QEMU has the actual knowledge we need.

https://github.com/libguestfs/libguestfs/commit/7023f20830a681ef36f8f99415fe41791555a3db

Can we not have a "give me a GIC which will work" option, eg.

  -M virt,gic-version=besteffort,accel=kvm:tcg

I don't care if it's not the fastest or most featureful.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-06-17 16:10       ` Richard W.M. Jones
@ 2016-06-17 16:31         ` Peter Maydell
  2016-06-17 16:33           ` Richard W.M. Jones
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2016-06-17 16:31 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: Cole Robinson, QEMU Developers, qemu-arm

On 17 June 2016 at 17:10, Richard W.M. Jones <rjones@redhat.com> wrote:
> On Fri, Jun 17, 2016 at 03:49:38PM +0100, Peter Maydell wrote:
>> > I agree that we really need to do better here (thinking about
>> > the problem is on my todo list but generally other more pressing
>> > issues intervene). I'd welcome suggestions for semantics which
>> > (a) do what you want (b) are reasonably in line with what we do
>> > on other host architectures (c) don't break existing command lines.
>> > (I think those are the main requirements.)
>>
>> ...so does anybody have any concrete suggestions? We could fix
>> this for 2.7 but we're starting to run low on time for that.
>
> I have changed libguestfs so it tries to guess if KVM will be used or
> not.  We have to do this for the -cpu option too, but the guess is not
> too reliable.  Only QEMU has the actual knowledge we need.
>
> https://github.com/libguestfs/libguestfs/commit/7023f20830a681ef36f8f99415fe41791555a3db
>
> Can we not have a "give me a GIC which will work" option, eg.
>
>   -M virt,gic-version=besteffort,accel=kvm:tcg
>
> I don't care if it's not the fastest or most featureful.

Do we also not care if the result is not consistent
between versions of QEMU? (eg if you go from 2.6 to
2.7 does it have to stay doing the same thing it
always did?)

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM
  2016-06-17 16:31         ` Peter Maydell
@ 2016-06-17 16:33           ` Richard W.M. Jones
  0 siblings, 0 replies; 9+ messages in thread
From: Richard W.M. Jones @ 2016-06-17 16:33 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Cole Robinson, QEMU Developers, qemu-arm

On Fri, Jun 17, 2016 at 05:31:20PM +0100, Peter Maydell wrote:
> On 17 June 2016 at 17:10, Richard W.M. Jones <rjones@redhat.com> wrote:
> > On Fri, Jun 17, 2016 at 03:49:38PM +0100, Peter Maydell wrote:
> >> > I agree that we really need to do better here (thinking about
> >> > the problem is on my todo list but generally other more pressing
> >> > issues intervene). I'd welcome suggestions for semantics which
> >> > (a) do what you want (b) are reasonably in line with what we do
> >> > on other host architectures (c) don't break existing command lines.
> >> > (I think those are the main requirements.)
> >>
> >> ...so does anybody have any concrete suggestions? We could fix
> >> this for 2.7 but we're starting to run low on time for that.
> >
> > I have changed libguestfs so it tries to guess if KVM will be used or
> > not.  We have to do this for the -cpu option too, but the guess is not
> > too reliable.  Only QEMU has the actual knowledge we need.
> >
> > https://github.com/libguestfs/libguestfs/commit/7023f20830a681ef36f8f99415fe41791555a3db
> >
> > Can we not have a "give me a GIC which will work" option, eg.
> >
> >   -M virt,gic-version=besteffort,accel=kvm:tcg
> >
> > I don't care if it's not the fastest or most featureful.
> 
> Do we also not care if the result is not consistent
> between versions of QEMU? (eg if you go from 2.6 to
> 2.7 does it have to stay doing the same thing it
> always did?)

For libguestfs, no, since we don't do any migration or saving the
state of the VM.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

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

end of thread, other threads:[~2016-06-17 16:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 14:31 [Qemu-devel] [PATCH] hw/arm/virt: Reject gic-version=host for non-KVM Cole Robinson
2016-05-26 14:46 ` Richard W.M. Jones
2016-05-26 14:53   ` Peter Maydell
2016-05-26 15:14     ` Richard W.M. Jones
2016-06-17 14:49     ` Peter Maydell
2016-06-17 16:10       ` Richard W.M. Jones
2016-06-17 16:31         ` Peter Maydell
2016-06-17 16:33           ` Richard W.M. Jones
2016-06-03 18:34 ` Peter Maydell

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.