Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab8cd818 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
  lguest: notify on empty
  virtio: force callback on empty.
  virtio_blk: fix endianess annotations
  virtio_config: fix len calculation of config elements
  virtio_net: another race with virtio_net and enable_cb
  virtio: An entropy device, as suggested by hpa.
  virtio_blk: allow read-only disks
  lguest: fix ugly <NULL> in /proc/interrupts
  virtio: set device index in common code.
  virtio: virtio_pci should not set bus_id.
  virtio: bus_id for devices should contain 'virtio'
  Fix crash in virtio_blk during modprobe ; rmmod ; modprobe
  lguest: use ioremap_cache, not ioremap
parents f8356ed0 20887611
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -157,6 +157,9 @@ struct virtqueue

	/* The routine to call when the Guest pings us. */
	void (*handle_output)(int fd, struct virtqueue *me);

	/* Outstanding buffers */
	unsigned int inflight;
};

/* Remember the arguments to the program so we can "reboot" */
@@ -702,6 +705,7 @@ static unsigned get_vq_desc(struct virtqueue *vq,
			errx(1, "Looped descriptor");
	} while ((i = next_desc(vq, i)) != vq->vring.num);

	vq->inflight++;
	return head;
}

@@ -719,6 +723,7 @@ static void add_used(struct virtqueue *vq, unsigned int head, int len)
	/* Make sure buffer is written before we update index. */
	wmb();
	vq->vring.used->idx++;
	vq->inflight--;
}

/* This actually sends the interrupt for this virtqueue */
@@ -726,8 +731,9 @@ static void trigger_irq(int fd, struct virtqueue *vq)
{
	unsigned long buf[] = { LHREQ_IRQ, vq->config.irq };

	/* If they don't want an interrupt, don't send one. */
	if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)
	/* If they don't want an interrupt, don't send one, unless empty. */
	if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)
	    && vq->inflight)
		return;

	/* Send the Guest an interrupt tell them we used something up. */
@@ -1107,6 +1113,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
	vq->next = NULL;
	vq->last_avail_idx = 0;
	vq->dev = dev;
	vq->inflight = 0;

	/* Initialize the configuration. */
	vq->config.num = num_descs;
@@ -1368,6 +1375,7 @@ static void setup_tun_net(const char *arg)

	/* Tell Guest what MAC address to use. */
	add_feature(dev, VIRTIO_NET_F_MAC);
	add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
	set_config(dev, sizeof(conf), &conf);

	/* We don't need the socket any more; setup is done. */
+3 −2
Original line number Diff line number Diff line
@@ -582,8 +582,9 @@ static void __init lguest_init_IRQ(void)
		int vector = FIRST_EXTERNAL_VECTOR + i;
		if (vector != SYSCALL_VECTOR) {
			set_intr_gate(vector, interrupt[i]);
			set_irq_chip_and_handler(i, &lguest_irq_controller,
						 handle_level_irq);
			set_irq_chip_and_handler_name(i, &lguest_irq_controller,
						      handle_level_irq,
						      "level");
		}
	}
	/* This call is required to set up for 4k stacks, where we have
+6 −1
Original line number Diff line number Diff line
@@ -260,6 +260,10 @@ static int virtblk_probe(struct virtio_device *vdev)
	if (virtio_has_feature(vdev, VIRTIO_BLK_F_BARRIER))
		blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);

	/* If disk is read-only in the host, the guest should obey */
	if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO))
		set_disk_ro(vblk->disk, 1);

	/* Host must always specify the capacity. */
	vdev->config->get(vdev, offsetof(struct virtio_blk_config, capacity),
			  &cap, sizeof(cap));
@@ -311,6 +315,7 @@ static void virtblk_remove(struct virtio_device *vdev)
	/* Stop all the virtqueues. */
	vdev->config->reset(vdev);

	del_gendisk(vblk->disk);
	blk_cleanup_queue(vblk->disk->queue);
	put_disk(vblk->disk);
	mempool_destroy(vblk->pool);
@@ -325,7 +330,7 @@ static struct virtio_device_id id_table[] = {

static unsigned int features[] = {
	VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX,
	VIRTIO_BLK_F_GEOMETRY,
	VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO,
};

static struct virtio_driver virtio_blk = {
+9 −0
Original line number Diff line number Diff line
@@ -112,3 +112,12 @@ config HW_RANDOM_PASEMI

	  If unsure, say Y.

config HW_RANDOM_VIRTIO
	tristate "VirtIO Random Number Generator support"
	depends on HW_RANDOM && VIRTIO
	---help---
	  This driver provides kernel-side support for the virtual Random Number
	  Generator hardware.

	  To compile this driver as a module, choose M here: the
	  module will be called virtio-rng.  If unsure, say N.
+1 −0
Original line number Diff line number Diff line
@@ -11,3 +11,4 @@ obj-$(CONFIG_HW_RANDOM_VIA) += via-rng.o
obj-$(CONFIG_HW_RANDOM_IXP4XX) += ixp4xx-rng.o
obj-$(CONFIG_HW_RANDOM_OMAP) += omap-rng.o
obj-$(CONFIG_HW_RANDOM_PASEMI) += pasemi-rng.o
obj-$(CONFIG_HW_RANDOM_VIRTIO) += virtio-rng.o
Loading