From patchwork Tue Nov 10 22:10:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11895633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFD7BC388F7 for ; Tue, 10 Nov 2020 22:19:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6279920674 for ; Tue, 10 Nov 2020 22:19:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ueXw4w7a"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="i5hBOh9R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6279920674 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uDA07agM3l31j6d8s8ld3P21kMUBEt31hNIlBFSiEbY=; b=ueXw4w7auImRcHd+GVKro3mG0 g8EWw5ksQbd3NjXAS49AAIaeZMB4FWggTpsLGwQdWR2hBy7PJukAH/ewiYUWIvmGWqzmxR8esbJXF Qo7KWDxfy5Ey0Lp5TJivpyUZgmFgucOTqKhxMdsbsp8d5xteLCMWODL2f0eXbQKMJ8rT8uH1iRBOF cO+zAFNuc7pE6Ykb2MwSRKzcUApOq4PXvIGZQLAEnf5KqWQ4LTKaZt0R5WUmPjuskdYp/tVjrZZ/X X5KDiXfIAv6yFBhPhwITyt5RtrHalWYB4okju37rVzjeM+QcOPqcdr1LbnsittV89riOh6mLGRIMS YO/m/X6ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcbxZ-0007LS-Ik; Tue, 10 Nov 2020 22:17:53 +0000 Received: from mail-wm1-x349.google.com ([2a00:1450:4864:20::349]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcbrl-0004hm-Ko for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 22:12:09 +0000 Received: by mail-wm1-x349.google.com with SMTP id z62so1668291wmb.1 for ; Tue, 10 Nov 2020 14:11:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=maJnPTI34+iFP5D0D1ra1sKb6Wkh8ktrMcPMtIoOl2Q=; b=i5hBOh9RkG0NtBiLauin8+U0dnodhBJY++QuqVmxbih6qE9QzKnp6MXv0elOa0QnuX VDbcr97hYxf/vU+BCk17vxtvkWYjYD8zZu1jwsip3U20sLvrNqE+M4hQPJy4s5Kh31l8 9wBCLsU4SmoSw+d29LSCt53rPGQpPKi4CGfzNjuppNE7uzsAGMFQE0vZpTdStndvgDhI JmsHjSrckmBSvQHDcePh+33XCoaOAkiB5d0/8HURKy6EK2rEuUu7WRdyYL/swmbX5DZA Q+yC/ivCwdQIl4aztcvyrl8WhNdxVqFJvIzPERyFgvzrFjMRIn0SKWgGkejs89HLI3Te 4QMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=maJnPTI34+iFP5D0D1ra1sKb6Wkh8ktrMcPMtIoOl2Q=; b=s3+YLxwZCNTQPdThwNJJSiJkHGHfWkgEMqTcQtNJ/Fz4p1oiFSDIaShwCtSJXGV9oF dERyunLhNqjZu0DGiGh3t4F8U1ILR1Rb3VpvhlGK7h0ITIwPyjeWoJTqLapZU4dyggS+ nH8R2tQmKT4ebTXcyhVqTs1GP9aLZ6Wl7LwbSV6LeFe20cHuB6K3I57hMGmrt/3Qpek2 Ybsaxtwc6cpv0ukniqIlszbMhlatsk+QPFiqPNmGMoMuWqWdxbF3AZH2xgE8f2NrDHhd ip3rk7O9xywp2MrILbRevJObrQJaVXuT/vm7uCkKmdVM5/R6fa/TmHTRrrL3Nadhl1ku meQg== X-Gm-Message-State: AOAM530uP8bEoJi8yivl7qzL4iJiet8OSBnVAyIuuqB626A5gBvFN02q o4WogUizhB8xIzlEbj6kwATDnaJMYH+mTd9y X-Google-Smtp-Source: ABdhPJwcMGz9zwbkoIRH1a0Dxk0KI24yjcGI7yTmRvVHKglY5hkpLZW8pr+zYMwpADzqKzZ42BXHL3lqGq8ZwOhj X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:adf:f7c7:: with SMTP id a7mr7030672wrq.347.1605046309488; Tue, 10 Nov 2020 14:11:49 -0800 (PST) Date: Tue, 10 Nov 2020 23:10:15 +0100 In-Reply-To: Message-Id: <8b8345f75fa75638328d684b826b1118e2649e30.1605046192.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH v9 18/44] kasan, arm64: rename kasan_init_tags and mark as __init From: Andrey Konovalov To: Catalin Marinas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_171153_778125_5793A321 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Marco Elver , Andrey Konovalov , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rename kasan_init_tags() to kasan_init_sw_tags() as the upcoming hardware tag-based KASAN mode will have its own initialization routine. Also similarly to kasan_init() mark kasan_init_tags() as __init. Signed-off-by: Andrey Konovalov Reviewed-by: Catalin Marinas Reviewed-by: Alexander Potapenko --- Change-Id: I99aa2f7115d38a34ed85b329dadab6c7d6952416 --- arch/arm64/kernel/setup.c | 2 +- arch/arm64/mm/kasan_init.c | 2 +- include/linux/kasan.h | 4 ++-- mm/kasan/sw_tags.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 133257ffd859..bb79b09f73c8 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -358,7 +358,7 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p) smp_build_mpidr_hash(); /* Init percpu seeds for random tags after cpus are set up. */ - kasan_init_tags(); + kasan_init_sw_tags(); #ifdef CONFIG_ARM64_SW_TTBR0_PAN /* diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c index e35ce04beed1..d8e66c78440e 100644 --- a/arch/arm64/mm/kasan_init.c +++ b/arch/arm64/mm/kasan_init.c @@ -283,7 +283,7 @@ void __init kasan_init(void) kasan_init_shadow(); kasan_init_depth(); #if defined(CONFIG_KASAN_GENERIC) - /* CONFIG_KASAN_SW_TAGS also requires kasan_init_tags(). */ + /* CONFIG_KASAN_SW_TAGS also requires kasan_init_sw_tags(). */ pr_info("KernelAddressSanitizer initialized\n"); #endif } diff --git a/include/linux/kasan.h b/include/linux/kasan.h index 979d598e1c30..1d6ec3325163 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -191,7 +191,7 @@ static inline void kasan_record_aux_stack(void *ptr) {} #ifdef CONFIG_KASAN_SW_TAGS -void kasan_init_tags(void); +void __init kasan_init_sw_tags(void); void *kasan_reset_tag(const void *addr); @@ -200,7 +200,7 @@ bool kasan_report(unsigned long addr, size_t size, #else /* CONFIG_KASAN_SW_TAGS */ -static inline void kasan_init_tags(void) { } +static inline void kasan_init_sw_tags(void) { } static inline void *kasan_reset_tag(const void *addr) { diff --git a/mm/kasan/sw_tags.c b/mm/kasan/sw_tags.c index d25f8641b7cd..b09a2c06abad 100644 --- a/mm/kasan/sw_tags.c +++ b/mm/kasan/sw_tags.c @@ -35,7 +35,7 @@ static DEFINE_PER_CPU(u32, prng_state); -void kasan_init_tags(void) +void __init kasan_init_sw_tags(void) { int cpu;