Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3543067pxb; Mon, 24 Jan 2022 11:50:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwV7zC5vYgVBhA1/55g/2CBACJKQYut5x4jg03/+GuWoHcCkr6MR8oH8ucESQcCdUfaD5J4 X-Received: by 2002:a63:8241:: with SMTP id w62mr1708406pgd.612.1643053833619; Mon, 24 Jan 2022 11:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053833; cv=none; d=google.com; s=arc-20160816; b=0PYNxVw8n+CP0hAoTdzgUR2PIOpy2yM1juSl/5IM/73Fo8Wnf9XdCtJko2QA0R07/Z Kdh7VOko+Tj9JemWSRE4KKFrQM0TAD2c6I9wdMjdI7LzQVZq9hqoD8+zQO3QQ4InuDxa b+2X09CAKsNGFVHKN1WMJR4urIse5XjjNzVtNp7oh/C/PzWzGi77kqYbysHy73xZLqrC qHT0/PEPtVQIO5lBbEZnpvLClfq2ejQGvZR2y8iexpxL8BkXUUE9kMnapEF2tZFDw5Ty jmm3bEoeiSnfeLBfC6v90fPdvX0c9cwIsLnY5v+54uSlETgv2rmCxENRDuDh2igW2wtk sDIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=woHyASpRd1dsSk1k8aXjCDxvW5sGTzgveGosFVStA8I=; b=iRegv5w6jJjLnOs0uRn9XBsuTtFudAN7XX2jVGDx3P/Vpd1JKeggtr6j+ffWqDZnCX LCRf1eYN6O4gsyTG4PxbkkW2OtTwWMUmIQ/9Z/QEuI3vyEN20As9SKZAA3tfeD5IpCyS Lmh1jXtEn9Uy0qcq1mcxHGvGBhEfc+tkdx6z6S/fNifA15rTRR3GjGbw0qjpbUwn4Y/Y JdqqKKnHFPqBc+W41/V+QCKRuKUtWxg7MNAzNTTo4viVtSwkyyz4sX63UoYks79m/w/l HWQ8QTYDYBNoCSgt/h9Twp7fQxa4qC8yvkfg0+erDosek40Vbmt0JeQFtwor4SRXH9RP 3ykQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LdSOcXw1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si15120250plg.164.2022.01.24.11.50.18; Mon, 24 Jan 2022 11:50:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LdSOcXw1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245094AbiAXSHx (ORCPT + 99 others); Mon, 24 Jan 2022 13:07:53 -0500 Received: from out0.migadu.com ([94.23.1.103]:19487 "EHLO out0.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244951AbiAXSHa (ORCPT ); Mon, 24 Jan 2022 13:07:30 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1643047648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=woHyASpRd1dsSk1k8aXjCDxvW5sGTzgveGosFVStA8I=; b=LdSOcXw1hp5Fj7UST7UQpXoVIdytjtEsxQSoeOFLx8SjFkRo2FOAZykSmAnBB63s0l5Uuz 1OEAtZIT9WPUQT12nwV/ZCGMIa8rdy84Hyp25CnCuDUwNE9eExF9qqoRVg9/9wCcD9EGLD nElJQwpewG4SGKHZMb9sCnd+9GEwY14= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v6 33/39] kasan: mark kasan_arg_stacktrace as __initdata Date: Mon, 24 Jan 2022 19:05:07 +0100 Message-Id: <7fa090865614f8e0c6c1265508efb1d429afaa50.1643047180.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov As kasan_arg_stacktrace is only used in __init functions, mark it as __initdata instead of __ro_after_init to allow it be freed after boot. The other enums for KASAN args are used in kasan_init_hw_tags_cpu(), which is not marked as __init as a CPU can be hot-plugged after boot. Clarify this in a comment. Signed-off-by: Andrey Konovalov Suggested-by: Marco Elver --- Changes v1->v2: - Add this patch. --- mm/kasan/hw_tags.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/kasan/hw_tags.c b/mm/kasan/hw_tags.c index 2e9378a4f07f..6509809dd5d8 100644 --- a/mm/kasan/hw_tags.c +++ b/mm/kasan/hw_tags.c @@ -40,7 +40,7 @@ enum kasan_arg_stacktrace { static enum kasan_arg kasan_arg __ro_after_init; static enum kasan_arg_mode kasan_arg_mode __ro_after_init; -static enum kasan_arg_stacktrace kasan_arg_stacktrace __ro_after_init; +static enum kasan_arg_stacktrace kasan_arg_stacktrace __initdata; /* Whether KASAN is enabled at all. */ DEFINE_STATIC_KEY_FALSE(kasan_flag_enabled); @@ -116,7 +116,10 @@ static inline const char *kasan_mode_info(void) return "sync"; } -/* kasan_init_hw_tags_cpu() is called for each CPU. */ +/* + * kasan_init_hw_tags_cpu() is called for each CPU. + * Not marked as __init as a CPU can be hot-plugged after boot. + */ void kasan_init_hw_tags_cpu(void) { /* -- 2.25.1