All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Christoffer Dall <cdall@kernel.org>,
	bthakur@codeaurora.org, Christoffer Dall <cdall@cs.columbia.edu>,
	qemu-devel@nongnu.org,
	Christoffer Dall <christofferdall@christofferdall.dk>,
	qemu-arm@nongnu.org, kvmarm@lists.cs.columbia.edu
Subject: Re: [Qemu-devel] VCPU hotplug on KVM/ARM
Date: Thu, 1 Mar 2018 10:50:30 +0100	[thread overview]
Message-ID: <20180301105030.2b716e68@redhat.com> (raw)
In-Reply-To: <20180227132131.fipafmnb56a7fj76@kamzik.brq.redhat.com>

On Tue, 27 Feb 2018 14:21:31 +0100
Andrew Jones <drjones@redhat.com> wrote:

> On Tue, Feb 27, 2018 at 01:46:04PM +0100, Christoffer Dall wrote:
> > On Tue, Feb 27, 2018 at 05:34:28PM +0530, bthakur@codeaurora.org wrote:  
> > > Hi Christoffer,
> > > 
> > > Thanks for your reply.
> > > 
> > > On 2018-02-27 16:17, Christoffer Dall wrote:  
> > > >Hi Bhupinder,
> > > >
> > > >On Tue, Feb 27, 2018 at 03:01:17PM +0530, bthakur@codeaurora.org wrote:  
> > > >>I hope it is the right forum to post my query.
> > > >>
> > > >>
> > > >>
> > > >>I am currently looking at the possibility of adding a new VCPU to a
> > > >>running
> > > >>guest VM in KVM/ARM. I see that currently, it is not allowed to add a
> > > >>new
> > > >>VCPU to a guest VM, if it is already initialized. The first check in
> > > >>kvm_arch_vcpu_create() returns failure if it is already initialized.
> > > >>  
> > > >
> > > >This would require a major rework of a lot of logic surrounding the GIC
> > > >and other parts of KVM initialization.
> > > >  
> > > >>
> > > >>
> > > >>There was some work done in QEMU to add support for VCPU hotplug:
> > > >>https://lists.gnu.org/archive/html/qemu-arm/2017-05/msg00404.html
> > > >>
> > > >>
> > > >>
> > > >>But I am looking at the KVM side for enabling adding a new VCPU. If you
> > > >>can
> > > >>point me to any relevant work/resources, which I can refer to then it
> > > >>will
> > > >>help me.
> > > >>  
> > > >
> > > >I don't have any specific pointers, but I was always told that the way
> > > >we were going to do CPU hotplug would be to instantiate a large number
> > > >of VCPUs, and hotplug would be equivalent to turning on a VCPU which was
> > > >previously powered off.
> > > >
> > > >Is this not still a feasible solution?  
> > > It should be a feasible solution provided the guest VM is not able to
> > > control the onlining/offlining of VCPUs. It should be controlled by the
> > > Host.
> > >   
> > 
> > KVM could simply refuse to turn on some of the CPUs unless given
> > permission from host userspace.
> >   
> > > >
> > > >How does VCPU hotplug work on x86?  
> > > On x86, you can add a vcpu through libvirt setvcpu command and it shows up
> > > in the guest VM as a new CPU if you do lscpu.
> > >   
> > 
> > Sure, but what is the mechanism, does x86 qemu actually call
> > KVM_CREATE_VCPU, or is this also a question of turning on already
> > created vcpus ?
In QEMU on x86 (and I think ppc, s390 as well), we create vCPUs on demand.

It would be nice if ARM would be able to do that too,
so that it could take advantage of the same code.

 
> CC'ing Igor and qemu-devel
> 
> drew
> 

WARNING: multiple messages have this Message-ID (diff)
From: Igor Mammedov <imammedo@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Christoffer Dall <cdall@cs.columbia.edu>,
	qemu-devel@nongnu.org,
	Christoffer Dall <christofferdall@christofferdall.dk>,
	qemu-arm@nongnu.org, kvmarm@lists.cs.columbia.edu
Subject: Re: [Qemu-devel] VCPU hotplug on KVM/ARM
Date: Thu, 1 Mar 2018 10:50:30 +0100	[thread overview]
Message-ID: <20180301105030.2b716e68@redhat.com> (raw)
In-Reply-To: <20180227132131.fipafmnb56a7fj76@kamzik.brq.redhat.com>

On Tue, 27 Feb 2018 14:21:31 +0100
Andrew Jones <drjones@redhat.com> wrote:

