12 Aug, 2007

2 commits

  • Commit 19d36ccdc34f5ed444f8a6af0cbfdb6790eb1177 "x86: Fix alternatives
    and kprobes to remap write-protected kernel text" uses code which is
    being patched for patching.

    In particular, paravirt_ops does patching in two stages: first it
    calls paravirt_ops.patch, then it fills any remaining instructions
    with nop_out(). nop_out calls text_poke() which calls
    lookup_address() which calls pgd_val() (aka paravirt_ops.pgd_val):
    that call site is one of the places we patch.

    If we always do patching as one single call to text_poke(), we only
    need make sure we're not patching the memcpy in text_poke itself.
    This means the prototype to paravirt_ops.patch needs to change, to
    marshal the new code into a buffer rather than patching in place as it
    does now. It also means all patching goes through text_poke(), which
    is known to be safe (apply_alternatives is also changed to make a
    single patch).

    AK: fix compilation on x86-64 (bad rusty!)
    AK: fix boot on x86-64 (sigh)
    AK: merged with other patches

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

    Andi Kleen
     
  • Files using bits from paravirt.h should explicitly include it rather than
    relying on it being pulled in by something else.

    Signed-off-by: Jes Sorensen
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jes Sorensen
     

09 Aug, 2007

2 commits

  • 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
     
  • lguest uses a host-supplied wallclock-based clocksource when the TSC
    is not reliable. As this is already in nanoseconds, I naively used a
    multiplier of 1 and a shift of 0.

    But update_wall_time() in its infinite wisdom decides to adjust the
    clock a little (where does it think it's getting a more accurate time
    from?)

    It will happily tweak the multiplier... to 0, then -1.

    So the "fix" is to use a shift of 22 like everyone else, and a
    multiplier of 1 << 22.

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

    Rusty Russell
     

07 Aug, 2007

1 commit

  • Lguest drivers need to default to "Y" otherwise they're never selected
    for new builds. (We don't bother prompting, because they're less than
    4k combined, and implied by selecting lguest support).

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

    Rusty Russell
     

30 Jul, 2007

1 commit


29 Jul, 2007

2 commits

  • 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
     
  • Jason Yeh sent his crashing .config: bzImages made with
    CONFIG_RELOCATABLE=y put the relocs where the BSS is expected, and we
    crash with unusual results such as:

    lguest: unhandled trap 14 at 0xc0122ae1 (0xa9)

    Relying on BSS being zero was merely laziness on my part, and
    unfortunately, lguest doesn't go through the normal startup path (which
    does this in asm).

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

    Rusty Russell
     

27 Jul, 2007

7 commits


22 Jul, 2007

1 commit

  • We need to make sure, that the clockevent devices are resumed, before
    the tick is resumed. The current resume logic does not guarantee this.

    Add CLOCK_EVT_MODE_RESUME and call the set mode functions of the clock
    event devices before resuming the tick / oneshot functionality.

    Fixup the existing users.

    Thanks to Nigel Cunningham for tracking down a long standing thinko,
    which affected the jinxed VAIO.

    [akpm@linux-foundation.org: xen build fix]
    Signed-off-by: Thomas Gleixner
    Cc: john stultz
    Cc: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

21 Jul, 2007

3 commits


20 Jul, 2007

4 commits

  • It's void __user *, not void * __user...

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • This is the Kconfig and Makefile to allow lguest to actually be
    compiled.

    Signed-off-by: Rusty Russell
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell
     
  • 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
     
  • lguest is a simple hypervisor for Linux on Linux. Unlike kvm it doesn't need
    VT/SVM hardware. Unlike Xen it's simply "modprobe and go". Unlike both, it's
    5000 lines and self-contained.

    Performance is ok, but not great (-30% on kernel compile). But given its
    hackability, I expect this to improve, along with the paravirt_ops code which
    it supplies a complete example for. There's also a 64-bit version being
    worked on and other craziness.

    But most of all, lguest is awesome fun! Too much of the kernel is a big ball
    of hair. lguest is simple enough to dive into and hack, plus has some warts
    which scream "fork me!".

    This patch:

    This is the code and headers required to make an i386 kernel an lguest guest.

    Signed-off-by: Rusty Russell
    Cc: Andi Kleen
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rusty Russell