From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 3/5] KVM: add KVM_USER_EXIT vm ioctl for userspace exit Date: Wed, 5 Aug 2015 15:34:43 +0200 Message-ID: <20150805133442.GA31952@potion.brq.redhat.com> References: <1438780877-31838-1-git-send-email-rkrcmar@redhat.com> <1438780877-31838-4-git-send-email-rkrcmar@redhat.com> <55C20FD2.8020607@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <55C20FD2.8020607@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-08-05 15:29+0200, Paolo Bonzini: > On 05/08/2015 15:21, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >> + kvm_for_each_vcpu(idx, vcpu, kvm) >> + if (vcpu->vcpu_id =3D=3D vcpu_id) { >> + kvm_make_request(KVM_REQ_EXIT, vcpu); >> + kvm_vcpu_kick(vcpu); >> + >> + return 0; >> + } >> + >=20 > Why not a vcpu ioctl? kvm_for_each_vcpu can become pretty expensive = if > you have a few dozen VCPUs. Yeah, it will be slow, the only bright side is low frequency of calls. vcpu ioctl should only be issued by the vcpu thread so it would significantly limit use.