linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhenhua Huang <quic_zhenhuah@quicinc.com>
To: Alexander Potapenko <glider@google.com>
Cc: Pavan Kondeti <quic_pkondeti@quicinc.com>,
	<catalin.marinas@arm.com>, <will@kernel.org>, <elver@google.com>,
	<dvyukov@google.com>, <akpm@linux-foundation.org>,
	<robin.murphy@arm.com>, <mark.rutland@arm.com>,
	<jianyong.wu@arm.com>, <james.morse@arm.com>,
	<wangkefeng.wang@huawei.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<kasan-dev@googlegroups.com>, <linux-mm@kvack.org>,
	<quic_guptap@quicinc.com>, <quic_tingweiz@quicinc.com>
Subject: Re: [PATCH v9] mm,kfence: decouple kfence from page granularity mapping judgement
Date: Thu, 16 Mar 2023 19:17:06 +0800	[thread overview]
Message-ID: <5815d357-042e-2739-6d7b-960c81a50432@quicinc.com> (raw)
In-Reply-To: <CAG_fn=UigFQX8ZrNPoAFfXiV-JCP5ZyrtkD0TUNPJcN5-99VtA@mail.gmail.com>



On 2023/3/16 18:56, Alexander Potapenko wrote:
> 
> 
>      >> +    /* 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);
>      >> +    }
>      >
>      > Why not wrap this under CONFIG_KFENCE ? early_kfence_pool can
>     also go in
>      > there?
> 
>     Because I didn't want to add CONFIG_KFENCE in function.. in the case of
>     w/o CONFIG_KFENCE, early_kfence_pool should be always NULL.
> 
> Please no. If the code is not used in non-KFENCE build, it should not be 
> compiled. Same holds for the variables that only exist in KFENCE builds.

Got it, yeah.. it seems not make sense to have this variable w/o 
CONFIG_KFENCE.

Thanks,
Zhenhua


  reply	other threads:[~2023-03-16 11:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16  8:50 Zhenhua Huang
2023-03-16  9:58 ` Pavan Kondeti
2023-03-16 10:44   ` Zhenhua Huang
2023-03-16 10:56     ` Alexander Potapenko
2023-03-16 11:17       ` Zhenhua Huang [this message]
2023-03-16 10:06 ` Marco Elver
2023-03-16 10:36   ` Zhenhua Huang
2023-03-16 12:19     ` Zhenhua Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5815d357-042e-2739-6d7b-960c81a50432@quicinc.com \
    --to=quic_zhenhuah@quicinc.com \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=james.morse@arm.com \
    --cc=jianyong.wu@arm.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=quic_guptap@quicinc.com \
    --cc=quic_pkondeti@quicinc.com \
    --cc=quic_tingweiz@quicinc.com \
    --cc=robin.murphy@arm.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox