1. 12 6月, 2009 4 次提交
    • R
      lguest: allow any process to send interrupts · 9f155a9b
      Rusty Russell 提交于
      We currently only allow the Launcher process to send interrupts, but it
      as we already send interrupts from the hrtimer, it's a simple matter of
      extracting that code into a common set_interrupt routine.
      
      As we switch to a thread per virtqueue, this avoids a bottleneck through the
      main Launcher process.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      9f155a9b
    • 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
    • R
      lguest: fix race in halt code · abd41f03
      Rusty Russell 提交于
      When the Guest does the LHCALL_HALT hypercall, we go to sleep, expecting
      that a timer or the Waker will wake_up_process() us.
      
      But we do it in a stupid way, leaving a classic missing wakeup race.
      
      So split maybe_do_interrupt() into interrupt_pending() and
      try_deliver_interrupt(), and check maybe_do_interrupt() and the
      "break_out" flag before calling schedule.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      abd41f03
    • R
      lguest: fix lguest wake on guest clock tick, or fd activity · a6c372de
      Rusty Russell 提交于
      The Launcher could be inside the Guest on another CPU; wake_up_process
      will do nothing because it is "running".  kick_process will knock it
      back into our kernel in this case, otherwise we'll miss it until the
      next guest exit.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      a6c372de
  2. 30 3月, 2009 2 次提交
  3. 24 12月, 2008 1 次提交
    • Y
      x86: fix lguest used_vectors breakage, -v2 · b77b881f
      Yinghai Lu 提交于
      Impact: fix lguest, clean up
      
      32-bit lguest used used_vectors to record vectors, but that model of
      allocating vectors changed and got broken, after we changed vector
      allocation to a per_cpu array.
      
      Try enable that for 64bit, and the array is used for all vectors that
      are not managed by vector_irq per_cpu array.
      
      Also kill system_vectors[], that is now a duplication of the
      used_vectors bitmap.
      
      [ merged in cpus4096 due to io_apic.c cpumask changes. ]
      [ -v2, fix build failure ]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b77b881f
  4. 29 7月, 2008 1 次提交
    • R
      lguest: Guest int3 fix · 0c12091d
      Rusty Russell 提交于
      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: NRusty Russell <rusty@rustcorp.com.au>
      0c12091d
  5. 28 3月, 2008 1 次提交
  6. 30 1月, 2008 9 次提交
  7. 25 10月, 2007 1 次提交
  8. 23 10月, 2007 5 次提交
  9. 31 8月, 2007 1 次提交
  10. 09 8月, 2007 1 次提交
    • R
      lguest: Fix Malicious Guest GDT Host Crash · 0d027c01
      Rusty Russell 提交于
      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: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0d027c01
  11. 29 7月, 2007 1 次提交
    • R
      Provide timespec to guests rather than jiffies clock. · 6c8dca5d
      Rusty Russell 提交于
      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: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6c8dca5d
  12. 27 7月, 2007 3 次提交
  13. 21 7月, 2007 1 次提交
  14. 20 7月, 2007 1 次提交