Re: [PATCH v4] KVM: Resize kvm_io_range array dynamically

2012-03-07 Thread Avi Kivity
On 03/07/2012 02:51 PM, Amos Kong wrote: > > > + > > > + new_bus = kmemdup(bus, sizeof(*bus) + ((bus->dev_count - 1) * > > > + sizeof(struct kvm_io_range)), GFP_KERNEL); > > > + if (!new_bus) > > > + return -ENOMEM; > > > + > > > + new_bus->dev_count--; > > > + /* copy las

Re: [PATCH v4] KVM: Resize kvm_io_range array dynamically

2012-03-07 Thread Amos Kong
- Original Message - > On 03/01/2012 09:01 AM, 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: > >

Re: [PATCH v4] KVM: Resize kvm_io_range array dynamically

2012-03-07 Thread Avi Kivity
On 03/01/2012 09:01 AM, 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. One virtio-blk takes on

Re: [PATCH v4] KVM: Resize kvm_io_range array dynamically

2012-03-01 Thread Alex Williamson
On Thu, 2012-03-01 at 12:14 +0200, Sasha Levin wrote: > On Thu, Mar 1, 2012 at 9:01 AM, Amos Kong wrote: > > This patch makes the kvm_io_range array can be resized dynamically. > > Set an upper bounds for kvm_io_range to limit userspace. > > 1000 is a very large limit and not bloat the typical use

Re: [PATCH v4] KVM: Resize kvm_io_range array dynamically

2012-03-01 Thread Sasha Levin
On Thu, Mar 1, 2012 at 9:01 AM, Amos Kong wrote: > This patch makes the kvm_io_range array can be resized dynamically. > Set an upper bounds for kvm_io_range to limit userspace. > 1000 is a very large limit and not bloat the typical user. Whats the reason for making everything dynamic? Memory sav

[PATCH v4] KVM: Resize kvm_io_range array dynamically

2012-02-29 Thread Amos Kong
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. One virtio-blk takes one iobus device, one virtio-net(vhost=on) takes two i