linux/arch/arc
Alexey Brodkin 73e7c1f3ec ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE
commit 06f34e1c28 upstream.

We used to calculate page address differently in 2 cases:

1. In virt_to_page(x) we do
 --->8---
 mem_map + (x - CONFIG_LINUX_LINK_BASE) >> PAGE_SHIFT
 --->8---

2. In in pte_page(x) we do
 --->8---
 mem_map + (pte_val(x) - PAGE_OFFSET) >> PAGE_SHIFT
 --->8---

That leads to problems in case PAGE_OFFSET != CONFIG_LINUX_LINK_BASE -
different pages will be selected depending on where and how we calculate
page address.

In particular in the STAR 9000853582 when gdb attempted to read memory
of another process it got improper page in get_user_pages() because this
is exactly one of the places where we search for a page by pte_page().

The fix is trivial - we need to calculate page address similarly in both
cases.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-03-02 15:04:21 +00:00
..
boot ARC: [nsimosci] move peripherals to match model to FPGA 2015-01-15 10:44:08 +00:00
configs ARC: [nsimosci] Unbork console 2014-04-05 18:36:51 +05:30
include ARC: fix page address calculation if PAGE_OFFSET != LINUX_LINK_BASE 2015-03-02 15:04:21 +00:00
kernel ARC: [SMP] Fix IPI IRQ registration 2014-06-26 11:58:25 +05:30
lib ARC: switch to generic ENTRY/END assembler annotations 2014-03-26 14:31:28 +05:30
mm arc: mm: Fix build failure 2015-02-04 10:58:32 +00:00
oprofile ARC: OProfile support 2013-02-15 23:16:00 +05:30
plat-arcfpga ARC: [arcfpga] Early ARC UART to be only activated by cmdline 2014-06-03 14:20:09 +05:30
plat-tb10x ARC: [TB10x] Updates for GPIO and pinctrl 2013-11-11 09:57:44 +05:30
Kbuild ARC: Build system: Makefiles, Kconfig, Linker script 2013-02-11 20:00:25 +05:30
Kconfig Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP 2014-04-07 16:36:11 -07:00
Kconfig.debug consolidate per-arch stack overflow debugging options 2013-07-04 11:25:39 -07:00
Makefile ARC: Adjustments for gcc 4.8 2013-06-27 14:35:32 +05:30