From patchwork Thu Mar 1 17:07:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10252047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BE43C60211 for ; Thu, 1 Mar 2018 17:07:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF3D7283C8 for ; Thu, 1 Mar 2018 17:07:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A407B28408; Thu, 1 Mar 2018 17:07:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A41CA283F9 for ; Thu, 1 Mar 2018 17:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=kGeCKfcEYURmTSDpNyj+Ee3pLJFMxUumaUYjIKQbrOQ=; b=CXz E3++IXDn1kUtmxm4SuPq1qiBZpukpm1X1TUfsG8jjlpv5IY1PCft3+rz2jCrO9KJeMr5KjyPkWb/e QgTiAs2IcKQkgy2/ygc3/lg2jv34ZQfTBU7KdSiGYmhXtdskeXO37VT22CqU0HnO9vDHHQkEawmyd apGxcnq84i+4923Dt9rR0wsnTaYHEt3KFfH5UYREXL4PyK72NKGgeht9L4Rc09+HyWtTxLR11bpIm /rYk5G4YaTiU6T92piuHOu5bqxIewQdwzzeF0Ij3f4R+BjpBQvbF6WdzYKzPrenigRwxkKvs1zXzr I3WQBEMh9IeyPBFP17lvYG4eeeOT1Mw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1erRgD-0008Nc-8X; Thu, 01 Mar 2018 17:07:41 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erRgA-0008KV-6b for linux-arm-kernel@lists.infradead.org; Thu, 01 Mar 2018 17:07:39 +0000 Received: by mail-wm0-x244.google.com with SMTP id w128so13596653wmw.0 for ; Thu, 01 Mar 2018 09:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=q1ztkgVvR4avresPFcx/o/nvrhVBHz7aDwa6aC67Y3Y=; b=JUYdcfcS+JgocjTb1xOz9dRZDKL3wYF6h7Dw3oKF+8Ztbtb4PGgZMcfg2L6WVzauDf IBc1pAQtadiGZxJ/08vR/s75mO6acEN7lfJOdKmHzAv9sQ8SnfWawaKDrh2mTHkDXxLa cMuZYvrP0B+qUT2zoIeHmXAtOQvkm8RUindadlocfZwxHdz21abzoVBZ/iDEg31BYGsy hLh4OCwlrFCyrRy1e3hMiaPoLHbWdAZzR85OMgWLG8U8bUtiXu9+H5zsag7p8TjkSJeb If/aqJ/sT4lqOm07/BUu6rbLUXdP+rRJQTnuqSRbJF8Ml8ApfRhISPXSWD0wy7ue3TWz Ymfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=q1ztkgVvR4avresPFcx/o/nvrhVBHz7aDwa6aC67Y3Y=; b=AmBL90lJcufFEkedpIweQL3ODrTYQgw1Xy40sCVxcSHxNT2SBvgCu249QQC2XurMCg 6sOovj+39tokRAxKaAy54lBPRmduu57o93AFvCw8SSSUA3R3L9lRDzOwST/K4zRL3W0P NXAlX7S0RGxHDFD4ucn4uuIfPxwBzpsed1o171RJBrME5+L/J8VxwEHO+vLcCO1PvGJN OyyndFdiMAc3bQcH8IbzYF42dDzgarA1i4B+FqSLH5h3mXTZz20llBK6WbvjODEyxMIV JRsi1f61PWX9Gmk1U9eJUDNDmlzZLqqKS6aRLhx3l13tUaVHLVjUDNEbC28llQlVoFk4 BxRg== X-Gm-Message-State: APf1xPCGryC3MBhVenXuGJm04N+TcZwb0kIJ9fN4TVyQysHSYGKQSAl0 9/QKKJtrcHAovnzpAC/5ia0Dhg== X-Google-Smtp-Source: AG47ELuFRc3GCARtUaW//N3W0hwIzhfJ+PJ8z4Icdlc0zQeHda762WQ20K1Fz3Ro1YNx5WHiqIl0xg== X-Received: by 10.28.146.19 with SMTP id u19mr2340749wmd.67.1519924043262; Thu, 01 Mar 2018 09:07:23 -0800 (PST) Received: from andreyknvl0.muc.corp.google.com ([2a00:79e0:15:10:84be:a42a:826d:c530]) by smtp.gmail.com with ESMTPSA id v75sm10687382wrb.76.2018.03.01.09.07.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 09:07:22 -0800 (PST) From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org Subject: [PATCH] kasan, arm64: clean up KASAN_SHADOW_SCALE_SHIFT usage Date: Thu, 1 Mar 2018 18:07:12 +0100 Message-Id: <44281e784702443f06edb837ec672984783a9621.1519923749.git.andreyknvl@google.com> X-Mailer: git-send-email 2.16.2.395.g2e18187dfd-goog X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180301_090738_336851_27FB9A04 X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kostya Serebryany , Andrey Konovalov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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