29 Jul, 2008

1 commit


26 Jun, 2008

1 commit


20 Jun, 2008

1 commit

  • I am able to reproduce the oops reported by Simon in __switch_to() with
    lguest.

    My debug showed that there is at least one lguest specific
    issue (which should be present in 2.6.25 and before aswell) and it got
    exposed with a kernel oops with the recent fpu dynamic allocation patches.

    In addition to the previous possible scenario (with fpu_counter), in the
    presence of lguest, it is possible that the cpu's TS bit it still set and the
    lguest launcher task's thread_info has TS_USEDFPU still set.

    This is because of the way the lguest launcher handling the guest's TS bit.
    (look at lguest_set_ts() in lguest_arch_run_guest()). This can result
    in a DNA fault while doing unlazy_fpu() in __switch_to(). This will
    end up causing a DNA fault in the context of new process thats
    getting context switched in (as opossed to handling DNA fault in the context
    of lguest launcher/helper process).

    This is wrong in both pre and post 2.6.25 kernels. In the recent
    2.6.26-rc series, this is showing up as NULL pointer dereferences or
    sleeping function called from atomic context(__switch_to()), as
    we free and dynamically allocate the FPU context for the newly
    created threads. Older kernels might show some FPU corruption for processes
    running inside of lguest.

    With the appended patch, my test system is running for more than 50 mins
    now. So atleast some of your oops (hopefully all!) should get fixed.
    Please give it a try. I will spend more time with this fix tomorrow.

    Reported-by: Simon Holm Thøgersen
    Reported-by: Patrick McHardy
    Signed-off-by: Suresh Siddha
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     

28 Mar, 2008

1 commit


31 Jan, 2008

2 commits

  • drivers/lguest/x86/core.c: In function ‘copy_in_guest_info’:
    drivers/lguest/x86/core.c:97: error: ‘struct x86_hw_tss’ has no member named ‘esp1’

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

    Rusty Russell
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (27 commits)
    lguest: use __PAGE_KERNEL instead of _PAGE_KERNEL
    lguest: Use explicit includes rateher than indirect
    lguest: get rid of lg variable assignments
    lguest: change gpte_addr header
    lguest: move changed bitmap to lg_cpu
    lguest: move last_pages to lg_cpu
    lguest: change last_guest to last_cpu
    lguest: change spte_addr header
    lguest: per-vcpu lguest pgdir management
    lguest: make pending notifications per-vcpu
    lguest: makes special fields be per-vcpu
    lguest: per-vcpu lguest task management
    lguest: replace lguest_arch with lg_cpu_arch.
    lguest: make registers per-vcpu
    lguest: make emulate_insn receive a vcpu struct.
    lguest: map_switcher_in_guest() per-vcpu
    lguest: per-vcpu interrupt processing.
    lguest: per-vcpu lguest timers
    lguest: make hypercalls use the vcpu struct
    lguest: make write() operation smp aware
    ...

    Manual conflict resolved (maybe even correctly, who knows) in
    drivers/lguest/x86/core.c

    Linus Torvalds
     

30 Jan, 2008

14 commits


26 Jan, 2008

1 commit

  • Replace all lock_cpu_hotplug/unlock_cpu_hotplug from the kernel and use
    get_online_cpus and put_online_cpus instead as it highlights the
    refcount semantics in these operations.

    The new API guarantees protection against the cpu-hotplug operation, but
    it doesn't guarantee serialized access to any of the local data
    structures. Hence the changes needs to be reviewed.

    In case of pseries_add_processor/pseries_remove_processor, use
    cpu_maps_update_begin()/cpu_maps_update_done() as we're modifying the
    cpu_present_map there.

    Signed-off-by: Gautham R Shenoy
    Signed-off-by: Ingo Molnar

    Gautham R Shenoy
     

25 Oct, 2007

2 commits


23 Oct, 2007

10 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
     
  • This gets rid of the lguest bus, drivers and DMA mechanism, to make
    way for a generic virtio mechanism.

    Signed-off-by: Rusty Russell

    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
     
  • Move setup_regs() to lguest_arch_setup_regs() in i386_core.c given
    that this is very architecture specific.

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

    Jes Sorensen
     
  • Clean up the hypercall code to make the code in hypercalls.c
    architecture independent. First process the common hypercalls and
    then call lguest_arch_do_hcall() if the call hasn't been handled.
    Rename struct hcall_ring to hcall_args.

    This patch requires the previous patch which reorganize the layout of
    struct lguest_regs on i386 so they match the layout of struct
    hcall_args.

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

    Jes Sorensen
     
  • Currently we look at the "trapnum" to see if the Guest wants a
    hypercall. But once the hypercall is done we have to reset trapnum to
    a bogus value, otherwise if we exit to userspace and return, we'd run
    the same hypercall twice (that was a nasty bug to find!).

    This has two main effects:

    1) When Jes's patch changes the hypercall args to be a generic "struct
    hcall_args" we simply change the type of "lg->hcall". It's set by
    arch code, so if it has to copy args or something it can do so, and
    point "hcall" into lg->arch somewhere.

    2) Async hypercalls only get run when an actual hypercall is pending.
    This simplfies the code a little and is a more logical semantic.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Move eax next to ebx/ecx/edx in struct lguest_regs on i386, so they
    will be located together and allow it to map directly to a struct
    hcall_ring entry (which will be renamed struct hcall_args as in a
    subsequent patch).

    This is in preparation for making the code hcall code architecture
    independent.

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

    Jes Sorensen
     
  • 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
     
  • lguest uses a "switcher" shim mapped high to bounce between host and
    guest. As lguest becomes less i386-centric, we separate this code
    into a subdir.

    Signed-off-by: Rusty Russell

    Rusty Russell