kernel-ark/arch/x86/kvm
Zachary Amsden 5d3cb0f6a8 KVM: Improve TSC offset matching
There are a few improvements that can be made to the TSC offset
matching code.  First, we don't need to call the 128-bit multiply
(especially on a constant number), the code works much nicer to
do computation in nanosecond units.

Second, the way everything is setup with software TSC rate scaling,
we currently have per-cpu rates.  Obviously this isn't too desirable
to use in practice, but if for some reason we do change the rate of
all VCPUs at runtime, then reset the TSCs, we will only want to
match offsets for VCPUs running at the same rate.

Finally, for the case where we have an unstable host TSC, but
rate scaling is being done in hardware, we should call the platform
code to compute the TSC offset, so the math is reorganized to recompute
the base instead, then transform the base into an offset using the
existing API.

[avi: fix 64-bit division on i386]

Signed-off-by: Zachary Amsden <zamsden@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

KVM: Fix 64-bit division in kvm_write_tsc()

Breaks i386 build.

Signed-off-by: Avi Kivity <avi@redhat.com>
2012-03-08 14:10:03 +02:00
..
cpuid.c KVM: SVM: Add support for AMD's OSVW feature in guests 2012-03-05 14:52:21 +02:00
cpuid.h KVM: SVM: Add support for AMD's OSVW feature in guests 2012-03-05 14:52:21 +02:00
emulate.c KVM: x86 emulator: reject SYSENTER in compatibility mode on AMD guests 2012-03-05 14:57:20 +02:00
i8254.c KVM: x86: Consolidate PIT legacy test 2011-12-27 11:22:30 +02:00
i8254.h KVM: remove useless function declaration kvm_inject_pit_timer_irqs() 2011-05-11 07:57:09 -04:00
i8259.c KVM: x86: reset edge sense circuit of i8259 on init 2012-03-05 14:57:30 +02:00
irq.c
irq.h KVM: Intelligent device lookup on I/O bus 2011-09-25 19:17:59 +03:00
Kconfig KVM: Expose a version 2 architectural PMU to a guests 2011-12-27 11:24:29 +02:00
kvm_cache_regs.h KVM: MMU: Do not unconditionally read PDPTE from guest memory 2011-09-25 19:18:01 +03:00
kvm_timer.h KVM: emulate lapic tsc deadline timer for guest 2011-10-05 15:34:56 +02:00
lapic.c KVM: Infrastructure for software and hardware based TSC rate scaling 2012-03-08 14:09:35 +02:00
lapic.h KVM: Expose kvm_lapic_local_deliver() 2011-12-27 11:23:39 +02:00
Makefile KVM: Expose a version 2 architectural PMU to a guests 2011-12-27 11:24:29 +02:00
mmu_audit.c KVM: MMU: Remove unused kvm parameter from rmap_next() 2012-03-05 14:52:43 +02:00
mmu.c KVM: MMU: Remove unused kvm parameter from rmap_next() 2012-03-05 14:52:43 +02:00
mmu.h KVM: MMU: mmio page fault support 2011-07-24 11:50:40 +03:00
mmutrace.h KVM: MMU: audit: replace mmu audit tracepoint with jump-label 2011-12-27 11:22:05 +02:00
paging_tmpl.h KVM: MMU: audit: replace mmu audit tracepoint with jump-label 2011-12-27 11:22:05 +02:00
pmu.c KVM: Expose a version 2 architectural PMU to a guests 2011-12-27 11:24:29 +02:00
svm.c KVM: Infrastructure for software and hardware based TSC rate scaling 2012-03-08 14:09:35 +02:00
timer.c KVM: x86: Simplify kvm timer handler 2011-12-27 11:17:05 +02:00
trace.h KVM: Use __print_symbolic() for vmexit tracepoints 2011-09-25 19:17:59 +03:00
tss.h
vmx.c KVM: Infrastructure for software and hardware based TSC rate scaling 2012-03-08 14:09:35 +02:00
x86.c KVM: Improve TSC offset matching 2012-03-08 14:10:03 +02:00
x86.h KVM: Move cpuid code to new file 2011-12-27 11:21:49 +02:00