From patchwork Tue Nov 17 14:58:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 7637841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D805FBF90C for ; Tue, 17 Nov 2015 15:02:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F032D20148 for ; Tue, 17 Nov 2015 15:02:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DE4F020115 for ; Tue, 17 Nov 2015 15:02:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyhk5-0006Bb-2E; Tue, 17 Nov 2015 15:00:21 +0000 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyhiz-0003d5-Tz for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 14:59:18 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-4-slCGmSRwTa68YEKrlTa5mA-1; Tue, 17 Nov 2015 14:58:48 +0000 Received: from [10.1.209.128] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Nov 2015 14:58:47 +0000 Subject: Re: [PATCH v7 0/4] KASAN for arm64 To: Andrey Ryabinin References: <1444665180-301-1-git-send-email-ryabinin.a.a@gmail.com> <20151013083432.GG6320@e104818-lin.cambridge.arm.com> <5649BAFD.6030005@arm.com> <5649F783.40109@gmail.com> From: "Suzuki K. Poulose" Message-ID: <564B40A7.1000206@arm.com> Date: Tue, 17 Nov 2015 14:58:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <5649F783.40109@gmail.com> X-OriginalArrivalTime: 17 Nov 2015 14:58:47.0753 (UTC) FILETIME=[765B9390:01D12148] X-MC-Unique: slCGmSRwTa68YEKrlTa5mA-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_065914_797445_300171BD X-CRM114-Status: GOOD ( 11.67 ) X-Spam-Score: -4.2 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yury , Arnd Bergmann , linux-mm@kvack.org, Catalin Marinas , Linus Walleij , Ard Biesheuvel , Will Deacon , linux-kernel@vger.kernel.org, kasan-dev , Alexey Klimov , Alexander Potapenko , Dmitry Vyukov , Andrey Konovalov , David Keitel , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 16/11/15 15:34, Andrey Ryabinin wrote: > On 11/16/2015 02:16 PM, Suzuki K. Poulose wrote: >> On 13/10/15 09:34, Catalin Marinas wrote: >>> On Mon, Oct 12, 2015 at 06:52:56PM +0300, Andrey Ryabinin wrote: >> Hi, >> >> I get the following failure with KASAN + 16K_PAGES + 48BIT_VA, with 4.4-rc1: >> >> >> arch/arm64/mm/kasan_init.c: In function ‘kasan_early_init’: >> include/linux/compiler.h:484:38: error: call to ‘__compiletime_assert_95’ declared with attribute error: BUILD_BUG_ON failed: !IS_ALIGNED(KASAN_SHADOW_END, PGDIR_SIZE) >> _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) >> ^ ... > > Yes, it's really needed, because some code relies on this (e.g. clear_pgs() and kasan_init()). > But it should be possible to get rid of this requirement. And the other important point I missed mentioning was that, my tool chain doesn't support KASAN. But still the KASAN support files are still compiled and generates the above error. Shouldn't we disable it at build time if we detect that compiler doesn't support it ? Something like we do for LSE_ATOMICS. commit c09d6a04d17d730b0463207a26ece082772b59ee Author: Will Deacon Date: Tue Feb 3 16:14:13 2015 +0000 arm64: atomics: patch in lse instructions when supported by the CPU On CPUs which support the LSE atomic instructions introduced in ARMv8.1, it makes sense to use them in preference to ll/sc sequences. ... Thanks Suzuki diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 0953a97..15ff5b4 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -17,7 +17,18 @@ GZFLAGS :=-9 KBUILD_DEFCONFIG := defconfig -KBUILD_CFLAGS += -mgeneral-regs-only +# Check for binutils support for specific extensions +lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1) + +ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y) + ifeq ($(lseinstr),) +$(warning LSE atomics not supported by binutils) + endif +endif + +KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) +KBUILD_AFLAGS += $(lseinstr) +