1. 11 7月, 2008 1 次提交
  2. 09 7月, 2008 1 次提交
  3. 08 7月, 2008 1 次提交
  4. 31 5月, 2008 1 次提交
  5. 30 5月, 2008 1 次提交
  6. 17 4月, 2008 1 次提交
  7. 28 3月, 2008 1 次提交
  8. 11 3月, 2008 2 次提交
    • R
      lguest: Revert 1ce70c4f, fix real problem. · 4357bd94
      Rusty Russell 提交于
      Ahmed managed to crash the Host in release_pgd(), which cannot be a Guest
      bug, and indeed it wasn't.
      
      The bug was that handing a 0 as the address of the toplevel page table
      being manipulated can cause the lookup code in find_pgdir() to return
      an uninitialized cache entry (we shadow up to 4 top level page tables
      for each Guest).
      
      Commit 37cc8d7f introduced this
      behaviour in the Guest, uncovering the bug.
      
      The patch which he submitted (which removed the /4 from the index
      calculation) simply ensured that these high-indexed entries hit the
      early exit path of guest_set_pmd().  But you get lots of segfaults in
      guest userspace as the PMDs aren't being updated.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      4357bd94
    • R
      lguest: Sanitize the lguest clock. · 3fabc55f
      Rusty Russell 提交于
      Now the TSC code handles a zero return from calculate_cpu_khz(),
      lguest can simply pass through the value it gets from the Host: if
      non-zero, all the normal TSC code applies.
      
      Otherwise (or if the Host really doesn't support TSC), the clocksource
      code will fall back to the slower but reasonable lguest clock.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      3fabc55f
  9. 26 2月, 2008 2 次提交
    • A
      x86/lguest: fix pgdir pmd index calculation · 1ce70c4f
      Ahmed S. Darwish 提交于
      Hi all,
      
      Beginning from commits close to v2.6.25-rc2, running lguest always oopses
      the host kernel. Oops is at [1].
      
      Bisection led to the following commit:
      
      commit 37cc8d7f
      
          x86/early_ioremap: don't assume we're using swapper_pg_dir
      
          At the early stages of boot, before the kernel pagetable has been
          fully initialized, a Xen kernel will still be running off the
          Xen-provided pagetables rather than swapper_pg_dir[].  Therefore,
          readback cr3 to determine the base of the pagetable rather than
          assuming swapper_pg_dir[].
      
       static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
       {
      -	pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)];
      +	/* Don't assume we're using swapper_pg_dir at this point */
      +	pgd_t *base = __va(read_cr3());
      +	pgd_t *pgd = &base[pgd_index(addr)];
       	pud_t *pud = pud_offset(pgd, addr);
       	pmd_t *pmd = pmd_offset(pud, addr);
      
      Trying to analyze the problem, it seems on the guest side of lguest,
      %cr3 has a different value from &swapper_pg-dir (which
      is AFAIK fine on a pravirt guest):
      
      Putting some debugging messages in early_ioremap_pmd:
      
      /* Appears 3 times */
      [    0.000000] ***************************
      [    0.000000] __va(%cr3) = c0000000, &swapper_pg_dir = c02cc000
      [    0.000000] ***************************
      
      After 8 hours of debugging and staring on lguest code, I noticed something
      strange in paravirt_ops->set_pmd hypercall invocation:
      
      static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval)
      {
      	*pmdp = pmdval;
      	lazy_hcall(LHCALL_SET_PMD, __pa(pmdp)&PAGE_MASK,
      		   (__pa(pmdp)&(PAGE_SIZE-1))/4, 0);
      }
      
      The first hcall parameter is global pgdir which looks fine. The second
      parameter is the pmd index in the pgdir which is suspectful.
      
      AFAIK, calculating the index of pmd does not need a divisoin over four.
      Removing the division made lguest work fine again . Patch is at [2].
      
      I am not sure why the division over four existed in the first place. It
      seems bogus, maybe the Xen patch just made the problem appear ?
      
      [2]: The patch:
      
      [PATCH] lguest: fix pgdir pmd index cacluation
      
      Remove an error in index calculation which leads to removing
      a not existing shadow page table (leading to a Null dereference).
      Signed-off-by: NAhmed S. Darwish <darwish.07@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1ce70c4f
    • H
      lguest: include function prototypes · cbc34973
      Harvey Harrison 提交于
      Added a declaration to asm-x86/lguest.h and moved the extern arrays there
      as well.  As an alternative to including asm/lguest.h directly, an
      include could be put in linux/lguest.h
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Cc: "rusty@rustcorp.com.au" <rusty@rustcorp.com.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      cbc34973
  10. 30 1月, 2008 8 次提交
  11. 30 11月, 2007 1 次提交
    • R
      lguest: prevent VISWS or VOYAGER randconfigs · b8415ec3
      Randy Dunlap 提交于
      Keep lguest from being enabled on VISWS or VOYAGER configs, just as is
      already done for VMI and XEN.  Otherwise randconfigs with VISWS and LGUEST
      have this problem:
      
      In file included from arch/x86/kernel/setup_32.c:61:
      include/asm-x86/mach-visws/setup_arch.h:8:1: warning: "ARCH_SETUP" redefined
      In file included from include/asm/msr.h:80,
                       from include/asm/processor_32.h:17,
                       from include/asm/processor.h:2,
                       from include/asm/thread_info_32.h:16,
                       from include/asm/thread_info.h:2,
                       from include/linux/thread_info.h:21,
                       from include/linux/preempt.h:9,
                       from include/linux/spinlock.h:49,
                       from include/linux/seqlock.h:29,
                       from include/linux/time.h:8,
                       from include/linux/timex.h:57,
                       from include/linux/sched.h:53,
                       from arch/x86/kernel/setup_32.c:24:
      include/asm/paravirt.h:458:1: warning: this is the location of the previous definition
      
      (and of course, this happens because kconfig does not follow dependencies
      when [evil] select is used...)
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b8415ec3
  12. 05 11月, 2007 2 次提交
  13. 25 10月, 2007 3 次提交
  14. 24 10月, 2007 1 次提交
  15. 23 10月, 2007 9 次提交
    • R
      Revert lguest magic and use hook in head.S · 814a0e5c
      Rusty Russell 提交于
      Version 2.07 of the boot protocol uses 0x23C for the hardware_subarch
      field, that for lguest is "1".  This allows us to use the standard
      boot entry point rather than the "GenuineLguest" string hack.
      
      The standard entry point also clears the BSS and copies the boot parameters
      and commandline for us, saving more code.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      814a0e5c
    • R
      Lguest support for Virtio · 19f1537b
      Rusty Russell 提交于
      This makes lguest able to use the virtio devices.
      
      We change the device descriptor page from a simple array to a variable
      length "type, config_len, status, config data..." format, and
      implement virtio_config_ops to read from that config data.
      
      We use the virtio ring implementation for an efficient Guest <-> Host
      virtqueue mechanism, and the new LHCALL_NOTIFY hypercall to kick the
      host when it changes.
      
      We also use LHCALL_NOTIFY on kernel addresses for very very early
      console output.  We could have another hypercall, but this hack works
      quite well.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      19f1537b
    • R
      Remove old lguest bus and drivers. · 0ca49ca9
      Rusty Russell 提交于
      This gets rid of the lguest bus, drivers and DMA mechanism, to make
      way for a generic virtio mechanism.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      0ca49ca9
    • R
      Virtio helper routines for a descriptor ringbuffer implementation · 0a8a69dd
      Rusty Russell 提交于
      These helper routines supply most of the virtqueue_ops for hypervisors
      which want to use a ring for virtio.  Unlike the previous lguest
      implementation:
      
      1) The rings are variable sized (2^n-1 elements).
      2) They have an unfortunate limit of 65535 bytes per sg element.
      3) The page numbers are always 64 bit (PAE anyone?)
      4) They no longer place used[] on a separate page, just a separate
         cacheline.
      5) We do a modulo on a variable.  We could be tricky if we cared.
      6) Interrupts and notifies are suppressed using flags within the rings.
      
      Users need only get the ring pages and provide a notify hook (KVM
      wants the guest to allocate the rings, lguest does it sanely).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Dor Laor <dor.laor@qumranet.com>
      0a8a69dd
    • R
      Boot with virtual == physical to get closer to native Linux. · 47436aa4
      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: NRusty Russell <rusty@rustcorp.com.au>
      47436aa4
    • R
      Allow guest to specify syscall vector to use. · c18acd73
      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: NRusty Russell <rusty@rustcorp.com.au>
      c18acd73
    • J
      Make hypercalls arch-independent. · b410e7b1
      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: NJes Sorensen <jes@sgi.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b410e7b1
    • J
      Move i386 part of core.c to x86/core.c. · 625efab1
      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: NJes Sorensen <jes@sgi.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      625efab1
    • R
      Move lguest guest support to arch/x86. · 34b8867a
      Rusty Russell 提交于
      Lguest has two sides: host support (to launch guests) and guest
      support (replacement boot path and paravirt_ops).  This moves the
      guest side to arch/x86/lguest where it's closer to related code.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Andi Kleen <ak@suse.de>
      34b8867a