aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mti-malta
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2014-05-29 05:16:36 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-05-30 07:02:23 -0400
commiteda3d33c685ff62524500681249e4c8e2e8dbb8c (patch)
tree179621cdccda7d859e99c37e469cb939dc22e453 /arch/mips/mti-malta
parente30492bbe95a2495930aa7db7eacde5141e45332 (diff)
MIPS: KVM: Override guest kernel timer frequency directly
The KVM_HOST_FREQ Kconfig symbol was used by KVM guest kernels to override the timer frequency calculation to a value based on the host frequency. Now that the KVM timer emulation is implemented independent of the host timer frequency and defaults to 100MHz, adjust the working of CONFIG_KVM_HOST_FREQ to match. The Kconfig symbol now specifies the guest timer frequency directly, and has been renamed accordingly to KVM_GUEST_TIMER_FREQ. It now defaults to 100MHz too and the help text is updated to make it clear that a zero value will allow the normal timer frequency calculation to take place (based on the emulated RTC). Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gleb Natapov <gleb@kernel.org> Cc: kvm@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: Sanjay Lal <sanjayl@kymasys.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/mti-malta')
-rw-r--r--arch/mips/mti-malta/malta-time.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index 319009912142..3778a359f3ad 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -74,18 +74,8 @@ static void __init estimate_frequencies(void)
74 unsigned int giccount = 0, gicstart = 0; 74 unsigned int giccount = 0, gicstart = 0;
75#endif 75#endif
76 76
77#if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ) 77#if defined(CONFIG_KVM_GUEST) && CONFIG_KVM_GUEST_TIMER_FREQ
78 unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK); 78 mips_hpt_frequency = CONFIG_KVM_GUEST_TIMER_FREQ * 1000000;
79
80 /*
81 * XXXKYMA: hardwire the CPU frequency to Host Freq/4
82 */
83 count = (CONFIG_KVM_HOST_FREQ * 1000000) >> 3;
84 if ((prid != (PRID_COMP_MIPS | PRID_IMP_20KC)) &&
85 (prid != (PRID_COMP_MIPS | PRID_IMP_25KF)))
86 count *= 2;
87
88 mips_hpt_frequency = count;
89 return; 79 return;
90#endif 80#endif
91 81