> On Tue, Feb 27, 2018 at 01:46:04PM +0100, Christoffer Dall wrote:
> > On Tue, Feb 27, 2018 at 05:34:28PM +0530, bthakur@codeaurora.org wrote:  
> > > Hi Christoffer,
> > > 
> > > Thanks for your reply.
> > > 
> > > On 2018-02-27 16:17, Christoffer Dall wrote:  
> > > >Hi Bhupinder,
> > > >
> > > >On Tue, Feb 27, 2018 at 03:01:17PM +0530, bthakur@codeaurora.org wrote:  
> > > >>I hope it is the right forum to post my query.
> > > >>
> > > >>
> > > >>
> > > >>I am currently looking at the possibility of adding a new VCPU to a
> > > >>running
> > > >>guest VM in KVM/ARM. I see that currently, it is not allowed to add a
> > > >>new
> > > >>VCPU to a guest VM, if it is already initialized. The first check in
> > > >>kvm_arch_vcpu_create() returns failure if it is already initialized.
> > > >>  
> > > >
> > > >This would require a major rework of a lot of logic surrounding the GIC
> > > >and other parts of KVM initialization.
> > > >  
> > > >>
> > > >>
> > > >>There was some work done in QEMU to add support for VCPU hotplug:
> > > >>https://lists.gnu.org/archive/html/qemu-arm/2017-05/msg00404.html
> > > >>
> > > >>
> > > >>
> > > >>But I am looking at the KVM side for enabling adding a new VCPU. If you
> > > >>can
> > > >>point me to any relevant work/resources, which I can refer to then it
> > > >>will
> > > >>help me.
> > > >>  
> > > >
> > > >I don't have any specific pointers, but I was always told that the way
> > > >we were going to do CPU hotplug would be to instantiate a large number
> > > >of VCPUs, and hotplug would be equivalent to turning on a VCPU which was
> > > >previously powered off.
> > > >
> > > >Is this not still a feasible solution?  
> > > It should be a feasible solution provided the guest VM is not able to
> > > control the onlining/offlining of VCPUs. It should be controlled by the
> > > Host.
> > >   
> > 
> > KVM could simply refuse to turn on some of the CPUs unless given
> > permission from host userspace.
> >   
> > > >
> > > >How does VCPU hotplug work on x86?  
> > > On x86, you can add a vcpu through libvirt setvcpu command and it shows up
> > > in the guest VM as a new CPU if you do lscpu.
> > >   
> > 
> > Sure, but what is the mechanism, does x86 qemu actually call
> > KVM_CREATE_VCPU, or is this also a question of turning on already
> > created vcpus ?
In QEMU on x86 (and I think ppc, s390 as well), we create vCPUs on demand.

It would be nice if ARM would be able to do that too,
so that it could take advantage of the same code.

 
> CC'ing Igor and qemu-devel
> 
> drew
> 

  reply	other threads:[~2018-03-01  9:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  9:31 VCPU hotplug on KVM/ARM bthakur
2018-02-27 10:47 ` Christoffer Dall
2018-02-27 12:04   ` bthakur
2018-02-27 12:46     ` Christoffer Dall
2018-02-27 13:21       ` [Qemu-devel] " Andrew Jones
2018-02-27 13:21         ` Andrew Jones
2018-03-01  9:50         ` Igor Mammedov [this message]
2018-03-01  9:50           ` [Qemu-devel] " Igor Mammedov
2018-03-01 10:05           ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-03-01 10:05             ` [Qemu-arm] [Qemu-devel] " Peter Maydell
2018-03-01 13:32             ` [Qemu-devel] [Qemu-arm] " David Hildenbrand
2018-03-01 13:32               ` David Hildenbrand
2018-03-07 12:47               ` Marc Zyngier
2018-03-07 12:47                 ` Marc Zyngier
2018-07-24 18:35         ` [Qemu-devel] " Maran Wilson
2018-07-24 18:35           ` Maran Wilson
2018-07-25  6:45           ` [Qemu-devel] " Igor Mammedov
2018-07-25  6:45             ` Igor Mammedov
2018-07-25 10:40           ` Marc Zyngier
2018-07-25 10:40             ` Marc Zyngier
2018-07-25 12:28             ` [Qemu-devel] " Andrew Jones
2018-07-25 12:28               ` Andrew Jones
2018-07-25 13:07               ` Marc Zyngier
2018-07-25 13:07                 ` Marc Zyngier
2018-07-25 17:26                 ` Maran Wilson
2018-07-25 17:26                   ` Maran Wilson
2018-07-31 10:27                 ` Igor Mammedov
2018-07-31 10:27                   ` Igor Mammedov
2018-07-31 10:57                   ` David Hildenbrand
2018-07-31 10:57                     ` David Hildenbrand
2018-08-01  8:09                   ` Bharata B Rao
2018-08-01  8:09                     ` Bharata B Rao

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=20180301105030.2b716e68@redhat.com \
    --to=imammedo@redhat.com \
    --cc=bthakur@codeaurora.org \
    --cc=cdall@cs.columbia.edu \
    --cc=cdall@kernel.org \
    --cc=christofferdall@christofferdall.dk \
    --cc=drjones@redhat.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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 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.