Re: [PATCH v2 3/5] KVM: s390: adapter interrupt sources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <cornelia.huck@xxxxxxxxxx>

[...]

> +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.

Otherwise looks good.

Acked-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux