1. 16 12月, 2010 1 次提交
    • R
      lguest: populate initial_page_table · da32dac1
      Rusty Russell 提交于
      Two x86 patches broke lguest:
      1) v2.6.35-492-g72d7c3b3, which changed x86 to use the memblock allocator.
      
      In lguest, the host places linear page tables at the top of mem, which
      used to be enough to get us up to the swapper_pg_dir page tables.  With
      the first patch, the direct mapping tables used that memory:
      
      Before: kernel direct mapping tables up to 4000000 @ 7000-1a000
      After: kernel direct mapping tables up to 4000000 @ 3fed000-4000000
      
      I initially fixed this by lying about the amount of memory we had, so
      the kernel wouldn't blatt the lguest boot pagetables (yuk!), but then...
      
      2) v2.6.36-rc8-54-gb40827fa, which made x86 boot use initial_page_table.
      
      This was initialized in a part of head_32.S which isn't executed by
      lguest; it is then copied into swapper_pg_dir.  So we have to initialize
      it; and anyway we switch to it before we blatt the old tables, so that
      fixes the previous damage as well.
      
      For the moment, I cut & pasted the code into lguest's boot code, but
      next merge window I will merge them.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      To: x86@kernel.org
      da32dac1
  2. 14 4月, 2010 1 次提交
    • R
      lguest: stop using KVM hypercall mechanism · 091ebf07
      Rusty Russell 提交于
      This is a partial revert of 4cd8b5e2 "lguest: use KVM hypercalls";
      we revert to using (just as questionable but more reliable) int $15 for
      hypercalls.  I didn't revert the register mapping, so we still use the
      same calling convention as kvm.
      
      KVM in more recent incarnations stopped injecting a fault when a guest
      tried to use the VMCALL instruction from ring 1, so lguest under kvm
      fails to make hypercalls.  It was nice to share code with our KVM
      cousins, but this was overreach.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Matias Zabaljauregui <zabaljauregui@gmail.com>
      Cc: Avi Kivity <avi@redhat.com>
      091ebf07
  3. 30 7月, 2009 2 次提交
    • R
      lguest: update commentry · a91d74a3
      Rusty Russell 提交于
      Every so often, after code shuffles, I need to go through and unbitrot
      the Lguest Journey (see drivers/lguest/README).  Since we now use RCU in
      a simple form in one place I took the opportunity to expand that explanation.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      a91d74a3
    • R
      lguest: fix comment style · 2e04ef76
      Rusty Russell 提交于
      I don't really notice it (except to begrudge the extra vertical
      space), but Ingo does.  And he pointed out that one excuse of lguest
      is as a teaching tool, it should set a good example.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Ingo Molnar <mingo@redhat.com>
      2e04ef76
  4. 12 6月, 2009 2 次提交
    • R
      lguest: optimize by coding restore_flags and irq_enable in assembler. · 61f4bc83
      Rusty Russell 提交于
      The downside of the last patch which made restore_flags and irq_enable
      check interrupts is that they are now too big to be patched directly
      into the callsites, so the C versions are always used.
      
      But the C versions go via PV_CALLEE_SAVE_REGS_THUNK which saves all
      the registers.  In fact, we don't need any registers in the fast path,
      so we can do better than this if we actually code them in assembler.
      
      The results are in the noise, but since it's about the same amount of
      code, it's worth applying.
      
      1GB Guest->Host: input(suppressed),output(suppressed)
      Before:
      	Seconds: 0:16.53
      	Packets: 377268,753673
      	Interrupts: 22461,24297
      	Notifications: 1(5245),21303(732370)
      	Net IRQs triggered: 377023(245),42578(711095)
      
      After:
      	Seconds: 0:16.48
      	Packets: 377289,753673
      	Interrupts: 22281,24465
      	Notifications: 1(5245),21296(732377)
      	Net IRQs triggered: 377060(229),42564(711109)
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      61f4bc83
    • R
      lguest: improve interrupt handling, speed up stream networking · a32a8813
      Rusty Russell 提交于
      lguest never checked for pending interrupts when enabling interrupts, and
      things still worked.  However, it makes a significant difference to TCP
      performance, so it's time we fixed it by introducing a pending_irq flag
      and checking it on irq_restore and irq_enable.
      
      These two routines are now too big to patch into the 8/10 bytes
      patch space, so we drop that code.
      
      Note: The high latency on interrupt delivery had a very curious
      effect: once everything else was optimized, networking without GSO was
      faster than networking with GSO, since more interrupts were sent and
      hence a greater chance of one getting through to the Guest!
      
      Note2: (Almost) Closing the same loophole for iret doesn't have any
      measurable effect, so I'm leaving that patch for the moment.
      
      Before:
      	1GB tcpblast Guest->Host:		30.7 seconds
      	1GB tcpblast Guest->Host (no GSO):	76.0 seconds
      
      After:
      	1GB tcpblast Guest->Host:		6.8 seconds
      	1GB tcpblast Guest->Host (no GSO):	27.8 seconds
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a32a8813
  5. 30 3月, 2009 1 次提交
  6. 30 12月, 2008 1 次提交
  7. 28 3月, 2008 1 次提交
  8. 25 10月, 2007 1 次提交
  9. 23 10月, 2007 3 次提交
    • 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
      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
      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
  10. 25 9月, 2007 1 次提交
  11. 27 7月, 2007 2 次提交
  12. 21 7月, 2007 1 次提交
  13. 20 7月, 2007 2 次提交
    • R
      lguest: the host code · d7e28ffe
      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: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Eric Dumazet <dada1@cosmosbay.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d7e28ffe
    • R
      lguest: the guest code · 07ad157f
      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: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      07ad157f