linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kasan, arm64: clean up KASAN_SHADOW_SCALE_SHIFT usage
@ 2018-03-01 17:07 Andrey Konovalov
  2018-03-05 12:16 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Konovalov @ 2018-03-01 17:07 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Andrey Ryabinin,
	Alexander Potapenko, Dmitry Vyukov, linux-arm-kernel,
	linux-kernel, kasan-dev, linux-mm
  Cc: Kostya Serebryany, Andrey Konovalov

This is a follow up patch to the series I sent recently that cleans up
KASAN_SHADOW_SCALE_SHIFT usage (which value was hardcoded and scattered
all over the code). This fixes the one place that I forgot to fix.

The change is purely aesthetical, instead of hardcoding the value for
KASAN_SHADOW_SCALE_SHIFT in arch/arm64/Makefile, an appropriate variable
is declared and used.

Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
---
 arch/arm64/Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index b481b4a7c011..4bb18aee4846 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -97,12 +97,14 @@ else
 TEXT_OFFSET := 0x00080000
 endif
 
-# KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
+# KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - KASAN_SHADOW_SCALE_SHIFT))
+#				 - (1 << (64 - KASAN_SHADOW_SCALE_SHIFT))
 # in 32-bit arithmetic
+KASAN_SHADOW_SCALE_SHIFT := 3
 KASAN_SHADOW_OFFSET := $(shell printf "0x%08x00000000\n" $$(( \
-			(0xffffffff & (-1 << ($(CONFIG_ARM64_VA_BITS) - 32))) \
-			+ (1 << ($(CONFIG_ARM64_VA_BITS) - 32 - 3)) \
-			- (1 << (64 - 32 - 3)) )) )
+	(0xffffffff & (-1 << ($(CONFIG_ARM64_VA_BITS) - 32))) \
+	+ (1 << ($(CONFIG_ARM64_VA_BITS) - 32 - $(KASAN_SHADOW_SCALE_SHIFT))) \
+	- (1 << (64 - 32 - $(KASAN_SHADOW_SCALE_SHIFT))) )) )
 
 export	TEXT_OFFSET GZFLAGS
 
-- 
2.16.2.395.g2e18187dfd-goog

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kasan, arm64: clean up KASAN_SHADOW_SCALE_SHIFT usage
  2018-03-01 17:07 [PATCH] kasan, arm64: clean up KASAN_SHADOW_SCALE_SHIFT usage Andrey Konovalov
@ 2018-03-05 12:16 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2018-03-05 12:16 UTC (permalink / raw)
  To: Andrey Konovalov
  Cc: Catalin Marinas, Andrey Ryabinin, Alexander Potapenko,
	Dmitry Vyukov, linux-arm-kernel, linux-kernel, kasan-dev,
	linux-mm, Kostya Serebryany

On Thu, Mar 01, 2018 at 06:07:12PM +0100, Andrey Konovalov wrote:
> This is a follow up patch to the series I sent recently that cleans up
> KASAN_SHADOW_SCALE_SHIFT usage (which value was hardcoded and scattered
> all over the code). This fixes the one place that I forgot to fix.
> 
> The change is purely aesthetical, instead of hardcoding the value for
> KASAN_SHADOW_SCALE_SHIFT in arch/arm64/Makefile, an appropriate variable
> is declared and used.

Cheers, I'll pick this up.

Will

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-05 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 17:07 [PATCH] kasan, arm64: clean up KASAN_SHADOW_SCALE_SHIFT usage Andrey Konovalov
2018-03-05 12:16 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).