summaryrefslogtreecommitdiff
path: root/tools/lguest/lguest.c
AgeCommit message (Collapse)AuthorFilesLines
2015-02-11lguest: add PCI config space emulation to example launcher.Rusty Russell1-5/+211
This handles ioport 0xCF8 and 0xCFC accesses, which are used to read/write PCI device config space. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: decode mmio accesses for PCI in example launcher.Rusty Russell1-0/+167
We don't do anything with them yet (emulate_mmio_write and emulate_mmio_read are stubs), but we decode the instructions and search for the device they're hitting. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: add MMIO region allocator in example launcher.Rusty Russell1-5/+23
This is where we point our PCI BARs, so that we can intercept MMIO accesses. We tell the kernel about it so any faults in this area are directed to us. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: add iomem region, where guest page faults get sent to userspace.Rusty Russell1-1/+2
This lets us implement PCI. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: suppress PS/2 keyboard polling.Rusty Russell1-0/+4
While hacking on getting I/O out to the lguest launcher, I noticed that returning 0xFF for the PS/2 keyboard status made it spin for a while thinking there was a key pending. Fix this by returning 1 instead of 0xFF. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: send trap 13 through to userspace.Rusty Russell1-0/+149
We copy 7 bytes at eip for userspace's instruction decode; we have to carefully handle the case where eip is at the end of a page. We can't leave this to userspace since kernel has all the page table decode logic. The decode logic moves to userspace, basically unchanged. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: write more information to userspace about pending traps.Rusty Russell1-6/+10
This is preparation for userspace handling MMIO and ioport accesses. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-02-11lguest: have --rng read from /dev/urandom not /dev/random.Rusty Russell1-5/+5
Theoretical debates aside, now it boots. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-07-15tools/lguest: offer VIRTIO_F_ANY_LAYOUT for net device.Rusty Russell1-0/+6
We don't care about layout, so advertise that fact. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-07-04lguest: fix example launcher compilation for broken glibc headers.Rusty Russell1-8/+9
Somehow a naked u16 slipped into the glibc headers on my Ubuntu machine (i386 2.17-0ubuntu5), breaking compile: In file included from lguest.c:46:0: /usr/include/linux/virtio_net.h:188:2: error: unknown type name ‘u16’ We use the kernel-style types anyway, just define them before the includes. Also remove the advice on adding missing headers: that no longer works. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-07-02tools/lguest: real barriers.Rusty Russell1-2/+2
Lguest guests are UP, but the host is probably SMP, so real barriers are required in case the device thread and the guest are on different CPUs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-07-02tools/lguest: fix missing rmb().Rusty Russell1-0/+13
The virtio spec was missing a barrier in example code, so I went back to look at the lguest code. Indeed, we need one. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-22lguest: fix block request handling in example launcher.Rusty Russell1-49/+35
virtio requests are scatter-gather-style descriptors, but no assumptions should be made about the layout. lguest was lazy here, but saved by the fact that the network device hands all requests to tun (which does it correctly) and console and random devices simply use readv and writev. Block devices, however, are broken: we convert to iovecs internally, just make sure we handle the correctly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-10-04lguest: fix occasional crash in example launcher.Rusty Russell1-0/+1
We usually got away with ->next on the final entry being NULL, but it finally bit me. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: stable@kernel.org
2012-01-12lguest: move the lguest tool to the tools directoryDavidlohr Bueso1-0/+2065
This is a better location instead of having it in Documentation. Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (fixed compile)