Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Fix KVM guest fixmap address

KVM guest kernels for trap & emulate run in user mode, with a modified
set of kernel memory segments. However the fixmap address is still in
the normal KSeg3 region at 0xfffe0000 regardless, causing problems when
cache alias handling makes use of them when handling copy on write.

Therefore define FIXADDR_TOP as 0x7ffe0000 in the guest kernel mapped
region when CONFIG_KVM_GUEST is defined.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # v3.10+
Patchwork: https://patchwork.linux-mips.org/patch/9887/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
8e748c8d 24f2970f

+4
+4
arch/mips/include/asm/mach-generic/spaces.h
··· 94 94 #endif 95 95 96 96 #ifndef FIXADDR_TOP 97 + #ifdef CONFIG_KVM_GUEST 98 + #define FIXADDR_TOP ((unsigned long)(long)(int)0x7ffe0000) 99 + #else 97 100 #define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000) 101 + #endif 98 102 #endif 99 103 100 104 #endif /* __ASM_MACH_GENERIC_SPACES_H */