[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/5] KVM: s390: adapter interrupt sources
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/5] KVM: s390: adapter interrupt sources |
Date: |
Fri, 21 Mar 2014 11:07:13 +0100 |
On Fri, 21 Mar 2014 10:26:35 +0100
Christian Borntraeger <address@hidden> wrote:
> On 17/03/14 19:11, Cornelia Huck wrote:
> > Add a new interface to register/deregister sources of adapter interrupts
> > identified by an unique id via the flic. Adapters may also be maskable
> > and carry a list of pinned pages.
> >
> > These adapters will be used by irq routing later.
> >
> > Signed-off-by: Cornelia Huck <address@hidden>
>
> [...]
>
> > +static int kvm_s390_adapter_map(struct kvm *kvm, unsigned int id, __u64
> > addr)
> > +{
> > + struct s390_io_adapter *adapter = get_io_adapter(kvm, id);
> > + struct s390_map_info *map;
> > + int ret;
> > +
> > + if (!adapter || !addr)
> > + return -EINVAL;
> > +
> > + map = kzalloc(sizeof(*map), GFP_KERNEL);
> > + if (!map) {
> > + ret = -ENOMEM;
> > + goto out;
> > + }
> > + INIT_LIST_HEAD(&map->list);
> > + map->addr = addr;
> > + ret = get_user_pages_fast(addr, 1, 1, &map->page);
> > + if (ret < 0)
> > + goto out;
> > + BUG_ON(ret != 1);
> > + down_write(&adapter->maps_lock);
> > + list_add_tail(&map->list, &adapter->maps);
> > + up_write(&adapter->maps_lock);
> > + ret = 0;
>
> Can you limit the amount of pinned pages to something sane, e.g. 1MB?
> As far as I can see, QEMU will fall back to non-irqfd if the mapping fails.
I'll introduce a counter for that.
>
> Otherwise looks good.
>
> Acked-by: Christian Borntraeger <address@hidden>
>
- [Qemu-devel] [PATCH v2 0/5] KVM: irqfds for s390, Cornelia Huck, 2014/03/17
- [Qemu-devel] [PATCH v2 1/5] KVM: eventfd: Fix lock order inversion., Cornelia Huck, 2014/03/17
- [Qemu-devel] [PATCH v2 3/5] KVM: s390: adapter interrupt sources, Cornelia Huck, 2014/03/17
- [Qemu-devel] [PATCH v2 2/5] KVM: Add per-vm capability enablement., Cornelia Huck, 2014/03/17
- [Qemu-devel] [PATCH v2 5/5] KVM: Bump KVM_MAX_IRQ_ROUTES for s390, Cornelia Huck, 2014/03/17
- [Qemu-devel] [PATCH v2 4/5] KVM: s390: irq routing for adapter interrupts., Cornelia Huck, 2014/03/17