linux-stable/arch
Serge Semin 2d433cc9bd mips: Make sure dt memory regions are valid
[ Upstream commit 93fa5b2807 ]

There are situations when memory regions coming from dts may be
too big for the platform physical address space. This especially
concerns XPA-capable systems. Bootloader may determine more than 4GB
memory available and pass it to the kernel over dts memory node, while
kernel is built without XPA/64BIT support. In this case the region
may either simply be truncated by add_memory_region() method
or by u64->phys_addr_t type casting. But in worst case the method
can even drop the memory region if it exceeds PHYS_ADDR_MAX size.
So lets make sure the retrieved from dts memory regions are valid,
and if some of them aren't, just manually truncate them with a warning
printed out.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Serge Semin <Sergey.Semin@t-platforms.ru>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-15 11:54:05 +02:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:25:47 +01:00
arc arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM 2019-04-20 09:15:54 +02:00
arm ARM: prevent tracing IPI_CPU_BACKTRACE 2019-06-15 11:54:00 +02:00
arm64 arm64: Fix the arm64_personality() syscall wrapper redirection 2019-06-09 09:17:20 +02:00
c6x kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:32:55 +02:00
hexagon hexagon: modify ffs() and fls() to return int 2018-09-10 19:42:15 -05:00
ia64 ia64: Fix allnoconfig section mismatch for ioc_init/ioc_iommu_info 2018-08-22 14:12:47 -07:00
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 20:10:00 +01:00
microblaze mm: make the __PAGETABLE_PxD_FOLDED defines non-empty 2018-12-29 13:37:57 +01:00
mips mips: Make sure dt memory regions are valid 2019-06-15 11:54:05 +02:00
nds32 nds32: Fix gcc 8.0 compiler option incompatible. 2019-02-12 19:46:57 +01:00
nios2 nios2: kconfig: remove duplicate DEBUG_STACK_USAGE symbol defintions 2018-08-27 09:47:20 +08:00
openrisc OpenRISC updates for 4.19 2018-08-23 14:09:37 -07:00
parisc parisc: Rename LEVEL to PA_ASM_LEVEL to avoid name clash with DRBD code 2019-05-25 18:23:24 +02:00
powerpc pstore: Convert buf_lock to semaphore 2019-06-11 12:20:52 +02:00
riscv riscv: fix accessing 8-byte variable from RV32 2019-05-08 07:21:47 +02:00
s390 s390/mm: fix address space detection in exception handling 2019-06-11 12:20:53 +02:00
sh sh: sh7786: Add explicit I/O cast to sh7786_mm_sel() 2019-05-31 06:46:28 -07:00
sparc sparc64: Fix regression in non-hypervisor TLB flush xcall 2019-06-09 09:17:10 +02:00
um uml: fix a boot splat wrt use of cpu_all_mask 2019-06-15 11:54:05 +02:00
unicore32 mm: convert return type of handle_mm_fault() caller to vm_fault_t 2018-08-17 16:20:28 -07:00
x86 perf/x86/intel: Allow PEBS multi-entry in watermark mode 2019-06-15 11:54:03 +02:00
xtensa xtensa: fix return_address 2019-04-17 08:38:53 +02:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00