ARM: decompressor: avoid speculative prefetch from protected regions

Currently first 1GB memory mapped with read, write and execute
permissions and unfortunately speculative prefetch causing
undesirable sideffects if those regions are protected.

Hence the flag CONFIG_ARM_DECOMPRESSOR_LIMIT limit the size
of the memory to be mapped by decompressor with read, write
and execute permissions to avoid speculative prefetch.

CRs-Fixed: 677067
Change-Id: I3f2495649153ae16040579b71dff5b78315b29a8
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Chetan C R <cravin@codeaurora.org>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b7b2864..353563e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2175,6 +2175,17 @@
 config EFI_STUB
 	bool
 
+config ARM_DECOMPRESSOR_LIMIT
+        hex "Limit the decompressor memory area"
+        default 0x3200000
+        help
+          Allows overriding of the memory size that decompressor maps with
+          read, write and execute permissions to avoid speculative prefetch.
+
+          By default ARM_DECOMPRESSOR_LIMIT maps first 1GB of memory
+          with read, write and execute permissions and reset of the memory
+          as strongly ordered.
+
 config EFI
 	bool "UEFI runtime support"
 	depends on OF && !CPU_BIG_ENDIAN && MMU && AUTO_ZRELADDR && !XIP_KERNEL