diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 12:03:07 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 12:03:07 -0400 |
| commit | 0d6810091cdbd05efeb31654c6a41a6cbdfdd2c8 (patch) | |
| tree | 44d79f8133ea6acd791fe4f32188789c2c65da93 /drivers | |
| parent | a98ce5c6feead6bfedefabd46cb3d7f5be148d9a (diff) | |
| parent | 43d33b21a03d3abcc8cbdeb4d52bc4568f822c5e (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-lguest
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-lguest: (45 commits)
Use "struct boot_params" in example launcher
Loading bzImage directly.
Revert lguest magic and use hook in head.S
Update lguest documentation to reflect the new virtual block device name.
generalize lgread_u32/lgwrite_u32.
Example launcher handle guests not being ready for input
Update example launcher for virtio
Lguest support for Virtio
Remove old lguest I/O infrrasructure.
Remove old lguest bus and drivers.
Virtio helper routines for a descriptor ringbuffer implementation
Module autoprobing support for virtio drivers.
Virtio console driver
Block driver using virtio.
Net driver using virtio
Virtio interface
Boot with virtual == physical to get closer to native Linux.
Allow guest to specify syscall vector to use.
Rename "cr3" to "gpgdir" to avoid x86-specific naming.
Pagetables to use normal kernel types
...
Diffstat (limited to 'drivers')
36 files changed, 2911 insertions, 4264 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig index 34f40ea0ba..f4076d9e99 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig | |||
| @@ -94,5 +94,5 @@ source "drivers/kvm/Kconfig" | |||
| 94 | 94 | ||
| 95 | source "drivers/uio/Kconfig" | 95 | source "drivers/uio/Kconfig" |
| 96 | 96 | ||
| 97 | source "drivers/lguest/Kconfig" | 97 | source "drivers/virtio/Kconfig" |
| 98 | endmenu | 98 | endmenu |
diff --git a/drivers/Makefile b/drivers/Makefile index cfe38ffff2..560496b433 100644 --- a/drivers/Makefile +++ b/drivers/Makefile | |||
| @@ -91,3 +91,4 @@ obj-$(CONFIG_HID) += hid/ | |||
| 91 | obj-$(CONFIG_PPC_PS3) += ps3/ | 91 | obj-$(CONFIG_PPC_PS3) += ps3/ |
| 92 | obj-$(CONFIG_OF) += of/ | 92 | obj-$(CONFIG_OF) += of/ |
| 93 | obj-$(CONFIG_SSB) += ssb/ | 93 | obj-$(CONFIG_SSB) += ssb/ |
| 94 | obj-$(CONFIG_VIRTIO) += virtio/ | ||
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index ce4b1e484e..4d0119ea9e 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
| @@ -425,4 +425,10 @@ config XEN_BLKDEV_FRONTEND | |||
| 425 | block device driver. It communicates with a back-end driver | 425 | block device driver. It communicates with a back-end driver |
| 426 | in another domain which drives the actual block device. | 426 | in another domain which drives the actual block device. |
| 427 | 427 | ||
| 428 | config VIRTIO_BLK | ||
| 429 | tristate "Virtio block driver (EXPERIMENTAL)" | ||
| 430 | depends on EXPERIMENTAL && VIRTIO | ||
| 431 | ---help--- | ||
| 432 | This is the virtual block driver for lguest. Say Y or M. | ||
| 433 | |||
| 428 | endif # BLK_DEV | 434 | endif # BLK_DEV |
diff --git a/drivers/block/Makefile b/drivers/block/Makefile index 014e72121b..7691505a2e 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile | |||
| @@ -25,10 +25,10 @@ obj-$(CONFIG_SUNVDC) += sunvdc.o | |||
| 25 | obj-$(CONFIG_BLK_DEV_UMEM) += umem.o | 25 | obj-$(CONFIG_BLK_DEV_UMEM) += umem.o |
| 26 | obj-$(CONFIG_BLK_DEV_NBD) += nbd.o | 26 | obj-$(CONFIG_BLK_DEV_NBD) += nbd.o |
| 27 | obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o | 27 | obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o |
| 28 | obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o | ||
| 28 | 29 | ||
| 29 | obj-$(CONFIG_VIODASD) += viodasd.o | 30 | obj-$(CONFIG_VIODASD) += viodasd.o |
| 30 | obj-$(CONFIG_BLK_DEV_SX8) += sx8.o | 31 | obj-$(CONFIG_BLK_DEV_SX8) += sx8.o |
| 31 | obj-$(CONFIG_BLK_DEV_UB) += ub.o | 32 | obj-$(CONFIG_BLK_DEV_UB) += ub.o |
| 32 | 33 | ||
| 33 | obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o | 34 | obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o |
| 34 | obj-$(CONFIG_LGUEST_BLOCK) += lguest_blk.o | ||
diff --git a/drivers/block/lguest_blk.c b/drivers/block/lguest_blk.c deleted file mode 100644 index fa8e42341b..0000000000 --- a/drivers/block/lguest_blk.c +++ /dev/null | |||
| @@ -1,421 +0,0 @@ | |||
| 1 | /*D:400 | ||
| 2 | * The Guest block driver | ||
| 3 | * | ||
| 4 | * This is a simple block driver, which appears as /dev/lgba, lgbb, lgbc etc. | ||
| 5 | * The mechanism is simple: we place the information about the request in the | ||
| 6 | * device page, then use SEND_DMA (containing the data for a write, or an empty | ||
| 7 | * "ping" DMA for a read). | ||
| 8 | :*/ | ||
| 9 | /* Copyright 2006 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation | ||
| 10 | * | ||
| 11 | * This program is free software; you can redistribute it and/or modify | ||
| 12 | * it under the terms of the GNU General Public License as published by | ||
| 13 | * the Free Software Foundation; either version 2 of the License, or | ||
| 14 | * (at your option) any later version. | ||
| 15 | * | ||
| 16 | * This program is distributed in the hope that it will be useful, | ||
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | * GNU General Public License for more details. | ||
| 20 | * | ||
| 21 | * You should have received a copy of the GNU General Public License | ||
| 22 | * along with this program; if not, write to the Free Software | ||
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 24 | */ | ||
| 25 | //#define DEBUG | ||
| 26 | #include <linux/init.h> | ||
| 27 | #include <linux/types.h> | ||
| 28 | #include <linux/blkdev.h> | ||
| 29 | #include <linux/interrupt.h> | ||
| 30 | #include <linux/lguest_bus.h> | ||
| 31 | |||
| 32 | static char next_block_index = 'a'; | ||
| 33 | |||
| 34 | /*D:420 Here is the structure which holds all the information we need about | ||
| 35 | * each Guest block device. | ||
| 36 | * | ||
| 37 | * I'm sure at this stage, you're wondering "hey, where was the adventure I was | ||
| 38 | * promised?" and thinking "Rusty sucks, I shall say nasty things about him on | ||
| 39 | * my blog". I think Real adventures have boring bits, too, and you're in the | ||
| 40 | * middle of one. But it gets better. Just not quite yet. */ | ||
| 41 | struct blockdev | ||
| 42 | { | ||
| 43 | /* The block queue infrastructure wants a spinlock: it is held while it | ||
| 44 | * calls our block request function. We grab it in our interrupt | ||
| 45 | * handler so the responses don't mess with new requests. */ | ||
| 46 | spinlock_t lock; | ||
| 47 | |||
| 48 | /* The disk structure registered with kernel. */ | ||
| 49 | struct gendisk *disk; | ||
| 50 | |||
| 51 | /* The major device number for this disk, and the interrupt. We only | ||
| 52 | * really keep them here for completeness; we'd need them if we | ||
| 53 | * supported device unplugging. */ | ||
| 54 | int major; | ||
| 55 | int irq; | ||
| 56 | |||
| 57 | /* The physical address of this device's memory page */ | ||
| 58 | unsigned long phys_addr; | ||
| 59 | /* The mapped memory page for convenient acces. */ | ||
| 60 | struct lguest_block_page *lb_page; | ||
| 61 | |||
| 62 | /* We only have a single request outstanding at a time: this is it. */ | ||
| 63 | struct lguest_dma dma; | ||
| 64 | struct request *req; | ||
| 65 | }; | ||
| 66 | |||
| 67 | /*D:495 We originally used end_request() throughout the driver, but it turns | ||
| 68 | * out that end_request() is deprecated, and doesn't actually end the request | ||
| 69 | * (which seems like a good reason to deprecate it!). It simply ends the first | ||
| 70 | * bio. So if we had 3 bios in a "struct request" we would do all 3, | ||
| 71 | * end_request(), do 2, end_request(), do 1 and end_request(): twice as much | ||
| 72 | * work as we needed to do. | ||
| 73 | * | ||
| 74 | * This reinforced to me that I do not understand the block layer. | ||
| 75 | * | ||
| 76 | * Nonetheless, Jens Axboe gave me this nice helper to end all chunks of a | ||
| 77 | * request. This improved disk speed by 130%. */ | ||
| 78 | static void end_entire_request(struct request *req, int uptodate) | ||
| 79 | { | ||
| 80 | if (end_that_request_first(req, uptodate, req->hard_nr_sectors)) | ||
| 81 | BUG(); | ||
| 82 | add_disk_randomness(req->rq_disk); | ||
| 83 | blkdev_dequeue_request(req); | ||
| 84 | end_that_request_last(req, uptodate); | ||
| 85 | } | ||
| 86 | |||
| 87 | /* I'm told there are only two stories in the world worth telling: love and | ||
| 88 | * hate. So there used to be a love scene here like this: | ||
| 89 | * | ||
| 90 | * Launcher: We could make beautiful I/O together, you and I. | ||
| 91 | * Guest: My, that's a big disk! | ||
| 92 | * | ||
| 93 | * Unfortunately, it was just too raunchy for our otherwise-gentle tale. */ | ||
| 94 | |||
| 95 | /*D:490 This is the interrupt handler, called when a block read or write has | ||
| 96 | * been completed for us. */ | ||
| 97 | static irqreturn_t lgb_irq(int irq, void *_bd) | ||
| 98 | { | ||
| 99 | /* We handed our "struct blockdev" as the argument to request_irq(), so | ||
| 100 | * it is passed through to us here. This tells us which device we're | ||
| 101 | * dealing with in case we have more than one. */ | ||
| 102 | struct blockdev *bd = _bd; | ||
| 103 | unsigned long flags; | ||
| 104 | |||
