* [PULL] virtio & lguest
@ 2009-12-09 9:54 Rusty Russell
0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2009-12-09 9:54 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, Michael S. Tsirkin, Adam Litke
The following changes since commit 3ff6a468b45b5dfeb0e903e56f4eb27d34b2437c:
Linus Torvalds (1):
Merge branch 'x86-xen-for-linus' of git://git.kernel.org/.../tip/linux-2.6-tip
are available in the git repository at:
ssh://master.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus.git master
Adam Litke (1):
virtio: Add memory statistics reporting to the balloon driver (V4)
Michael S. Tsirkin (3):
tun: export underlying socket
mm: export use_mm/unuse_mm to modules
vhost_net: a kernel-level virtio server
Rusty Russell (1):
lguest: remove unneeded zlib.h include in example launcher
Documentation/lguest/lguest.c | 1 -
MAINTAINERS | 9 +
arch/x86/kvm/Kconfig | 1 +
drivers/Makefile | 1 +
drivers/net/tun.c | 101 ++++-
drivers/vhost/Kconfig | 11 +
drivers/vhost/Makefile | 2 +
drivers/vhost/net.c | 648 ++++++++++++++++++++++++++
drivers/vhost/vhost.c | 968 +++++++++++++++++++++++++++++++++++++++
drivers/vhost/vhost.h | 159 +++++++
drivers/virtio/virtio_balloon.c | 94 ++++-
include/linux/Kbuild | 1 +
include/linux/if_tun.h | 14 +
include/linux/miscdevice.h | 1 +
include/linux/vhost.h | 130 ++++++
include/linux/virtio_balloon.h | 15 +
mm/mmu_context.c | 3 +
17 files changed, 2131 insertions(+), 28 deletions(-)
create mode 100644 drivers/vhost/Kconfig
create mode 100644 drivers/vhost/Makefile
create mode 100644 drivers/vhost/net.c
create mode 100644 drivers/vhost/vhost.c
create mode 100644 drivers/vhost/vhost.h
create mode 100644 include/linux/vhost.h
commit 263bdf09e82b7f67c9aee4bd78f65deefecd5d4a
Author: Michael S. Tsirkin <mst@redhat.com>
Date: Wed Nov 4 17:55:02 2009 +0200
tun: export underlying socket
Tun device looks similar to a packet socket
in that both pass complete frames from/to userspace.
This patch fills in enough fields in the socket underlying tun driver
to support sendmsg/recvmsg operations, and message flags
MSG_TRUNC and MSG_DONTWAIT, and exports access to this socket
to modules. Regular read/write behaviour is unchanged.
This way, code using raw sockets to inject packets
into a physical device, can support injecting
packets into host network stack almost without modification.
First user of this interface will be vhost virtualization
accelerator.
Signed-off-by: "Michael S. Tsirkin" <mst@redhat.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/net/tun.c | 101 +++++++++++++++++++++++++++++++++++++++---------
include/linux/if_tun.h | 14 +++++++
2 files changed, 96 insertions(+), 19 deletions(-)
commit f7223dc041362ff8c2e1eca559e5d412f83dec81
Author: Michael S. Tsirkin <mst@redhat.com>
Date: Wed Nov 4 17:55:38 2009 +0200
mm: export use_mm/unuse_mm to modules
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm. Export it to modules.
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
mm/mmu_context.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
commit 87190ae195562c4cd8efe09945765d497f4a6171
Author: Michael S. Tsirkin <mst@redhat.com>
Date: Mon Nov 9 19:22:30 2009 +0200
vhost_net: a kernel-level virtio server
What it is: vhost net is a character device that can be used to reduce
the number of system calls involved in virtio networking.
Existing virtio net code is used in the guest without modification.
There's similarity with vringfd, with some differences and reduced scope
- uses eventfd for signalling
- structures can be moved around in memory at any time (good for
migration, bug work-arounds in userspace)
- write logging is supported (good for migration)
- support memory table and not just an offset (needed for kvm)
common virtio related code has been put in a separate file vhost.c and
can be made into a separate module if/when more backends appear. I used
Rusty's lguest.c as the source for developing this part : this supplied
me with witty comments I wouldn't be able to write myself.
What it is not: vhost net is not a bus, and not a generic new system
call. No assumptions are made on how guest performs hypercalls.
Userspace hypervisors are supported as well as kvm.
How it works: Basically, we connect virtio frontend (configured by
userspace) to a backend. The backend could be a network device, or a tap
device. Backend is also configured by userspace, including vlan/mac
etc.
Status: This works for me, and I haven't see any crashes.
Compared to userspace, people reported improved latency (as I save up to
4 system calls per packet), as well as better bandwidth and CPU
utilization.
Features that I plan to look at in the future:
- mergeable buffers
- zero copy
- scalability tuning: figure out the best threading model to use
Note on RCU usage (this is also documented in vhost.h, near
private_pointer which is the value protected by this variant of RCU):
what is happening is that the rcu_dereference() is being used in a
workqueue item. The role of rcu_read_lock() is taken on by the start of
execution of the workqueue item, of rcu_read_unlock() by the end of
execution of the workqueue item, and of synchronize_rcu() by
flush_workqueue()/flush_work(). In the future we might need to apply
some gcc attribute or sparse annotation to the function passed to
INIT_WORK(). Paul's ack below is for this RCU usage.
(Includes fixes by Alan Cox <alan@linux.intel.com>)
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
MAINTAINERS | 9 +
arch/x86/kvm/Kconfig | 1 +
drivers/Makefile | 1 +
drivers/vhost/Kconfig | 11 +
drivers/vhost/Makefile | 2 +
drivers/vhost/net.c | 648 +++++++++++++++++++++++++++++
drivers/vhost/vhost.c | 968 ++++++++++++++++++++++++++++++++++++++++++++
drivers/vhost/vhost.h | 159 ++++++++
include/linux/Kbuild | 1 +
include/linux/miscdevice.h | 1 +
include/linux/vhost.h | 130 ++++++
11 files changed, 1931 insertions(+), 0 deletions(-)
commit 7e280facc1c0ab91e20dbc93d8e8dd88ca6ebaad
Author: Adam Litke <agl@us.ibm.com>
Date: Mon Nov 30 10:14:15 2009 -0600
virtio: Add memory statistics reporting to the balloon driver (V4)
Changes since V3:
- Do not do endian conversions as they will be done in the host
- Report stats that reference a quantity of memory in bytes
- Minor coding style updates
Changes since V2:
- Increase stat field size to 64 bits
- Report all sizes in kb (not pages)
- Drop anon_pages stat and fix endianness conversion
Changes since V1:
- Use a virtqueue instead of the device config space
When using ballooning to manage overcommitted memory on a host, a system for
guests to communicate their memory usage to the host can provide information
that will minimize the impact of ballooning on the guests. The current method
employs a daemon running in each guest that communicates memory statistics to a
host daemon at a specified time interval. The host daemon aggregates this
information and inflates and/or deflates balloons according to the level of
host memory pressure. This approach is effective but overly complex since a
daemon must be installed inside each guest and coordinated to communicate with
the host. A simpler approach is to collect memory statistics in the virtio
balloon driver and communicate them directly to the hypervisor.
This patch enables the guest-side support by adding stats collection and
reporting to the virtio balloon driver.
Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (minor fixes)
drivers/virtio/virtio_balloon.c | 94 +++++++++++++++++++++++++++++++++++---
include/linux/virtio_balloon.h | 15 ++++++
2 files changed, 101 insertions(+), 8 deletions(-)
commit add41851972501680c0a9a71228e3a7495d6bea3
Author: Rusty Russell <rusty@rustcorp.com.au>
Date: Wed Dec 9 11:48:11 2009 -0600
lguest: remove unneeded zlib.h include in example launcher
Two years ago 5bbf89fc2608 removed the horrible bzImage unpacking code.
Now it's time to remove the unneeded zlib.h include, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Documentation/lguest/lguest.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PULL] virtio & lguest
@ 2010-02-24 4:05 Rusty Russell
0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2010-02-24 4:05 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, virtualization, Adam Litke, Amit Shah, hch,
Jamie Lokier, Michael S. Tsirkin, Shirley Ma
(Will be away for a month from tomorrow, so this is an early pull request).
The following changes since commit 9f3a6284880ceea452903e2043c88d7226736318:
Linus Torvalds (1):
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
are available in the git repository at:
ssh://master.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus.git master
Adam Litke (2):
virtio: Add memory statistics reporting to the balloon driver (V4)
virtio: Fix scheduling while atomic in virtio_balloon stats
Amit Shah (29):
virtio: Initialize vq->data entries to NULL
virtio: console: We support only one device at a time
virtio: console: encapsulate buffer information in a struct
virtio: console: ensure add_inbuf can work for multiple ports as well
virtio: console: introduce a get_inbuf helper to fetch bufs from in_vq
virtio: console: don't assume a single console port.
virtio: console: struct ports for multiple ports per device.
virtio: console: ensure console size is updated on hvc open
virtio: console: Separate out console-specific data into a separate struct
virtio: console: Separate out console init into a new function
virtio: console: Separate out find_vqs operation into a different function
virtio: console: Introduce function to hand off data from host to readers
virtio: console: Introduce a send_buf function for a common path for sending data to host
virtio: console: Add a new MULTIPORT feature, support for generic ports
virtio: console: Prepare for writing to userspace buffers
virtio: console: Associate each port with a char device
virtio: console: Add file operations to ports for open/read/write/poll
virtio: console: Ensure only one process can have a port open at a time
virtio: console: Register with sysfs and create a 'name' attribute for ports
virtio: console: Remove cached data on port close
virtio: console: Handle port hot-plug
virtio: console: Add ability to hot-unplug ports
virtio: console: Add debugfs files for each port to expose debug info
virtio: console: show error message if hvc_alloc fails for console ports
virtio: console: Ensure no memleaks in case of unused buffers
virtio: console: Add ability to remove module
virtio: console: Error out if we can't allocate buffers for control queue
virtio: console: Fill ports' entire in_vq with buffers
Add MAINTAINERS entry for virtio_console
Christoph Hellwig (1):
virtio_blk: add block topology support
Jamie Lokier (1):
Add __devexit_p around reference to virtio_pci_remove
Michael S. Tsirkin (1):
virtio: use smp_XX barriers on SMP
Rusty Russell (9):
virtio: fix balloon without VIRTIO_BALLOON_F_STATS_VQ
lguest: remove unneeded zlib.h include in example launcher
virtio: remove bogus barriers from DEBUG version of virtio_ring.c
virtio: console: comment cleanup
virtio: console: statically initialize virtio_cons
hvc_console: make the ops pointer const.
virtio: console: port encapsulation
virtio: console: use vdev->priv to avoid accessing global var.
virtio: console: remove global var
Shirley Ma (1):
virtio: Add ability to detach unused buffers from vrings
Documentation/lguest/lguest.c | 1 -
MAINTAINERS | 6 +
drivers/block/virtio_blk.c | 61 ++-
drivers/char/Kconfig | 8 +
drivers/char/hvc_beat.c | 2 +-
drivers/char/hvc_console.c | 7 +-
drivers/char/hvc_console.h | 7 +-
drivers/char/hvc_iseries.c | 2 +-
drivers/char/hvc_iucv.c | 2 +-
drivers/char/hvc_rtas.c | 2 +-
drivers/char/hvc_udbg.c | 2 +-
drivers/char/hvc_vio.c | 2 +-
drivers/char/hvc_xen.c | 2 +-
drivers/char/virtio_console.c | 1578 +++++++++++++++++++++++++++++++++++----
drivers/virtio/virtio_balloon.c | 109 +++-
drivers/virtio/virtio_pci.c | 2 +-
drivers/virtio/virtio_ring.c | 59 ++-
include/linux/virtio.h | 4 +
include/linux/virtio_balloon.h | 15 +
include/linux/virtio_blk.h | 13 +
include/linux/virtio_console.h | 30 +-
21 files changed, 1721 insertions(+), 193 deletions(-)
--
Away travelling 25Feb-26Mar (6 .de + 1 .pl + 17 .lt + 2 .sg)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PULL] virtio & lguest
@ 2013-05-02 0:12 Rusty Russell
0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2013-05-02 0:12 UTC (permalink / raw)
To: Linus Torvalds
Cc: lkml, Amit Shah, Amos Kong, Asias He, Cosmin Paraschiv,
Daniel Baluta, Dmitry Tarnyagin, Eric Van Hensbergen, Erwan Yvin,
Mateusz Guzik, Michael S. Tsirkin, Milos Vyletel, Ohad Ben-Cohen,
Paolo Bonzini, Paul Bolle, Sasha Levin, Sjur Brendeland,
Venkatesh Srinivas, Vikram Arv, Wanlong Gao, Wei Yongjun
The following changes since commit 6dbe51c251a327e012439c4772097a13df43c5b8:
Linux 3.9-rc1 (2013-03-03 15:11:05 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git tags/virtio-next-for-linus
for you to fetch changes up to 01d779a14ef800b74684d9692add4944df052461:
caif_virtio: Remove bouncing email addresses (2013-05-01 11:59:15 +0930)
----------------------------------------------------------------
Lots of virtio work which wasn't quite ready for last merge window. Plus
I dived into lguest again, reworking the pagetable code so we can move
the switcher page: our fixmaps sometimes take more than 2MB now...
Cheers,
Rusty.
----------------------------------------------------------------
Amit Shah (1):
virtio: console: replace EMFILE with EBUSY for already-open port
Amos Kong (1):
MAINTAINERS: add missing entries for virtio
Cosmin Paraschiv (1):
lguest: improve code readability in lg_cpu_start.
Erwan Yvin (1):
caif_virtio: Introduce caif over virtio
Michael S. Tsirkin (1):
tools/virtio: fix build for 3.8
Milos Vyletel (1):
virtio-blk: emit udev event when device is resized
Paolo Bonzini (7):
scatterlist: introduce sg_unmark_end
virtio-blk: reorganize virtblk_add_req
virtio-blk: use virtqueue_add_sgs on bio path
virtio-blk: use virtqueue_add_sgs on req path
virtio-scsi: pass struct virtio_scsi to virtqueue completion function
virtio-scsi: push vq lock/unlock into virtscsi_vq_done
virtio-scsi: introduce multiqueue support
Paul Bolle (1):
virtio: do not export "u16" and "u64" to userspace
Rusty Russell (31):
Remove Documentation/virtual/virtio-spec.txt
virtio_ring: expose virtio barriers for use in vringh.
tools/virtio: separate headers more.
vringh: host-side implementation of virtio rings.
tools/virtio: add vring_test.
virtio_ring: virtqueue_add_sgs, to add multiple sgs.
virtio_ring: virtqueue_add_outbuf / virtqueue_add_inbuf.
tools/virtio: make vringh_test use inbuf/outbuf.
virtio_blk: remove nents member.
virtio_scsi: use virtqueue_add_inbuf() for virtscsi_kick_event.
virtio_net: use virtqueue_add_sgs[] for command buffers.
virtio_net: use simplified virtqueue accessors.
virtio_rng: use simplified virtqueue accessors.
virtio_console: use simplified virtqueue accessors.
caif_virtio: use simplified virtqueue accessors.
virtio_rpmsg_bus: use simplified virtqueue accessors.
virtio_balloon: use simplified virtqueue accessors.
9p/trans_virtio.c: use virtio_add_sgs[]
tools/virtio: remove virtqueue_add_buf() from tests.
lguest: prepare to make SWITCHER_ADDR a variable.
lguest: check vaddr not pgd for Switcher protection.
lguest: remove RESERVE_MEM constant.
lguest: rename switcher_page to switcher_pages.
lguest: assume Switcher text is a single page.
lguest: make check_gpte et. al return bool.
lguest: extract shadow PTE walking / allocating.
lguest: expost switcher_pages array (as lg_switcher_pages).
lguest: don't share Switcher PTE pages between guests.
lguest: map Switcher text whenever we allocate a new pagetable.
lguest: cache last cpu we ran on.
lguest: map Switcher below fixmap.
Sasha Levin (1):
virtio-net: fill only rx queues which are being used
Sjur Brændeland (4):
virtio: Introduce vringh wrappers in virtio_config
caif_virtio: Use vringh_notify_enable correctly
caif_virtio: Check that vringh_config is not null
caif_virtio: Remove bouncing email addresses
Wanlong Gao (5):
lguest: fix paths in comments
virtio-scsi: use pr_err() instead of printk()
virtio-scsi: use virtqueue_add_sgs for command buffers
virtio-scsi: redo allocation of target data
virtio-scsi: reset virtqueue affinity when doing cpu hotplug
Wei Yongjun (2):
caif_virtio: fix error return code in cfv_create_genpool()
virtio_console: make local symbols static
Documentation/virtual/00-INDEX | 3 -
Documentation/virtual/virtio-spec.txt | 3210 -------------------------------
MAINTAINERS | 1 +
arch/x86/include/asm/lguest.h | 17 +-
block/blk-integrity.c | 2 +-
block/blk-merge.c | 2 +-
drivers/Makefile | 2 +-
drivers/block/virtio_blk.c | 148 +-
drivers/char/hw_random/virtio-rng.c | 2 +-
drivers/char/virtio_console.c | 14 +-
drivers/lguest/Kconfig | 5 +-
drivers/lguest/core.c | 67 +-
drivers/lguest/lg.h | 6 +-
drivers/lguest/lguest_user.c | 6 +-
drivers/lguest/page_tables.c | 567 +++---
drivers/lguest/x86/core.c | 7 +-
drivers/net/caif/Kconfig | 14 +
drivers/net/caif/Makefile | 3 +
drivers/net/caif/caif_virtio.c | 790 ++++++++
drivers/net/virtio_net.c | 77 +-
drivers/rpmsg/virtio_rpmsg_bus.c | 8 +-
drivers/scsi/virtio_scsi.c | 487 +++--
drivers/vhost/Kconfig | 8 +
drivers/vhost/Kconfig.tcm | 1 +
drivers/vhost/Makefile | 2 +
drivers/vhost/test.c | 4 +-
drivers/vhost/vringh.c | 1007 ++++++++++
drivers/virtio/virtio_balloon.c | 6 +-
drivers/virtio/virtio_ring.c | 297 ++-
include/linux/scatterlist.h | 16 +
include/linux/virtio.h | 20 +
include/linux/virtio_caif.h | 24 +
include/linux/virtio_ring.h | 57 +
include/linux/vringh.h | 225 +++
include/uapi/linux/virtio_balloon.h | 4 +-
include/uapi/linux/virtio_ids.h | 1 +
net/9p/trans_virtio.c | 48 +-
tools/lguest/lguest.txt | 2 +-
tools/virtio/Makefile | 10 +-
tools/virtio/asm/barrier.h | 14 +
tools/virtio/linux/bug.h | 10 +
tools/virtio/linux/err.h | 26 +
tools/virtio/linux/export.h | 5 +
tools/virtio/linux/irqreturn.h | 1 +
tools/virtio/linux/kernel.h | 112 ++
tools/virtio/linux/module.h | 1 +
tools/virtio/linux/printk.h | 4 +
tools/virtio/linux/ratelimit.h | 4 +
tools/virtio/linux/scatterlist.h | 189 ++
tools/virtio/linux/types.h | 28 +
tools/virtio/linux/uaccess.h | 50 +
tools/virtio/linux/uio.h | 3 +
tools/virtio/linux/virtio.h | 171 +-
tools/virtio/linux/virtio_config.h | 6 +
tools/virtio/linux/virtio_ring.h | 1 +
tools/virtio/linux/vringh.h | 1 +
tools/virtio/uapi/linux/uio.h | 1 +
tools/virtio/uapi/linux/virtio_config.h | 1 +
tools/virtio/uapi/linux/virtio_ring.h | 4 +
tools/virtio/virtio_test.c | 13 +-
tools/virtio/vringh_test.c | 741 +++++++
61 files changed, 4482 insertions(+), 4074 deletions(-)
delete mode 100644 Documentation/virtual/virtio-spec.txt
create mode 100644 drivers/net/caif/caif_virtio.c
create mode 100644 drivers/vhost/vringh.c
create mode 100644 include/linux/virtio_caif.h
create mode 100644 include/linux/vringh.h
create mode 100644 tools/virtio/asm/barrier.h
create mode 100644 tools/virtio/linux/bug.h
create mode 100644 tools/virtio/linux/err.h
create mode 100644 tools/virtio/linux/export.h
create mode 100644 tools/virtio/linux/irqreturn.h
create mode 100644 tools/virtio/linux/kernel.h
create mode 100644 tools/virtio/linux/printk.h
create mode 100644 tools/virtio/linux/ratelimit.h
create mode 100644 tools/virtio/linux/scatterlist.h
create mode 100644 tools/virtio/linux/types.h
create mode 100644 tools/virtio/linux/uaccess.h
create mode 100644 tools/virtio/linux/uio.h
create mode 100644 tools/virtio/linux/virtio_config.h
create mode 100644 tools/virtio/linux/virtio_ring.h
create mode 100644 tools/virtio/linux/vringh.h
create mode 100644 tools/virtio/uapi/linux/uio.h
create mode 100644 tools/virtio/uapi/linux/virtio_config.h
create mode 100644 tools/virtio/uapi/linux/virtio_ring.h
create mode 100644 tools/virtio/vringh_test.c
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-02 0:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02 0:12 [PULL] virtio & lguest Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2010-02-24 4:05 Rusty Russell
2009-12-09 9:54 Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox