linux-mips
[Top] [All Lists]

[PATCH 05/31] mips/kvm: Use generic cache flushing functions.

To: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal <sanjayl@kymasys.com>
Subject: [PATCH 05/31] mips/kvm: Use generic cache flushing functions.
From: David Daney <ddaney.cavm@gmail.com>
Date: Fri, 7 Jun 2013 16:03:09 -0700
Cc: linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=+TvDyBNi/P/JTzYJ7fXpVlJ2POS24pUA5/sXlaxS1f8=; b=HKq11ol5q5PlSFbXm5vnLG4hxfzuVd9oPllGT+1mTckvB409Ff6XZCBLhRb1oJoQ6P dggoreG9loMfU45PXott6P5Uc9T5EvD2uljYGVzlzZ0mFnNZZTrA5KCEbI3SjMS6zK0Y LcvzJoYrpudYlDK7E6o5gqY9jfY47A5TM1t9AN3XQ5mlIu/N780mF01mTjfgylBU6uah kucRDwBr0TNUc+Vf57jlozTGw5QRwr4jGkmqxaVqe7H9CkTMK1lc/hB6ElHQBT2UoE/Z O6BVrnOTc785Kq7E1xxnVMa+rhqpBBG7C5mYHiMh0SZh2rkGTQOesPnWVy+c/4F0AqtV nkzQ==
In-reply-to: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1370646215-6543-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

We don't know if we have the r4k specific functions available, so use
universally available __flush_cache_all() instead.  This takes longer
as it flushes both i-cache and d-cache, but is available for all CPUs.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/kvm/kvm_mips_emul.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kvm/kvm_mips_emul.c b/arch/mips/kvm/kvm_mips_emul.c
index af9a661..a2c6687 100644
--- a/arch/mips/kvm/kvm_mips_emul.c
+++ b/arch/mips/kvm/kvm_mips_emul.c
@@ -916,8 +916,6 @@ kvm_mips_emulate_cache(uint32_t inst, uint32_t *opc, 
uint32_t cause,
                       struct kvm_run *run, struct kvm_vcpu *vcpu)
 {
        struct mips_coproc *cop0 = vcpu->arch.cop0;
-       extern void (*r4k_blast_dcache) (void);
-       extern void (*r4k_blast_icache) (void);
        enum emulation_result er = EMULATE_DONE;
        int32_t offset, cache, op_inst, op, base;
        struct kvm_vcpu_arch *arch = &vcpu->arch;
@@ -954,9 +952,9 @@ kvm_mips_emulate_cache(uint32_t inst, uint32_t *opc, 
uint32_t cause,
                     arch->gprs[base], offset);
 
                if (cache == MIPS_CACHE_DCACHE)
-                       r4k_blast_dcache();
+                       __flush_cache_all();
                else if (cache == MIPS_CACHE_ICACHE)
-                       r4k_blast_icache();
+                       __flush_cache_all();
                else {
                        printk("%s: unsupported CACHE INDEX operation\n",
                               __func__);
-- 
1.7.11.7


<Prev in Thread] Current Thread [Next in Thread>