summaryrefslogtreecommitdiff
path: root/arch/mips/mti-malta
diff options
context:
space:
mode:
authorSanjay Lal <sanjayl@kymasys.com>2012-11-22 06:34:03 +0400
committerRalf Baechle <ralf@linux-mips.org>2013-05-08 05:55:35 +0400
commit9843b030cc951bce4a4d9bec38b5155c96eb1740 (patch)
treedd219e76dce1e1b92e6f5fc19e8767b60827c7ee /arch/mips/mti-malta
parent669e846e6c4e13f16d7418973609931e362cb16a (diff)
downloadlinux-9843b030cc951bce4a4d9bec38b5155c96eb1740.tar.xz
KVM/MIPS32: KVM Guest kernel support.
Both Guest kernel and Guest Userspace execute in UM. The memory map is as follows: Guest User address space: 0x00000000 -> 0x40000000 Guest Kernel Unmapped: 0x40000000 -> 0x60000000 Guest Kernel Mapped: 0x60000000 -> 0x80000000 - Guest Usermode virtual memory is limited to 1GB. Signed-off-by: Sanjay Lal <sanjayl@kymasys.com> Cc: kvm@vger.kernel.org Cc: linux-mips@linux-mips.org Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mti-malta')
-rw-r--r--arch/mips/mti-malta/malta-time.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index a144b89cf9ba..bc6ac00c0d57 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -76,6 +76,21 @@ static void __init estimate_frequencies(void)
unsigned int count, start;
unsigned int giccount = 0, gicstart = 0;
+#if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ)
+ unsigned int prid = read_c0_prid() & 0xffff00;
+
+ /*
+ * XXXKYMA: hardwire the CPU frequency to Host Freq/4
+ */
+ count = (CONFIG_KVM_HOST_FREQ * 1000000) >> 3;
+ if ((prid != (PRID_COMP_MIPS | PRID_IMP_20KC)) &&
+ (prid != (PRID_COMP_MIPS | PRID_IMP_25KF)))
+ count *= 2;
+
+ mips_hpt_frequency = count;
+ return;
+#endif
+
local_irq_save(flags);
/* Start counter exactly on falling edge of update flag. */