summaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2018-11-13 23:46:42 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 09:19:16 +0100
commit3ad5f23377b0c85f1db11f9436c6eabb08e02251 (patch)
treee98e14aa9f9145dc3a8c365cdd00127be602f141 /arch/xtensa
parent591dd5df1758e19f19fc58d5600f8a02013051a5 (diff)
downloadlinux-stable-3ad5f23377b0c85f1db11f9436c6eabb08e02251.tar.gz
linux-stable-3ad5f23377b0c85f1db11f9436c6eabb08e02251.tar.bz2
linux-stable-3ad5f23377b0c85f1db11f9436c6eabb08e02251.zip
xtensa: fix boot parameters address translation
commit 40dc948f234b73497c3278875eb08a01d5854d3f upstream. The bootloader may pass physical address of the boot parameters structure to the MMUv3 kernel in the register a2. Code in the _SetupMMU block in the arch/xtensa/kernel/head.S is supposed to map that physical address to the virtual address in the configured virtual memory layout. This code haven't been updated when additional 256+256 and 512+512 memory layouts were introduced and it may produce wrong addresses when used with these layouts. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/kernel/head.S7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S
index 2f76118ecf62..9053a5622d2c 100644
--- a/arch/xtensa/kernel/head.S
+++ b/arch/xtensa/kernel/head.S
@@ -88,9 +88,12 @@ _SetupMMU:
initialize_mmu
#if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
rsr a2, excsave1
- movi a3, 0x08000000
+ movi a3, XCHAL_KSEG_PADDR
+ bltu a2, a3, 1f
+ sub a2, a2, a3
+ movi a3, XCHAL_KSEG_SIZE
bgeu a2, a3, 1f
- movi a3, 0xd0000000
+ movi a3, XCHAL_KSEG_CACHED_VADDR
add a2, a2, a3
wsr a2, excsave1
1: