29 Jul, 2008

1 commit

  • Ron Minnich noticed that guest userspace gets a GPF when it tries to int3:
    we need to copy the privilege level from the guest-supplied IDT to the real
    IDT. int3 is the only common case where guest userspace expects to invoke
    an interrupt, so that's the symptom of failing to do this.

    Signed-off-by: Rusty Russell

    Rusty Russell
     

28 Mar, 2008

1 commit


30 Jan, 2008

9 commits


25 Oct, 2007

1 commit


23 Oct, 2007

5 commits

  • Jes complains that page table code still uses lgread_u32 even though
    it now uses general kernel pte types. The best thing to do is to
    generalize lgread_u32 and lgwrite_u32.

    This means we lose the efficiency of getuser(). We could potentially
    regain it if we used __copy_from_user instead of copy_from_user, but
    I'm not certain that our range check is equivalent to access_ok() on
    all platforms.

    Signed-off-by: Rusty Russell
    Acked-by: Jes Sorensen

    Rusty Russell
     
  • 1) This allows us to get alot closer to booting bzImages.

    2) It means we don't have to know page_offset.

    3) The Guest needs to modify the boot pagetables to create the
    PAGE_OFFSET mapping before jumping to C code.

    4) guest_pa() walks the page tables rather than using page_offset.

    5) We don't use page_offset to figure out whether to emulate: it was
    always kinda quesationable, and won't work for instructions done
    before remapping (bzImage unpacking in particular).

    6) We still want the kernel address for tlb flushing: have the initial
    hypercall give us that, too.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • (Based on Ron Minnich's LGUEST_PLAN9_SYSCALL patch).

    This patch allows Guests to specify what system call vector they want,
    and we try to reserve it. We only allow one non-Linux system call
    vector, to try to avoid DoS on the Host.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Separate i386 architecture specific from core.c and move it to
    x86/core.c and add x86/lguest.h header file to match.

    Signed-off-by: Jes Sorensen
    Signed-off-by: Rusty Russell

    Jes Sorensen
     
  • This simplifies the code a little, in preparation for allowing
    alternate system call vectors in guests (Plan 9 uses 0x40).

    Signed-off-by: Rusty Russell

    Rusty Russell
     

31 Aug, 2007

1 commit

  • If the stack pointer is 0xc057a000, then the first stack page is at
    0xc0579000 (the stack pointer is decremented before use). Not
    calculating this correctly caused guests with CONFIG_DEBUG_PAGEALLOC=y
    to be killed with a "bad stack page" message: the initial kernel stack
    was just proceeding the .smp_locks section which
    CONFIG_DEBUG_PAGEALLOC marks read-only when freeing.

    Thanks to Frederik Deweerdt for the bug report!

    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

09 Aug, 2007

1 commit

  • If a Guest makes hypercall which sets a GDT entry to not present, we
    currently set any segment registers using that GDT entry to 0.
    Unfortunately, this is not sufficient: there are other ways of
    altering GDT entries which will cause a fault.

    The correct solution to do what Linux does: let them set any GDT value
    they want and handle the #GP when popping causes a fault. This has
    the added benefit of making our Switcher slightly more robust in the
    case of any other bugs which cause it to fault.

    We kill the Guest if it causes a fault in the Switcher: it's the
    Guest's responsibility to make sure it's not using segments when it
    changes them.

    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

29 Jul, 2007

1 commit

  • A non-periodic clock_event_device and the "jiffies" clock don't mix well:
    tick_handle_periodic() can go into an infinite loop.

    Currently lguest guests use the jiffies clock when the TSC is
    unusable. Instead, make the Host write the current time into the lguest
    page on every interrupt. This doesn't cost much but is more precise
    and at least as accurate as the jiffies clock. It also gets rid of
    the GET_WALLCLOCK hypercall.

    Also, delay setting sched_clock until our clock is set up, otherwise
    the early printk timestamps can go backwards (not harmful, just ugly).

    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

27 Jul, 2007

3 commits


21 Jul, 2007

1 commit

  • The sense of the IF bit is backwards in the host interrupt handling.

    This means we always save "IF=1" on the stack when injecting an
    interrupt. It turns out this is almost always correct (unless the
    guest is taking a page fault in an interrupt due to an unpopulated
    vmalloc mapping), so went unnoticed.

    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Rusty Russell
     

20 Jul, 2007

1 commit

  • This is the code for the "lg.ko" module, which allows lguest guests to
    be launched.

    [akpm@linux-foundation.org: update for futex-new-private-futexes]
    [akpm@linux-foundation.org: build fix]
    [jmorris@namei.org: lguest: use hrtimers]
    [akpm@linux-foundation.org: x86_64 build fix]
    Signed-off-by: Rusty Russell
    Cc: Andi Kleen
    Cc: Eric Dumazet
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell