1. 27 5月, 2008 1 次提交
    • J
      xen: implement save/restore · 0e91398f
      Jeremy Fitzhardinge 提交于
      This patch implements Xen save/restore and migration.
      
      Saving is triggered via xenbus, which is polled in
      drivers/xen/manage.c.  When a suspend request comes in, the kernel
      prepares itself for saving by:
      
      1 - Freeze all processes.  This is primarily to prevent any
          partially-completed pagetable updates from confusing the suspend
          process.  If CONFIG_PREEMPT isn't defined, then this isn't necessary.
      
      2 - Suspend xenbus and other devices
      
      3 - Stop_machine, to make sure all the other vcpus are quiescent.  The
          Xen tools require the domain to run its save off vcpu0.
      
      4 - Within the stop_machine state, it pins any unpinned pgds (under
          construction or destruction), performs canonicalizes various other
          pieces of state (mostly converting mfns to pfns), and finally
      
      5 - Suspend the domain
      
      Restore reverses the steps used to save the domain, ending when all
      the frozen processes are thawed.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      0e91398f
  2. 10 2月, 2008 1 次提交
  3. 30 1月, 2008 1 次提交
  4. 17 10月, 2007 1 次提交
  5. 11 10月, 2007 1 次提交
  6. 22 7月, 2007 1 次提交
  7. 18 7月, 2007 5 次提交
    • J
      xen: Add support for preemption · f120f13e
      Jeremy Fitzhardinge 提交于
      Add Xen support for preemption.  This is mostly a cleanup of existing
      preempt_enable/disable calls, or just comments to explain the current
      usage.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      f120f13e
    • J
      xen: SMP guest support · f87e4cac
      Jeremy Fitzhardinge 提交于
      This is a fairly straightforward Xen implementation of smp_ops.
      
      Xen has its own IPI mechanisms, and has no dependency on any
      APIC-based IPI.  The smp_ops hooks and the flush_tlb_others pv_op
      allow a Xen guest to avoid all APIC code in arch/i386 (the only apic
      operation is a single apic_read for the apic version number).
      
      One subtle point which needs to be addressed is unpinning pagetables
      when another cpu may have a lazy tlb reference to the pagetable. Xen
      will not allow an in-use pagetable to be unpinned, so we must find any
      other cpus with a reference to the pagetable and get them to shoot
      down their references.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Andi Kleen <ak@suse.de>
      f87e4cac
    • J
      xen: Implement sched_clock · ab550288
      Jeremy Fitzhardinge 提交于
      Implement xen_sched_clock, which returns the number of ns the current
      vcpu has been actually in an unstolen state (ie, running or blocked,
      vs runnable-but-not-running, or offline) since boot.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Cc: john stultz <johnstul@us.ibm.com>
      ab550288
    • J
      xen: Account for stolen time · f91a8b44
      Jeremy Fitzhardinge 提交于
      This patch accounts for the time stolen from our VCPUs.  Stolen time is
      time where a vcpu is runnable and could be running, but all available
      physical CPUs are being used for something else.
      
      This accounting gets run on each timer interrupt, just as a way to get
      it run relatively often, and when interesting things are going on.
      Stolen time is not really used by much in the kernel; it is reported
      in /proc/stats, and that's about it.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      f91a8b44
    • J
      xen: time implementation · 15c84731
      Jeremy Fitzhardinge 提交于
      Xen maintains a base clock which measures nanoseconds since system
      boot.  This is provided to guests via a shared page which contains a
      base time in ns, a tsc timestamp at that point and tsc frequency
      parameters.  Guests can compute the current time by reading the tsc
      and using it to extrapolate the current time from the basetime.  The
      hypervisor makes sure that the frequency parameters are updated
      regularly, paricularly if the tsc changes rate or stops.
      
      This is implemented as a clocksource, so the interface to the rest of
      the kernel is a simple clocksource which simply returns the current
      time directly in nanoseconds.
      
      Xen also provides a simple timer mechanism, which allows a timeout to
      be set in the future.  When that time arrives, a timer event is sent
      to the guest.  There are two timer interfaces:
       - An old one which also delivers a stream of (unused) ticks at 100Hz,
         and on the same event, the actual timer events.  The 100Hz ticks
         cause a lot of spurious wakeups, but are basically harmless.
       - The new timer interface doesn't have the 100Hz ticks, and can also
         fail if the specified time is in the past.
      
      This code presents the Xen timer as a clockevent driver, and uses the
      new interface by preference.
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      15c84731