From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v3] KVM: Resize kvm_io_range array dynamically Date: Wed, 29 Feb 2012 16:29:33 +0100 Message-ID: <4F4E445D.8090104@siemens.com> References: <01ed65cf-7783-4888-93b7-3d5e2cceadc6@zmail13.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , "jasowang@redhat.com" , "mtosatti@redhat.com" , alex williamson , "avi@redhat.com" , "levinsasha928@gmail.com" To: Amos Kong Return-path: Received: from thoth.sbs.de ([192.35.17.2]:23962 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031111Ab2B2P3j (ORCPT ); Wed, 29 Feb 2012 10:29:39 -0500 In-Reply-To: <01ed65cf-7783-4888-93b7-3d5e2cceadc6@zmail13.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2012-02-29 16:22, Amos Kong wrote: > ----- Original Message ----- >> On 2012-02-29 14:30, Amos Kong wrote: >>> kvm_io_bus devices are used for ioevent, pit, pic, ioapic, >>> coalesced_mmio. >>> >>> Currently Qemu only emulates one PCI bus, it contains 32 slots, >>> one slot contains 8 functions, maximum of supported PCI devices: >>> 1 * 32 * 8 = 256. The maximum of coalesced mmio zone is 100, >>> each zone has an iobus devices. 300 io_bus devices is not enough. >>> >>> This patch makes the kvm_io_range array can be resized dynamically. >> >> Is there any limit, or can userspace allocate arbitrary amounts of >> kernel memory this way? > > Hi Jan, > > There is a fixed array in linux-2.6/include/linux/kvm_host.h, > we can only register 300 devices. > > struct kvm_io_range { > gpa_t addr; > int len; > struct kvm_io_device *dev; > }; > > struct kvm_io_bus { > int dev_count; > #define NR_IOBUS_DEVS 300 > struct kvm_io_range range[NR_IOBUS_DEVS]; > }; > ^^^^^^^^^^^^^^ Right. But doesn't your patch remove precisely this limit? So what limits userspace now? To register 300 million devices...? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux