From patchwork Wed Nov 4 23:18:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11883239 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 76261C00A89 for ; Thu, 5 Nov 2020 05:02:39 +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 DA1ED2083B for ; Thu, 5 Nov 2020 05:02:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FqSCLuE1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Gsm+2gvZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="KrghbXMM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA1ED2083B 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=X+vRNKag6WoeriqWlZicHF4JSU2Iu46N9/gy6nThQeU=; b=FqSCLuE1XkqfNENdSxdzuEu3i trh5VKjB9V7WghE7bmjBXV6eq5EheS3Rf3AY7YXtXjxIzD7nV1+PKvUQoj0Ka8Ein3X1inoxK4b75 olQiX23N42YqoU4RODfTRm69uk2ffrV6zPqDU+Cpq+s7sJ+wrCOT2bfALGYCsepVhIxX3aE04VjON uhGfR4FoPttsZaURZiO8fl9ABP3b2GIPS57nXbwYlI8Xy/t52ESS+l7yGYhsceXiXeCXnVlXEVwnJ 341R6uebCepb9NpENAhD1DnvN+xhWBuLt8n2ep+nMHlnYhC/GXD4DAkFFAqK+nzQNH9oqxVQLhCpu 7rqUo0BlA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaXOP-0002rc-TP; Thu, 05 Nov 2020 05:01:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaW5F-000145-PM for linux-arm-kernel@merlin.infradead.org; Thu, 05 Nov 2020 03:37:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ojj9e6SeGShn+CqBq2chujClVFvSwMkEAD8uQAmerxw=; b=Gsm+2gvZnj9mZMIbpu+ta1D/EV mOjAHfKVrn7lQZ5DUQ7tKLqv6dXHBgNYq0Gtxz+4MxPDtekxAb8L1+Rpm1JPIHf0ofj20fkorUzSa 6uIpp9ETEZOJn27k2UXk/EY1gnXFri/HRqeANAKg87N6gSgQLD1ZLpDg8V0L9DBItkQNMOVdAsAlB pcX5gqToD0ik80XOQrPkghfiUP/oviF6dEZhY/hr+VG0UZ+CrCbJmlL+8eqIiRyJ9MujbeR660HGc 6ZgsP1j5GgUjAeZ2UUfeZJ74mh5jR4eLXcnQY0/zggQYTSZGCBOygkRXs9pXAjw6ywx03U/o9Ejvm HOKjzRxA==; Received: from mail-wr1-x44a.google.com ([2a00:1450:4864:20::44a]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaS5D-00042I-EX for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 23:20:53 +0000 Received: by mail-wr1-x44a.google.com with SMTP id p12so50015wrx.3 for ; Wed, 04 Nov 2020 15:20:51 -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=ojj9e6SeGShn+CqBq2chujClVFvSwMkEAD8uQAmerxw=; b=KrghbXMM9I87gk5nyKwP68q9D7JmfiGJWPyvcuRP5JhQi4zKJv4x/OQdNK899VZfqz Fl3FdIrNm1+pH2z8nU+0yU3a/m6zzFixZuFzq6Ywp5d02Hxu0YgaCRAnpHe0fyQB5FWy Y/c14XQNtkxh2iATLUSfgdZbaMz+vZbXVmuVrnh2nnpAp0+1STVxyz2Sh98bhr7b1BQK eQjjVuaipiQJIrrByCMPsXUnMpNmFY7tjmF5Na/ENvCa0ba0B6jimHGctfbj5rZWXnd/ xf/7tvFqBWanQqEH6Ns0LXEVcMlySnqa2XGWIs5Ifyr1zCKgYpbS7BOFRlscFme4BgmJ gsNA== 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=ojj9e6SeGShn+CqBq2chujClVFvSwMkEAD8uQAmerxw=; b=Z+D5JyinqoAERtVj/Mvg8XiRk7gtd7PGOhxbme1WNZT6mGt+lSXtcx+0apytRagDcc bu5iQJWLnwajocrh01/nDs7XxwCIx5H7lyiGVmYbTqBZ2lyiyAjVmuTLxXPtY6KkUp+8 UtdHU/vxUT9Ct+rxTSSys6PoaMZJ1U1TAqXgq/UOZBh1r86gRVT1gyANexE+auoQRueO dHWxf3QO4kBSlDC+8IJDrZIviyAS5zJ0RonogsLr8huAiX/0j2HWMcH3+BsaKVI5f8qL cJzcc5W8kg/AaN+HH9OEQpNKbqPu8vBZ/GLJqQ8LUHfxEGXJkV/Opy1pSjqr29DmA/72 jyxQ== X-Gm-Message-State: AOAM531P4Jbsp4DM2GvxHSO5Y8L4mBVq9byoTBp+4A0uboYhGMJBzOiS Nq9UvNGyJL52QZdS2eTnDJPnlV+t3rkhr8B8 X-Google-Smtp-Source: ABdhPJz4Hbrh3Ua4QZ0IndrRDGnYifiicCuVPdjCPO/4LNGbo3KP+1XW2gBoZ6BhFx5g1YdGjEGB1Urre7hAN5qv X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a1c:e903:: with SMTP id q3mr97119wmc.42.1604531990350; Wed, 04 Nov 2020 15:19:50 -0800 (PST) Date: Thu, 5 Nov 2020 00:18:33 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v8 18/43] 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-20201104_232051_687176_260CA5F4 X-CRM114-Status: GOOD ( 13.77 ) 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 --- 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 8d3d3c21340d..32b9d283e0a0 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -189,7 +189,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); @@ -198,7 +198,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;