OpenCloudOS-Kernel/arch/powerpc/kvm
Paul Mackerras 0456ec4ff2 KVM: PPC: Book3S HV: Report stolen time to guest through dispatch trace log
This adds code to measure "stolen" time per virtual core in units of
timebase ticks, and to report the stolen time to the guest using the
dispatch trace log (DTL).  The guest can register an area of memory
for the DTL for a given vcpu.  The DTL is a ring buffer where KVM
fills in one entry every time it enters the guest for that vcpu.

Stolen time is measured as time when the virtual core is not running,
either because the vcore is not runnable (e.g. some of its vcpus are
executing elsewhere in the kernel or in userspace), or when the vcpu
thread that is running the vcore is preempted.  This includes time
when all the vcpus are idle (i.e. have executed the H_CEDE hypercall),
which is OK because the guest accounts stolen time while idle as idle
time.

Each vcpu keeps a record of how much stolen time has been reported to
the guest for that vcpu so far.  When we are about to enter the guest,
we create a new DTL entry (if the guest vcpu has a DTL) and report the
difference between total stolen time for the vcore and stolen time
reported so far for the vcpu as the "enqueue to dispatch" time in the
DTL entry.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-04-08 14:01:29 +03:00
..
44x.c KVM: PPC: booke: Move vm core init/destroy out of booke.c 2012-04-08 12:51:05 +03:00
44x_emulate.c KVM: PPC: fix exit accounting for SPRs, tlbwe, tlbsx 2011-05-22 08:47:47 -04:00
44x_tlb.c KVM: PPC: e500: Add shadow PID support 2011-07-12 13:16:39 +03:00
44x_tlb.h KVM: ppc: rename 44x MMU functions used in booke.c 2009-03-24 11:02:56 +02:00
Kconfig KVM: PPC: make e500v2 kvm and e500mc cpu mutually exclusive 2012-04-08 12:54:59 +03:00
Makefile KVM: PPC: rename CONFIG_KVM_E500 -> CONFIG_KVM_E500V2 2012-04-08 12:54:57 +03:00
book3s.c KVM: PPC: booke: rework rescheduling checks 2012-04-08 12:55:05 +03:00
book3s_32_mmu.c KVM: PPC: Put segment registers in shared page 2010-10-24 10:52:11 +02:00
book3s_32_mmu_host.c KVM: PPC: Use get/set for to_svcpu to help preemption 2012-03-05 14:52:30 +02:00
book3s_32_sr.S KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode 2011-09-25 19:52:29 +03:00
book3s_64_mmu.c KVM: PPC: Interpret SDR1 as HVA in PAPR mode 2011-09-25 19:52:21 +03:00
book3s_64_mmu_host.c KVM: PPC: Use get/set for to_svcpu to help preemption 2012-03-05 14:52:30 +02:00
book3s_64_mmu_hv.c KVM: PPC: factor out lpid allocator from book3s_64_mmu_hv 2012-04-08 12:51:02 +03:00
book3s_64_slb.S KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode 2011-09-25 19:52:29 +03:00
book3s_64_vio_hv.c KVM: PPC: Accelerate H_PUT_TCE by implementing it in real mode 2011-07-12 13:16:56 +03:00
book3s_emulate.c powerpc/kvm: Fallout from system.h disintegration 2012-04-02 14:00:04 +10:00
book3s_exports.c powerpc: various straight conversions from module.h --> export.h 2011-10-31 19:30:44 -04:00
book3s_hv.c KVM: PPC: Book3S HV: Report stolen time to guest through dispatch trace log 2012-04-08 14:01:29 +03:00
book3s_hv_builtin.c KVM: PPC: Book3S HV: Fix kvm_alloc_linear in case where no linears exist 2012-04-03 16:42:22 +10:00
book3s_hv_interrupts.S KVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry 2012-04-03 16:42:30 +10:00
book3s_hv_rm_mmu.c KVM: Move gfn_to_memslot() to kvm_host.h 2012-03-05 14:57:22 +02:00
book3s_hv_rmhandlers.S KVM: PPC: Book3S HV: Make secondary threads more robust against stray IPIs 2012-04-08 14:01:20 +03:00
book3s_interrupts.S KVM: PPC: Save/Restore CR over vcpu_run 2012-04-03 16:42:34 +10:00
book3s_mmu_hpte.c KVM: PPC: Move fields between struct kvm_vcpu_arch and kvmppc_vcpu_book3s 2011-07-12 13:16:46 +03:00
book3s_paired_singles.c powerpc/kvm: Fallout from system.h disintegration 2012-04-02 14:00:04 +10:00
book3s_pr.c KVM: PPC: Book3S: PR: Fix preemption 2012-04-03 16:42:39 +10:00
book3s_pr_papr.c KVM: PPC: Book3s: PR: Add SPAPR H_BULK_REMOVE support 2012-04-08 12:55:31 +03:00
book3s_rmhandlers.S KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode 2011-09-25 19:52:29 +03:00
book3s_segment.S KVM: PPC: book3s_pr: Simplify transitions between virtual and real mode 2011-09-25 19:52:29 +03:00
booke.c KVM: PPC: Booke: only prepare to enter when we enter 2012-04-08 12:55:29 +03:00
booke.h KVM: PPC: booke: standard PPC floating point support 2012-04-08 12:54:15 +03:00
booke_emulate.c KVM: PPC: booke: category E.HV (GS-mode) support 2012-04-08 12:51:19 +03:00
booke_interrupts.S KVM: PPC: Save/Restore CR over vcpu_run 2012-04-03 16:42:34 +10:00
bookehv_interrupts.S KVM: PPC: Save/Restore CR over vcpu_run 2012-04-08 14:01:02 +03:00
e500.c KVM: PPC: e500: refactor core-specific TLB code 2012-04-08 12:51:12 +03:00
e500.h KVM: PPC: rename CONFIG_KVM_E500 -> CONFIG_KVM_E500V2 2012-04-08 12:54:57 +03:00
e500_emulate.c KVM: PPC: e500mc: Add doorbell emulation support 2012-04-08 12:54:50 +03:00
e500_tlb.c KVM: PPC: e500: fix typo in tlb code 2012-04-08 12:55:22 +03:00
e500mc.c KVM: PPC: e500mc support 2012-04-08 12:54:33 +03:00
emulate.c KVM: PPC: booke: Improve timer register emulation 2012-03-05 14:52:27 +02:00
fpu.S powerpc: Remove fpscr use from [kvm_]cvt_{fd,df} 2010-09-02 14:07:32 +10:00
powerpc.c KVM: PPC: rename CONFIG_KVM_E500 -> CONFIG_KVM_E500V2 2012-04-08 12:54:57 +03:00
timing.c KVM: PPC: fix partial application of "exit timing in ticks" 2011-07-12 13:16:28 +03:00
timing.h KVM: PPC: booke: category E.HV (GS-mode) support 2012-04-08 12:51:19 +03:00
trace.h KVM: PPC: booke: Add booke206 TLB trace 2012-03-05 14:52:40 +02:00