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: 11926391 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.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 52684C64E90 for ; Mon, 23 Nov 2020 20:09:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0CE92071E for ; Mon, 23 Nov 2020 20:09:03 +0000 (UTC) Authentication-Results: mail.kernel.org; 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 D0CE92071E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 59F236B00A0; Mon, 23 Nov 2020 15:09:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 552476B00A2; Mon, 23 Nov 2020 15:09:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 352076B00A1; Mon, 23 Nov 2020 15:09:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by kanga.kvack.org (Postfix) with ESMTP id 00CE16B009F for ; Mon, 23 Nov 2020 15:09:00 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9562C82499B9 for ; Mon, 23 Nov 2020 20:09:00 +0000 (UTC) X-FDA: 77516771640.15.pies22_3912fae27368 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 6BFBD1814B0C7 for ; Mon, 23 Nov 2020 20:09:00 +0000 (UTC) X-HE-Tag: pies22_3912fae27368 X-Filterd-Recvd-Size: 5948 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Nov 2020 20:08:59 +0000 (UTC) Received: by mail-qk1-f201.google.com with SMTP id c71so15458335qkg.21 for ; Mon, 23 Nov 2020 12:08:59 -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=GCQvdKn4z+HmZXo08Hq/ZpQ+fsis9dXfVFf/bDDP9Np8YyI0zgBnLx2rNYQc4TBppN BmNfKy/iEuZd2gwqublGB0yy3rqJ7AQ3N+VVd7eVtNpMxSglYqKMFPQzsEmQk7zyFQ7l sJvKS0l0jmr2+YkUvGu68ihFBMV57a8+al5NlFLd00uBtfQKJEXWJU9Hi/4nkgJmYwO7 LoWX0wdn7oC6kxkH8QpdMJk5MHgrmlq1esZOEgCJi4NZDhe4C1DlWqyqNbhr0wzAX9hX +Bw1JMmhbTYGqHxkiwrvcQZ/0gxyxcflMmol1nONo6ZrP/xEPFjMoSnzd+rmoe12fI0c VTog== X-Gm-Message-State: AOAM531RngD2Nb79EQD5gjtgMTRUaq60jkj9GJqynSm5K/G42sMONjB8 3n/6d/jZZ3mAjvadpYMbyxgqbbEzMHmDHDct 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 Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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;