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: 11895541 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A6EA138B for ; Tue, 10 Nov 2020 22:11:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BAFE720781 for ; Tue, 10 Nov 2020 22:11:53 +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="i5hBOh9R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAFE720781 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 F1B476B009F; Tue, 10 Nov 2020 17:11:51 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EA9236B00A0; Tue, 10 Nov 2020 17:11:51 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF8966B00A1; Tue, 10 Nov 2020 17:11:51 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id 9B0986B009F for ; Tue, 10 Nov 2020 17:11:51 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4BC20181AEF1A for ; Tue, 10 Nov 2020 22:11:51 +0000 (UTC) X-FDA: 77469906822.10.corn34_2e04179272f8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 2CFF516A0AB for ; Tue, 10 Nov 2020 22:11:51 +0000 (UTC) X-Spam-Summary: 1,0,0,1cbf03d392b87f8f,d41d8cd98f00b204,3jrcrxwokcpqwjznaugjrhckkcha.ykihejqt-iigrwyg.knc@flex--andreyknvl.bounces.google.com,,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1313:1314:1345:1359:1431:1437:1516:1518:1535:1542:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2559:2562:2693:3138:3139:3140:3141:3142:3152:3353:3865:3867:4250:4321:4605:5007:6261:6653:6742:8603:8957:9969:10004:10400:11026:11232:11473:11657:11658:11914:12043:12297:12438:12555:12895:12986:14096:14097:14181:14394:14659:14721:21080:21365:21444:21451:21627:30054,0,RBL:209.85.221.73:@flex--andreyknvl.bounces.google.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04yge54ff15objt5wjgndxwftnagmyphfwrfzs43obhqfeqeqk3gnpsg6539ij1.w1kzke59c16n97c6zwzp9op3kcuc63yrnsm5tgwe3k3npep83qkhfxh7ermanur.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:72,LUA_SUMMARY:none X-HE-Tag: corn34_2e04179272f8 X-Filterd-Recvd-Size: 5888 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 22:11:50 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id r16so6151836wrw.22 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=Xj4rvnS+Wa2P9rqjQagxOtV3G1xNdYoFTdr6higaiOXi4V+jMs+71mZrfRrGZ2AWAW euko+z/vr7dMFsAMoxlmAPjI4FztSH1Vip/l62mECQKVPrBNBTLXP723Rdpe9A5Yl6Am wxLGkcLj3UN9mQgDzR/AH+hp8IgKppTSpafu1VoUSZKnuc+E7oLQGEqHkg3U/REo66Fg uWtLxUSn09s9Np+5t6EAY5ATV1MTgNekLNzcJxyDYd8icvKkRyfREIs5JR4BAwec/Jmr hNFmzdmrAHS+4XjoLKgQccBqsSqWXgiLvy8o57cN2gxmklVRQocOqw1yzFOiNt5Ajlld VP0A== X-Gm-Message-State: AOAM530Syer5QmANF6PlI4t/tVckesZug4msZ7m77NoPodNcryX8sFSJ eAe9ppfrbFuqxrhpHQTRxrQ+4RO5qTemrvdd 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 Cc: Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Andrew Morton , 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 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;