1. 19 5月, 2016 1 次提交
  2. 09 2月, 2016 1 次提交
  3. 09 1月, 2016 2 次提交
  4. 26 11月, 2015 1 次提交
  5. 01 10月, 2015 2 次提交
  6. 04 6月, 2015 1 次提交
  7. 30 1月, 2015 1 次提交
  8. 09 1月, 2015 1 次提交
  9. 08 11月, 2014 1 次提交
  10. 11 9月, 2014 1 次提交
  11. 25 8月, 2014 1 次提交
  12. 22 8月, 2014 1 次提交
  13. 11 7月, 2014 1 次提交
  14. 06 5月, 2014 1 次提交
  15. 27 6月, 2013 1 次提交
    • Y
      kvm: Add a tracepoint write_tsc_offset · 489223ed
      Yoshihiro YUNOMAE 提交于
      Add a tracepoint write_tsc_offset for tracing TSC offset change.
      We want to merge ftrace's trace data of guest OSs and the host OS using
      TSC for timestamp in chronological order. We need "TSC offset" values for
      each guest when merge those because the TSC value on a guest is always the
      host TSC plus guest's TSC offset. If we get the TSC offset values, we can
      calculate the host TSC value for each guest events from the TSC offset and
      the event TSC value. The host TSC values of the guest events are used when we
      want to merge trace data of guests and the host in chronological order.
      (Note: the trace_clock of both the host and the guest must be set x86-tsc in
      this case)
      
      This tracepoint also records vcpu_id which can be used to merge trace data for
      SMP guests. A merge tool will read TSC offset for each vcpu, then the tool
      converts guest TSC values to host TSC values for each vcpu.
      
      TSC offset is stored in the VMCS by vmx_write_tsc_offset() or
      vmx_adjust_tsc_offset(). KVM executes the former function when a guest boots.
      The latter function is executed when kvm clock is updated. Only host can read
      TSC offset value from VMCS, so a host needs to output TSC offset value
      when TSC offset is changed.
      
      Since the TSC offset is not often changed, it could be overwritten by other
      frequent events while tracing. To avoid that, I recommend to use a special
      instance for getting this event:
      
      1. set a instance before booting a guest
       # cd /sys/kernel/debug/tracing/instances
       # mkdir tsc_offset
       # cd tsc_offset
       # echo x86-tsc > trace_clock
       # echo 1 > events/kvm/kvm_write_tsc_offset/enable
      
      2. boot a guest
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Gleb Natapov <gleb@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      489223ed
  16. 28 11月, 2012 2 次提交
    • M
      KVM: x86: require matched TSC offsets for master clock · b48aa97e
      Marcelo Tosatti 提交于
      With master clock, a pvclock clock read calculates:
      
      ret = system_timestamp + [ (rdtsc + tsc_offset) - tsc_timestamp ]
      
      Where 'rdtsc' is the host TSC.
      
      system_timestamp and tsc_timestamp are unique, one tuple
      per VM: the "master clock".
      
      Given a host with synchronized TSCs, its obvious that
      guest TSC must be matched for the above to guarantee monotonicity.
      
      Allow master clock usage only if guest TSCs are synchronized.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      b48aa97e
    • M
      KVM: x86: implement PVCLOCK_TSC_STABLE_BIT pvclock flag · d828199e
      Marcelo Tosatti 提交于
      KVM added a global variable to guarantee monotonicity in the guest.
      One of the reasons for that is that the time between
      
      	1. ktime_get_ts(&timespec);
      	2. rdtscll(tsc);
      
      Is variable. That is, given a host with stable TSC, suppose that
      two VCPUs read the same time via ktime_get_ts() above.
      
      The time required to execute 2. is not the same on those two instances
      executing in different VCPUS (cache misses, interrupts...).
      
      If the TSC value that is used by the host to interpolate when
      calculating the monotonic time is the same value used to calculate
      the tsc_timestamp value stored in the pvclock data structure, and
      a single <system_timestamp, tsc_timestamp> tuple is visible to all
      vcpus simultaneously, this problem disappears. See comment on top
      of pvclock_update_vm_gtod_copy for details.
      
      Monotonicity is then guaranteed by synchronicity of the host TSCs
      and guest TSCs.
      
      Set TSC stable pvclock flag in that case, allowing the guest to read
      clock from userspace.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      d828199e
  17. 21 9月, 2012 1 次提交
  18. 29 6月, 2012 1 次提交
    • N
      tracing/kvm: Use __print_hex() for kvm_emulate_insn tracepoint · b102f1d0
      Namhyung Kim 提交于
      The kvm_emulate_insn tracepoint used __print_insn()
      for printing its instructions. However it makes the
      format of the event hard to parse as it reveals TP
      internals.
      
      Fortunately, kernel provides __print_hex for almost
      same purpose, we can use it instead of open coding
      it. The user-space can be changed to parse it later.
      
      That means raw kernel tracing will not be affected
      by this change:
      
       # cd /sys/kernel/debug/tracing/
       # cat events/kvm/kvm_emulate_insn/format
       name: kvm_emulate_insn
       ID: 29
       format:
      	...
       print fmt: "%x:%llx:%s (%s)%s", REC->csbase, REC->rip, __print_hex(REC->insn, REC->len), \
       __print_symbolic(REC->flags, { 0, "real" }, { (1 << 0) | (1 << 1), "vm16" }, \
       { (1 << 0), "prot16" }, { (1 << 0) | (1 << 2), "prot32" }, { (1 << 0) | (1 << 3), "prot64" }), \
       REC->failed ? " failed" : ""
      
       # echo 1 > events/kvm/kvm_emulate_insn/enable
       # cat trace
       # tracer: nop
       #
       # entries-in-buffer/entries-written: 2183/2183   #P:12
       #
       #                              _-----=> irqs-off
       #                             / _----=> need-resched
       #                            | / _---=> hardirq/softirq
       #                            || / _--=> preempt-depth
       #                            ||| /     delay
       #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
       #              | |       |   ||||       |         |
               qemu-kvm-1782  [002] ...1   140.931636: kvm_emulate_insn: 0:c102fa25:89 10 (prot32)
               qemu-kvm-1781  [004] ...1   140.931637: kvm_emulate_insn: 0:c102fa25:89 10 (prot32)
      
      Link: http://lkml.kernel.org/n/tip-wfw6y3b9ugtey8snaow9nmg5@git.kernel.org
      Link: http://lkml.kernel.org/r/1340757701-10711-2-git-send-email-namhyung@kernel.org
      
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: kvm@vger.kernel.org
      Acked-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      b102f1d0
  19. 25 6月, 2012 1 次提交
    • M
      KVM: host side for eoi optimization · ae7a2a3f
      Michael S. Tsirkin 提交于
      Implementation of PV EOI using shared memory.
      This reduces the number of exits an interrupt
      causes as much as by half.
      
      The idea is simple: there's a bit, per APIC, in guest memory,
      that tells the guest that it does not need EOI.
      We set it before injecting an interrupt and clear
      before injecting a nested one. Guest tests it using
      a test and clear operation - this is necessary
      so that host can detect interrupt nesting -
      and if set, it can skip the EOI MSR.
      
      There's a new MSR to set the address of said register
      in guest memory. Otherwise not much changed:
      - Guest EOI is not required
      - Register is tested & ISR is automatically cleared on exit
      
      For testing results see description of previous patch
      'kvm_para: guest side for eoi avoidance'.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      ae7a2a3f
  20. 26 9月, 2011 2 次提交
    • S
      KVM: Use __print_symbolic() for vmexit tracepoints · 0d460ffc
      Stefan Hajnoczi 提交于
      The vmexit tracepoints format the exit_reason to make it human-readable.
      Since the exit_reason depends on the instruction set (vmx or svm),
      formatting is handled with ftrace_print_symbols_seq() by referring to
      the appropriate exit reason table.
      
      However, the ftrace_print_symbols_seq() function is not meant to be used
      directly in tracepoints since it does not export the formatting table
      which userspace tools like trace-cmd and perf use to format traces.
      
      In practice perf dies when formatting vmexit-related events and
      trace-cmd falls back to printing the numeric value (with extra
      formatting code in the kvm plugin to paper over this limitation).  Other
      userspace consumers of vmexit-related tracepoints would be in similar
      trouble.
      
      To avoid significant changes to the kvm_exit tracepoint, this patch
      moves the vmx and svm exit reason tables into arch/x86/kvm/trace.h and
      selects the right table with __print_symbolic() depending on the
      instruction set.  Note that __print_symbolic() is designed for exporting
      the formatting table to userspace and allows trace-cmd and perf to work.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      0d460ffc
    • S
      KVM: Record instruction set in all vmexit tracepoints · e097e5ff
      Stefan Hajnoczi 提交于
      The kvm_exit tracepoint recently added the isa argument to aid decoding
      exit_reason.  The semantics of exit_reason depend on the instruction set
      (vmx or svm) and the isa argument allows traces to be analyzed on other
      machines.
      
      Add the isa argument to kvm_nested_vmexit and kvm_nested_vmexit_inject
      so these tracepoints can also be self-describing.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      e097e5ff
  21. 24 7月, 2011 1 次提交
  22. 12 7月, 2011 2 次提交
  23. 10 3月, 2011 1 次提交
  24. 12 1月, 2011 2 次提交
  25. 17 5月, 2010 4 次提交
  26. 25 4月, 2010 2 次提交
  27. 01 3月, 2010 3 次提交
  28. 03 12月, 2009 1 次提交