From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Difference between vcpu_load and kvm_sched_in ? Date: Wed, 21 Oct 2015 12:25:43 +0200 Message-ID: <56276827.2040900@redhat.com> References: <56266175.4030409@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Wanpeng Li To: Hebbal Yacine Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43034 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753708AbbJUKZr (ORCPT ); Wed, 21 Oct 2015 06:25:47 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 21/10/2015 12:17, Hebbal Yacine wrote: > Thanks for the explanation, it's very clear. > I tired that but I didn't succeed to send the ioctl from "run_on_cpu" > function, I didn't find how to set the right CPUStat > I've tried "current_cpu" Current_cpu is always NULL outside the VCPU thread. > > kvm_main.c: > > // yacine.begin > > static void do_vmi_start_kvm_ioctl(void *type) { > printf("do_vmi_start_kvm_ioctl\n"); > kvm_vm_ioctl(kvm_state, type); Are you sure you want a VM ioctl and not a VCPU ioctl? Or perhaps a VM ioctl to do generic processing, and a VCPU ioctl that is then sent to all VCPUs? If you use a VCPU ioctl, you can use CPU_FOREACH or a for loop to iterate over all VCPUs. Paolo