Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72270
b: refs/heads/master
c: 19f1537
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Oct 23, 2007
1 parent 7fd99bc commit 3a1f3dd
Show file tree
Hide file tree
Showing 6 changed files with 422 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15045275c32bf6d15d32c2eca8157be9c0ba6e45
refs/heads/master: 19f1537b7b8a9a82665db3ad8210a9d954d13acd
5 changes: 5 additions & 0 deletions trunk/arch/x86/lguest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ config LGUEST_GUEST
bool "Lguest guest support"
select PARAVIRT
depends on !X86_PAE
select VIRTIO
select VIRTIO_RING
select VIRTIO_CONSOLE
help
Lguest is a tiny in-kernel hypervisor. Selecting this will
allow your kernel to boot under lguest. This option will increase
your kernel size by about 6k. If in doubt, say N.

If you say Y here, make sure you say Y (or M) to the virtio block
and net drivers which lguest needs.
21 changes: 21 additions & 0 deletions trunk/arch/x86/lguest/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <linux/clockchips.h>
#include <linux/lguest.h>
#include <linux/lguest_launcher.h>
#include <linux/virtio_console.h>
#include <asm/paravirt.h>
#include <asm/param.h>
#include <asm/page.h>
Expand Down Expand Up @@ -849,6 +850,23 @@ static __init char *lguest_memory_setup(void)
return "LGUEST";
}

/* Before virtqueues are set up, we use LHCALL_NOTIFY on normal memory to
* produce console output. */
static __init int early_put_chars(u32 vtermno, const char *buf, int count)
{
char scratch[17];
unsigned int len = count;

if (len > sizeof(scratch) - 1)
len = sizeof(scratch) - 1;
scratch[len] = '\0';
memcpy(scratch, buf, len);
hcall(LHCALL_NOTIFY, __pa(scratch), 0, 0);

/* This routine returns the number of bytes actually written. */
return len;
}

/*G:050
* Patching (Powerfully Placating Performance Pedants)
*
Expand Down Expand Up @@ -1048,6 +1066,9 @@ __init void lguest_init(void *boot)
* adapted for lguest's use. */
add_preferred_console("hvc", 0, NULL);

/* Register our very early console. */
virtio_cons_early_init(early_put_chars);

/* Last of all, we set the power management poweroff hook to point to
* the Guest routine to power off. */
pm_power_off = lguest_power_off;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/lguest/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Guest requires the device configuration and probing code.
obj-$(CONFIG_LGUEST_GUEST) += lguest_device.o

# Host requires the other files, which can be a module.
obj-$(CONFIG_LGUEST) += lg.o
lg-y = core.o hypercalls.o page_tables.o interrupts_and_traps.o \
Expand Down
Loading

0 comments on commit 3a1f3dd

Please sign in to comment.