Re: [PATCH 3/9] change order of kvm_init call.

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

 



On Sun, Jul 26, 2009 at 08:59:44PM +0200, Jan Kiszka wrote:
> Glauber Costa wrote:
> > The goal is to get rid of the call to kvm_init. But those things
> > are subtle, and often break. So do it in a separate patch, to help
> > finding potential issues in future bisections.
> 
> Found such an issued: This patch triggers a segfault if no kvm modules
> are loaded and you start qemu without -no-kvm. Please have a look.
> 
> Jan

ok, the culprit seems to be a 

    if (kvm_enabled())
        return;

in the beginning of code_gen_alloc.

It is 7f3d0cbe, by Avi, and according to changelog, suggested by anthony.
I however, fail to realise the purpose of this optimization. For one thing,
it totally dictates that kvm has absolutely to be enabled or disabled prior
to this point. No mind changing later. Also, the real deal is to be able
to compile out tcg entirely. The strategy of just disabling the code gen
alloc is a minor nitpick that just papers over this.


So I'd say let's revert it. But I'm open to suggestions.

> 
> > 
> > Signed-off-by: Glauber Costa <glommer@xxxxxxxxxx>
> > ---
> >  vl.c |   18 +++++++++---------
> >  1 files changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/vl.c b/vl.c
> > index f4e4d0f..86a6d70 100644
> > --- a/vl.c
> > +++ b/vl.c
> > @@ -5748,15 +5748,6 @@ int main(int argc, char **argv, char **envp)
> >          signal(SIGTTIN, SIG_IGN);
> >      }
> >  
> > -#ifdef CONFIG_KVM
> > -    if (kvm_enabled()) {
> > -	if (kvm_init(smp_cpus) < 0) {
> > -	    fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
> > -	    exit(1);
> > -	}
> > -    }
> > -#endif
> > -
> >      if (pid_file && qemu_create_pidfile(pid_file) != 0) {
> >          if (daemonize) {
> >              uint8_t status = 1;
> > @@ -5956,6 +5947,15 @@ int main(int argc, char **argv, char **envp)
> >      }
> >  #endif
> >  
> > +#ifdef CONFIG_KVM
> > +    if (kvm_enabled()) {
> > +	if (kvm_init(smp_cpus) < 0) {
> > +	    fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
> > +	    exit(1);
> > +	}
> > +    }
> > +#endif
> > +
> >      if (monitor_device) {
> >          monitor_hd = qemu_chr_open("monitor", monitor_device, NULL);
> >          if (!monitor_hd) {
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux