From patchwork Mon Nov 23 20:07:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11926589 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 4D1EAC2D0E4 for ; Mon, 23 Nov 2020 20:17:00 +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 8EC0420657 for ; Mon, 23 Nov 2020 20:16:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NOXtdY7b"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="srZKa6aH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EC0420657 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=MIvVsDJJyEFbNURf+hY4vvqiXb/uMhKk1OJG7cLfKfY=; b=NOXtdY7b2MY35aX7hY01FY+AL 8if9BDsk/a+vZTxxBb5zBZJ7W1987xK7cHkXqyh++hqGNZa1Fkqu/tf4eeEqsidxlvuna14DtPvbe I6tQ6Fm8UsTRSMThmIpRL/bi2iYQtcZBgqvWQQAfNMMQBqosPkKNNfE6xQIOqT/kbge+bDwgNQr76 lTk5ISMeFIwAP64tV4IKarvLFh0i483HozAkow99xyTm8R2Hs4HDw+HcE54twNWF5eM6Qn0P2RkrN TZDDGVJBEWHyRshuZQWJy7MF/4MxI/QhRGJdh4p/C479XLabTMM3uvJThyTXojqbjWi/6hftdCA8w ow/d47DhQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khIE1-0001jg-7o; Mon, 23 Nov 2020 20:14:13 +0000 Received: from mail-qk1-x749.google.com ([2607:f8b0:4864:20::749]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khI91-00088W-9T for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 20:09:33 +0000 Received: by mail-qk1-x749.google.com with SMTP id b11so5475391qkk.10 for ; Mon, 23 Nov 2020 12:09:00 -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=kG65aVx5WJn/kF7F81b/rehD2S5LbswJneuDpixnu58=; b=srZKa6aHLqZuKptDw843Gpf6CkZm8dA/hocN4dfToqMo5X8OsvEYKl5tsjHLPgc37E XQvyLPqtPSNkha6MG2VccqVuGwDifvfbiSE1EclosaEyCCQ8odpo+OqLN9C5v5tW9gbK FiKBSOio5UAaJlfqg1BJYSn5iw3kmq7U1OxZxW8Sq5ZtRywQEJcyMIryLXgPGMBXAP3j EuEklUtlEZx9luFg41dLWH7GskrwhaclbAo0T7ToeaKRMka02nwSDy/Mf99HCCPbsbaO 9DLT9ytZlHaRWKUuKQAWv0BfaRWxFyZeD3Uw7OaCr3V4Eku5B89A/ztTOS35MeDKQOQ6 EYfQ== 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=kG65aVx5WJn/kF7F81b/rehD2S5LbswJneuDpixnu58=; b=dRnGywDCujA/whrtpcmUdLQURmZ/z8Fy/bkBHenE9oKQwRrvaY+CbWhvXlLqdB2mFB vwj2zfjkbs/eZOALHG7LkCp5Yk48S7fMH+BV/xcFajQsdfLkTQtIFDCuF3X2Kqtyhgwx eM3DRwQGZd7WX8YZjlV5vcDHpK9DsByzTlyRS4XoFYEciObMDKMCWgQqLjYrkRVv4iWs ye0rPou9KOib/UX7vTrddzN5RH8RIFgE7tw4sxMih3nk6RAuMaf8jwfIO92dZgf0kI0D efRgf2h0eZM57vtPrNjt5bzaeAi+lYRGy7XJdtuTcMgQTFCrWFuKfkoMh6ZfMo3nTbjk mnrA== X-Gm-Message-State: AOAM530d9WG0YjErD17pw4F8ks1ufl3XXiej0ctb3QLT5n8vj3Sr/bq0 N2y0Fd73NMqVN4chLyDx1nH/Q3MRIW/Rkx/T X-Google-Smtp-Source: ABdhPJxCad00eZI+YxCwZo4nx7rt4QHv4Zb7t1cqFFmdL3aHDRdQ3jgyZllbuhtEoIpwCLdysHI2kBaa0x5rs/sX X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:ad4:5587:: with SMTP id e7mr1239239qvx.33.1606162139104; Mon, 23 Nov 2020 12:08:59 -0800 (PST) Date: Mon, 23 Nov 2020 21:07:41 +0100 In-Reply-To: Message-Id: <71e52af72a09f4b50c8042f16101c60e50649fbb.1606161801.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH mm v11 17/42] kasan, arm64: rename kasan_init_tags and mark as __init From: Andrey Konovalov To: Andrew Morton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_150903_427985_D82C8143 X-CRM114-Status: GOOD ( 14.75 ) 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 , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Konovalov , Andrey Ryabinin , 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 1a57a76e1cc2..a950d5bc1ba5 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 58567a672c5c..8b8babab852c 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 9445cf4ccdc8..7317d5229b2b 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;