From patchwork Fri Nov 13 22:15:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11905009 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 85206C55ABD for ; Fri, 13 Nov 2020 22:24:49 +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 14A9522255 for ; Fri, 13 Nov 2020 22:24:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jb5SqiDA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="i4IRzr7+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14A9522255 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=MFyMdpQWOvNnIBSb7cxPRwMaaNHfu/LtR2fERdnia9g=; b=jb5SqiDAI2ufFuOCs9WZZoayw BFPFxddj8pSBp/sdUX7AsYNAFlRw323Xq9sNSu8/UfaFJ9OHds6D+yeERYMGKDGxKG+Ite6gfsYy/ iUg+aKlzVnyGxNFys3LcIq9QAqcYjLCz9n0M8F8YTV0BUyGmEe0gdE//KJyyVGZ6Ge7aq+w7tKruz FLBWQ1H4rR66CEJTSbWU8i/Q8rR96LD/L8IC/786ypQQ6JrKI831Z0QqFddsE8cRI6u/fU8Nbk5CM baVebK99zxd5cKGdUVBrmGBtcI6srZuW9jwpZEErIJWEzitdgwjon1un60zunPJOH9o9ScDJfsALx oZApYGBzg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdhUD-00037b-Gl; Fri, 13 Nov 2020 22:24:05 +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 1kdhNL-000062-Bd for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 22:17:22 +0000 Received: by mail-wm1-x349.google.com with SMTP id a134so3991385wmd.8 for ; Fri, 13 Nov 2020 14:16:56 -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=AllKQJimzn7hLgi4RPYa1jCIh9marG6fXAU7bboN0mo=; b=i4IRzr7+/eoQ+lnOGtTQBdgWb0fu4qQkB84Tq9FFV9rbuaL+X/H6CRSgpdHesjdSVb Pz9YHO9ZH9NU1SRYhQkZfRsdqoXyHbKk8tQihGE6SOyzKDQGPHfHATaMl9qStufrRUXw vhIYdeeoG0sJwGl9GbDxi64sp1bCNfn9Q+XUcCZV8srHJ4ThQ4brshPp/aoL+iz0nT40 lvWuDWVE317WTnn4s/i/xxHldZIGVC1mtM3sGVscptrrHQI9Jl3dnhnv5Gofe7t+vo// SKp7T0eyyilA7jlo09AsI8TXoNBFcXtA5J5w9jV4PdDb8sXJHO4H9/fQH6BVEWRCIKuh UB5A== 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=AllKQJimzn7hLgi4RPYa1jCIh9marG6fXAU7bboN0mo=; b=MzDTue/GtkPKKUUg0fm5JnmTLZT5fs8av6On/49gRfN0MBC7fp4AnHIXSr6HpowB1I fhaKHQyse3+ClF0nw0VWcjggsjtjHK/n4dRobJVZ4itROf3mBytnh05fDbDRndsReM+G kPCgJqTOLK+aaJ/c9ZQv8H2R1X7yEe+AhPpE2FI3MXYtisaMfzGmVCcie1rjY/Tq0Rnb G1JMRC8EyY0BmiWixxyaUoyfJabX8hh4KlbBGCDqDrD1Iv8TkGZGvYh3BmiyGOYO6fgy tIWToM2X+GCO+BIoPVre8+RZkt4qZPXr37vk4ojB5ICzlhHoDLH5fDhfZ5SAjx4BO5fq QJ+A== X-Gm-Message-State: AOAM530EAVRNqY0VknwxzHoCfAXowY+88Q0rn29+T6ucdWYyc0s7kxaD 4beR6D/7AoHCMstARkjgRYkpXWQIbKur6Ftr X-Google-Smtp-Source: ABdhPJzRByF66A4BSINBX5iVs8nBcZqNdrZ7mZgwx23OUF+TjKT+gN+fxNUfxlwF0dexd6eOGTxMCgHz5JLrJA8G X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a5d:6a0b:: with SMTP id m11mr5863665wru.190.1605305815704; Fri, 13 Nov 2020 14:16:55 -0800 (PST) Date: Fri, 13 Nov 2020 23:15:45 +0100 In-Reply-To: Message-Id: <6182fdbdc372e9e4888cc7b73c47f85d21d1827f.1605305705.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.299.gdc1121823c-goog Subject: [PATCH mm v10 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-20201113_171659_623668_5B6C307F X-CRM114-Status: GOOD ( 14.38 ) 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 c28a9ec76b11..75e511211eb4 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;