summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/tlb.h
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2017-03-14 10:15:13 +0000
committerJames Hogan <james.hogan@imgtec.com>2017-03-28 14:49:30 +0100
commita6c09b9f9d1c3b1daf8e24e5556d73b9303843ef (patch)
tree6f9e2001d732fb1438dd367207a7c55ec90b336f /arch/mips/include/asm/tlb.h
parenteb0bab386622ecd5626462dc9eeeab082ac8b717 (diff)
downloadtalos-op-linux-a6c09b9f9d1c3b1daf8e24e5556d73b9303843ef.tar.gz
talos-op-linux-a6c09b9f9d1c3b1daf8e24e5556d73b9303843ef.zip
MIPS: asm/tlb.h: Add UNIQUE_GUEST_ENTRYHI() macro
Add a distinct UNIQUE_GUEST_ENTRYHI() macro for invalidation of guest TLB entries by KVM, using addresses in KSeg1 rather than KSeg0. This avoids conflicts with guest invalidation routines when there is no EHINV bit to mark the whole entry as invalid, avoiding guest machine check exceptions on Cavium Octeon III. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: "Radim Krčmář" <rkrcmar@redhat.com> Cc: linux-mips@linux-mips.org Cc: kvm@vger.kernel.org
Diffstat (limited to 'arch/mips/include/asm/tlb.h')
-rw-r--r--arch/mips/include/asm/tlb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/mips/include/asm/tlb.h b/arch/mips/include/asm/tlb.h
index dd179fd8acda..939734de4359 100644
--- a/arch/mips/include/asm/tlb.h
+++ b/arch/mips/include/asm/tlb.h
@@ -21,9 +21,11 @@
*/
#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
-#define UNIQUE_ENTRYHI(idx) \
- ((CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) | \
+#define _UNIQUE_ENTRYHI(base, idx) \
+ (((base) + ((idx) << (PAGE_SHIFT + 1))) | \
(cpu_has_tlbinv ? MIPS_ENTRYHI_EHINV : 0))
+#define UNIQUE_ENTRYHI(idx) _UNIQUE_ENTRYHI(CKSEG0, idx)
+#define UNIQUE_GUEST_ENTRYHI(idx) _UNIQUE_ENTRYHI(CKSEG1, idx)
static inline unsigned int num_wired_entries(void)
{
OpenPOWER on IntegriCloud