From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zhang Subject: Re: A problem of IRQchip in QEMU and KVM for ARM Date: Tue, 23 May 2017 10:11:03 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" To: "qemu-devel@nongnu.org" , qemu-arm@nongnu.org, kvm@vger.kernel.org Return-path: Received: from mail-wm0-f52.google.com ([74.125.82.52]:36624 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933119AbdEWCLF (ORCPT ); Mon, 22 May 2017 22:11:05 -0400 Received: by mail-wm0-f52.google.com with SMTP id 7so10032346wmo.1 for ; Mon, 22 May 2017 19:11:04 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Any idea? Thanks. On Fri, May 19, 2017 at 1:46 PM, Li Zhang wrote: > > Hi, > > I am looking into QEMU code in ARM recently and trying to add add_hot_cpu in QEMU for ARM, > but it doesn't work when enabling KVM. It reports error: > > "kvm_init_vcpu failed: Device or resourc busy." > > By debugging QEMU with gdb, it failed on ioctl. In kernel soruce code arch/arm/kvm/arm.c, > vcpu is created by this following function, it will report -EBUSY if irqchip_in_kernel. > > struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id) > { > int err; > struct kvm_vcpu *vcpu; > > if (irqchip_in_kernel(kvm) && vgic_initialized(kvm)) { > err = -EBUSY; > goto out; > } > > .... > } > > I set virt machine with kernel_irqchip = off, it can execute cpu-add interface correctly with qmp-shell > commands. But VMs still can't work well with kernel_irqchip=off when executing "info cpus" in qemu monitor. > > My question is that: > 1) Can we change this error status in kvm_arch_vcpu_create? > 2) Is it that irqchip_kernel=off isn't supported with KVM enabled on ARM? > > -- > > Best Regards > -Li -- Best Regards -Li From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dCzHu-00005z-Hx for qemu-devel@nongnu.org; Mon, 22 May 2017 22:11:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dCzHt-0002Gh-L1 for qemu-devel@nongnu.org; Mon, 22 May 2017 22:11:06 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Li Zhang Date: Tue, 23 May 2017 10:11:03 +0800 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] A problem of IRQchip in QEMU and KVM for ARM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" , qemu-arm@nongnu.org, kvm@vger.kernel.org Any idea? Thanks. On Fri, May 19, 2017 at 1:46 PM, Li Zhang wrote: > > Hi, > > I am looking into QEMU code in ARM recently and trying to add add_hot_cpu in QEMU for ARM, > but it doesn't work when enabling KVM. It reports error: > > "kvm_init_vcpu failed: Device or resourc busy." > > By debugging QEMU with gdb, it failed on ioctl. In kernel soruce code arch/arm/kvm/arm.c, > vcpu is created by this following function, it will report -EBUSY if irqchip_in_kernel. > > struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id) > { > int err; > struct kvm_vcpu *vcpu; > > if (irqchip_in_kernel(kvm) && vgic_initialized(kvm)) { > err = -EBUSY; > goto out; > } > > .... > } > > I set virt machine with kernel_irqchip = off, it can execute cpu-add interface correctly with qmp-shell > commands. But VMs still can't work well with kernel_irqchip=off when executing "info cpus" in qemu monitor. > > My question is that: > 1) Can we change this error status in kvm_arch_vcpu_create? > 2) Is it that irqchip_kernel=off isn't supported with KVM enabled on ARM? > > -- > > Best Regards > -Li -- Best Regards -Li