From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 353F0C6FD1F for ; Thu, 16 Mar 2023 10:36:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CCF1900003; Thu, 16 Mar 2023 06:36:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7553A900002; Thu, 16 Mar 2023 06:36:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A6F9900003; Thu, 16 Mar 2023 06:36:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 41BF2900002 for ; Thu, 16 Mar 2023 06:36:46 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0E52A1A1258 for ; Thu, 16 Mar 2023 10:36:46 +0000 (UTC) X-FDA: 80574408012.17.6919203 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by imf07.hostedemail.com (Postfix) with ESMTP id 325B340006 for ; Thu, 16 Mar 2023 10:36:41 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=c8dVDPTt; spf=pass (imf07.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678963002; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OSD3n1LVf/WQIYSIYg5Y9H48EDmpFGFOUTMFpzi7BcA=; b=A9LdiCkYHmzwo5N0nYNmgyem+3KIRxlsl5m7jD3sJQKX6J71UqqMf/yhIe6xxkKRRiyGfb UTzW8rSq/v5wd8bCyc/HjzTMCnSXOx6Bn2EUVmrSn8j93T62cnsQsPaE8jVLlyIFnj89Ux uAPp+F8w7JFozas61GuJJkL5d+A4wLc= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b=c8dVDPTt; spf=pass (imf07.hostedemail.com: domain of quic_zhenhuah@quicinc.com designates 205.220.168.131 as permitted sender) smtp.mailfrom=quic_zhenhuah@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678963002; a=rsa-sha256; cv=none; b=VqJp3IK/2m6oaEgNSHlrPsUOwzsMf66GmFd0d/I6nZIEN3i+s/zlLL45aQsQt8qOVb9bnR JJVE+rWFxr3a+NTI+JslSLRh+0+g+vtOE5BV22Mrsbahqgc9AhAIYzwNI+jsJ8ZQlfUZA3 L4Wh4qOq09CWT38k9Kp4SdCcvMx1o5o= Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32G25xQX030577; Thu, 16 Mar 2023 10:36:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=OSD3n1LVf/WQIYSIYg5Y9H48EDmpFGFOUTMFpzi7BcA=; b=c8dVDPTtpGH/mRTQjxyyex19GBQpWxyPsX+Le9YBrsJgCHTJ6n/Ak0E1jB0cfHN2Wzgc 32qsBdvpkwbJAHyZC4SZZETElccGZmfURVIQxWbF64+YZd0aS9T5vc8xK29hm45zsVRv CC8guIYew+4osjS517NtF8DqMivHyLP3Ef24L2IdTnOefWmqtbdNmo70fVdJb5FlhdT1 HgUPOmFjg/MnRKUs5PvjkITh/XS3i0TjaPgRVOflH5U+Q4LX123l7eHiPF6Nn7GOfpZz H5PiE1ATTI7wLKntuyI1rLqVtyxFAxu72yxw9NdoC36zY/gpsPVI6wNf1UC4+0rWzRoc dA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pbpxjsj36-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 10:36:27 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32GAaQQK011261 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 10:36:26 GMT Received: from [10.239.132.245] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 16 Mar 2023 03:36:21 -0700 Message-ID: Date: Thu, 16 Mar 2023 18:36:19 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v9] mm,kfence: decouple kfence from page granularity mapping judgement Content-Language: en-US To: Marco Elver CC: , , , , , , , , , , , , , , , References: <1678956620-26103-1-git-send-email-quic_zhenhuah@quicinc.com> From: Zhenhua Huang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: SPekO0UiqqbVHqJS-M-gNBCLLO77nrI0 X-Proofpoint-ORIG-GUID: SPekO0UiqqbVHqJS-M-gNBCLLO77nrI0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_07,2023-03-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 mlxscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303160089 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 325B340006 X-Stat-Signature: f1npt84b46wk89xx9zf93sy48bzctw3n X-HE-Tag: 1678963001-94269 X-HE-Meta: U2FsdGVkX19KK5IxqjeBpwdOPp61TIqJjrXvk4pGw5YKQj1Qiz5BJQFL5VAhzbW+Bk1zHxceRdfBfZB43cUS5stRjVy5807gY40yo8ZwQdxOj5oETF6pA3Meeb5g8qOMOLBIzrqw0Z6Pfdwi2scOInIPVQ4s6DxkwGfRMdbNOoX0FRxwFwqCKUVbvPioqSxp5g+skE8nrfAW3AKy56Apc/FrdS+VK6oWLwc1GkVTgbnMr4yGf8bAbNH1bShueA1t4UcLmMTXnLmK61aRJSSiiV/1rfO3oX3IwWX8lRgaQqWe1na0KxsYszAluVo0ZKZLZNMNL7MFe7IZZMfIHojim5OYGKsEs9W5/ELtygadRGfRbr0nIrI9TkubOw7hK2/yA+FUf2E4QWtY+TnjPjE+uYm1Lp3dnmpX+/jF0nFY4EneEnz8RcAgBkyVq98SAIhMLQskdyJpUaNtic3C4/becktOfbsfw79Q3gCgvEl6X26LN+m99G63jLS6UN3sFfdGaU08MoMDo8aS2NgKTrSG7064iF2UE9sYVbpOHpzSQc2j0RF3UZDG1ycxZhsvBReEmGmO7KpxlusdFN1glD4YOxAY96a+9+Hgunqrf2ybfXIZ7Y0YgqifRYwDSHUXMdE57t4EWDcZGSkBq9ZcH3/REKrUDjkSgBxDEV+ByobnYKJZ2Nk6+GsT8KtENhVnVk2dBxZWQwnxniRakhI9E6swm4J/unZXYggP1bpFuQusS/XLr3WLfmdJLUWHzN2FqwXmTL3/YHMIX/J5sKi6gVDxZpusPyPynJ3szls0NyZ0kQ8t27CbPpehCnI0TYqf0Cxld+PJTKI6fYPFUqkX3ODWrDupW0tarZZUJ82Vd70AwZXclnrRrhWRJ/E+6dHN+s7DCAPC5h45a+j+VCnOSZltRAvQoga1OHezniBCCkA4DQ2L13rquoMA+k1Dtaabo4q914p/KNt6Fn3QWJs4OuL DAkcgjDp mXrtTzQCsOfCY2DosfgLu70vqCQwW6o8VqcjN/RnVK+hI2qc+OXk37i7HWQ5g+a+JePl3I5oG9HnML9fQ1aj2TfecQwpmXGnMzXAF8uyZH/nbDQ/fpMzCt7aVe7g5TX03L0uhFklBwhej7Y/R8nmtYUmDlpZSGFpc9SFX5e0nkFdExE17neKJRb6MR1dN2nK6FKOCwD0mKnS+BldyUU6ol2+pkG1kTpo6o0dRq+b2CnxWtE4wy7gjufnVkeiTK+bK++vVlSCKPS9jqFSzD/N2EmVqaIfpsZa+r4nAyiWqZ/1exgdivR9wHgji9AkkkXuRdtU9ht7oRh34gs26mykXZkJqbnDhWmbMdyy3NELWTimOks2T1STQYmJT95wAGG6QICgo28xQUmIY3dPekn4BNMKC+Q== 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: On 2023/3/16 18:06, Marco Elver wrote: > On Thu, Mar 16, 2023 at 04:50PM +0800, Zhenhua Huang wrote: >> Kfence only needs its pool to be mapped as page granularity, if it is >> inited early. Previous judgement was a bit over protected. From [1], Mark >> suggested to "just map the KFENCE region a page granularity". So I >> decouple it from judgement and do page granularity mapping for kfence >> pool only. Need to be noticed that late init of kfence pool still requires >> page granularity mapping. >> >> Page granularity mapping in theory cost more(2M per 1GB) memory on arm64 >> platform. Like what I've tested on QEMU(emulated 1GB RAM) with >> gki_defconfig, also turning off rodata protection: >> Before: >> [root@liebao ]# cat /proc/meminfo >> MemTotal: 999484 kB >> After: >> [root@liebao ]# cat /proc/meminfo >> MemTotal: 1001480 kB >> >> To implement this, also relocate the kfence pool allocation before the >> linear mapping setting up, arm64_kfence_alloc_pool is to allocate phys >> addr, __kfence_pool is to be set after linear mapping set up. >> >> LINK: [1] https://lore.kernel.org/linux-arm-kernel/Y+IsdrvDNILA59UN@FVFF77S0Q05N/ >> Suggested-by: Mark Rutland >> Signed-off-by: Zhenhua Huang >> --- >> arch/arm64/include/asm/kfence.h | 16 +++++++++++ >> arch/arm64/mm/mmu.c | 59 +++++++++++++++++++++++++++++++++++++++++ >> arch/arm64/mm/pageattr.c | 9 +++++-- >> include/linux/kfence.h | 1 + >> mm/kfence/core.c | 4 +++ >> 5 files changed, 87 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h >> index aa855c6..8143c91 100644 >> --- a/arch/arm64/include/asm/kfence.h >> +++ b/arch/arm64/include/asm/kfence.h >> @@ -10,6 +10,22 @@ >> >> #include >> >> +extern phys_addr_t early_kfence_pool; > > This should not be accessible if !CONFIG_KFENCE. > >> +#ifdef CONFIG_KFENCE >> + >> +extern char *__kfence_pool; >> +static inline void kfence_set_pool(phys_addr_t addr) >> +{ >> + __kfence_pool = phys_to_virt(addr); >> +} > > kfence_set_pool() is redundant if it's for arm64 only, because we know > where it's needed, and there you could just access __kfence_pool > directly. So let's just remove this function. (Initially I thought you > want to provide it generally, also for other architectures.) > >> +#else >> + >> +static inline void kfence_set_pool(phys_addr_t addr) { } >> + >> +#endif >> + >> static inline bool arch_kfence_init_pool(void) { return true; } > [...] >> +#endif >> + >> +phys_addr_t early_kfence_pool; > > This variable now exists in non-KFENCE builds, which is wrong. > >> static void __init map_mem(pgd_t *pgdp) >> { >> static const u64 direct_map_end = _PAGE_END(VA_BITS_MIN); >> @@ -543,6 +587,10 @@ static void __init map_mem(pgd_t *pgdp) >> */ >> BUILD_BUG_ON(pgd_index(direct_map_end - 1) == pgd_index(direct_map_end)); >> >> + early_kfence_pool = arm64_kfence_alloc_pool(); >> + if (early_kfence_pool) >> + memblock_mark_nomap(early_kfence_pool, KFENCE_POOL_SIZE); >> + >> if (can_set_direct_map()) >> flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; >> >> @@ -608,6 +656,17 @@ static void __init map_mem(pgd_t *pgdp) >> } >> } >> #endif >> + >> + /* Kfence pool needs page-level mapping */ >> + if (early_kfence_pool) { >> + __map_memblock(pgdp, early_kfence_pool, >> + early_kfence_pool + KFENCE_POOL_SIZE, >> + pgprot_tagged(PAGE_KERNEL), >> + NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS); >> + memblock_clear_nomap(early_kfence_pool, KFENCE_POOL_SIZE); >> + /* kfence_pool really mapped now */ >> + kfence_set_pool(early_kfence_pool); >> + } > > This whole piece of code could also be wrapped in another function, > which becomes a no-op if !CONFIG_KFENCE. Then you also don't need to > provide the KFENCE_POOL_SIZE define for 0 if !CONFIG_KFENCE. > > [...] >> + * >> + * Kfence pool requires page granularity mapping also if we init it >> + * late. >> */ >> return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() || >> - IS_ENABLED(CONFIG_KFENCE); >> + (IS_ENABLED(CONFIG_KFENCE) && !early_kfence_pool); > > Accessing a non-existent variable if !CONFIG_KFENCE works because the > compiler optimizes out the access, but is generally bad style. Hi Marco, Actually my previous intention is not to do separation between KFENCE and non-KFENCE, instead to ensure early_kfence_pool always to be NULL in non-KFENCE build. That works well from my side w/ and w/o CONFIG_KFENCE.. but Yes that not clear to have this variable still in non-Kfence build. Sure, I will follow your suggestion below and tested on my side. Thanks. Thanks, Zhenhua > > > I think the only issue that I have is that the separation between KFENCE > and non-KFENCE builds is not great. > > At the end of the email are is a diff against your patch which would be > my suggested changes (while at it, I fixed up a bunch of other issues). > Untested, so if you decide to adopt these changes, please test. > > Thanks, > -- Marco > > ------ >8 ------ > > > diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h > index 8143c91854e1..a81937fae9f6 100644 > --- a/arch/arm64/include/asm/kfence.h > +++ b/arch/arm64/include/asm/kfence.h > @@ -10,22 +10,6 @@ > > #include > > -extern phys_addr_t early_kfence_pool; > - > -#ifdef CONFIG_KFENCE > - > -extern char *__kfence_pool; > -static inline void kfence_set_pool(phys_addr_t addr) > -{ > - __kfence_pool = phys_to_virt(addr); > -} > - > -#else > - > -static inline void kfence_set_pool(phys_addr_t addr) { } > - > -#endif > - > static inline bool arch_kfence_init_pool(void) { return true; } > > static inline bool kfence_protect_page(unsigned long addr, bool protect) > @@ -35,4 +19,14 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect) > return true; > } > > +#ifdef CONFIG_KFENCE > +extern bool kfence_early_init; > +static inline bool arm64_kfence_can_set_direct_map(void) > +{ > + return !kfence_early_init; > +} > +#else /* CONFIG_KFENCE */ > +static inline bool arm64_kfence_can_set_direct_map(void) { return false; } > +#endif /* CONFIG_KFENCE */ > + > #endif /* __ASM_KFENCE_H */ > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index 61944c7091f0..683958616ac1 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -528,17 +528,14 @@ static int __init enable_crash_mem_map(char *arg) > early_param("crashkernel", enable_crash_mem_map); > > #ifdef CONFIG_KFENCE > +bool kfence_early_init = !!CONFIG_KFENCE_SAMPLE_INTERVAL; > > -static bool kfence_early_init __initdata = !!CONFIG_KFENCE_SAMPLE_INTERVAL; > -/* > - * early_param can be parsed before linear mapping > - * set up > - */ > -static int __init parse_kfence_early_init(char *p) > +/* early_param() will be parsed before map_mem() below. */ > +static int __init parse_kfence_early_init(char *arg) > { > int val; > > - if (get_option(&p, &val)) > + if (get_option(&arg, &val)) > kfence_early_init = !!val; > return 0; > } > @@ -552,22 +549,34 @@ static phys_addr_t arm64_kfence_alloc_pool(void) > return 0; > > kfence_pool = memblock_phys_alloc(KFENCE_POOL_SIZE, PAGE_SIZE); > - if (!kfence_pool) > + if (!kfence_pool) { > pr_err("failed to allocate kfence pool\n"); > + kfence_early_init = false; > + return 0; > + } > + > + /* Temporarily mark as NOMAP. */ > + memblock_mark_nomap(kfence_pool, KFENCE_POOL_SIZE); > > return kfence_pool; > } > > -#else > - > -static phys_addr_t arm64_kfence_alloc_pool(void) > +static void arm64_kfence_map_pool(phys_addr_t kfence_pool, pgd_t *pgdp) > { > - return 0; > -} > - > -#endif > + if (!kfence_pool) > + return; > > -phys_addr_t early_kfence_pool; > + /* KFENCE pool needs page-level mapping. */ > + __map_memblock(pgdp, kfence_pool, kfence_pool + KFENCE_POOL_SIZE, > + pgprot_tagged(PAGE_KERNEL), > + NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS); > + memblock_clear_nomap(kfence_pool, KFENCE_POOL_SIZE); > + __kfence_pool = phys_to_virt(kfence_pool); > +} > +#else /* CONFIG_KFENCE */ > +static inline phys_addr_t arm64_kfence_alloc_pool(void) { return 0; } > +static inline void arm64_kfence_map_pool(phys_addr_t kfence_pool, pgd_t *pgdp) { } > +#endif /* CONFIG_KFENCE */ > > static void __init map_mem(pgd_t *pgdp) > { > @@ -575,6 +584,7 @@ static void __init map_mem(pgd_t *pgdp) > phys_addr_t kernel_start = __pa_symbol(_stext); > phys_addr_t kernel_end = __pa_symbol(__init_begin); > phys_addr_t start, end; > + phys_addr_t early_kfence_pool; > int flags = NO_EXEC_MAPPINGS; > u64 i; > > @@ -588,8 +598,6 @@ static void __init map_mem(pgd_t *pgdp) > BUILD_BUG_ON(pgd_index(direct_map_end - 1) == pgd_index(direct_map_end)); > > early_kfence_pool = arm64_kfence_alloc_pool(); > - if (early_kfence_pool) > - memblock_mark_nomap(early_kfence_pool, KFENCE_POOL_SIZE); > > if (can_set_direct_map()) > flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; > @@ -656,17 +664,7 @@ static void __init map_mem(pgd_t *pgdp) > } > } > #endif > - > - /* Kfence pool needs page-level mapping */ > - if (early_kfence_pool) { > - __map_memblock(pgdp, early_kfence_pool, > - early_kfence_pool + KFENCE_POOL_SIZE, > - pgprot_tagged(PAGE_KERNEL), > - NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS); > - memblock_clear_nomap(early_kfence_pool, KFENCE_POOL_SIZE); > - /* kfence_pool really mapped now */ > - kfence_set_pool(early_kfence_pool); > - } > + arm64_kfence_map_pool(early_kfence_pool, pgdp); > } > > void mark_rodata_ro(void) > diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c > index 7ce5295cc6fb..aa8fd12cc96f 100644 > --- a/arch/arm64/mm/pageattr.c > +++ b/arch/arm64/mm/pageattr.c > @@ -7,7 +7,6 @@ > #include > #include > #include > -#include > > #include > #include > @@ -28,11 +27,10 @@ bool can_set_direct_map(void) > * mapped at page granularity, so that it is possible to > * protect/unprotect single pages. > * > - * Kfence pool requires page granularity mapping also if we init it > - * late. > + * KFENCE pool requires page-granular mapping if initialized late. > */ > return (rodata_enabled && rodata_full) || debug_pagealloc_enabled() || > - (IS_ENABLED(CONFIG_KFENCE) && !early_kfence_pool); > + arm64_kfence_can_set_direct_map(); > } > > static int change_page_range(pte_t *ptep, unsigned long addr, void *data) > diff --git a/include/linux/kfence.h b/include/linux/kfence.h > index 91cbcc98e293..726857a4b680 100644 > --- a/include/linux/kfence.h > +++ b/include/linux/kfence.h > @@ -222,7 +222,6 @@ bool __kfence_obj_info(struct kmem_obj_info *kpp, void *object, struct slab *sla > > #else /* CONFIG_KFENCE */ > > -#define KFENCE_POOL_SIZE 0 > static inline bool is_kfence_address(const void *addr) { return false; } > static inline void kfence_alloc_pool(void) { } > static inline void kfence_init(void) { } > diff --git a/mm/kfence/core.c b/mm/kfence/core.c > index fab087d39633..e7f22af5e710 100644 > --- a/mm/kfence/core.c > +++ b/mm/kfence/core.c > @@ -818,7 +818,7 @@ void __init kfence_alloc_pool(void) > if (!kfence_sample_interval) > return; > > - /* if the pool has already been initialized by arch, skip the below */ > + /* If the pool has already been initialized by arch, skip the below. */ > if (__kfence_pool) > return; >