From: Kevin Brodsky <kevin.brodsky@arm.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Anshuman Khandual <anshuman.khandual@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Kees Cook <kees@kernel.org>, Mark Rutland <mark.rutland@arm.com>,
Ryan Roberts <ryan.roberts@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Will Deacon <will@kernel.org>, Yeoreum Yun <yeoreum.yun@arm.com>
Subject: Re: [PATCH] arm64: mm: Move KPTI helpers to mmu.c
Date: Thu, 11 Sep 2025 12:52:02 +0200 [thread overview]
Message-ID: <b0b11c57-e45b-4a53-8dba-93e8ce5800c1@arm.com> (raw)
In-Reply-To: <CAMj1kXHR34kpL1qLgeEgEmRZN1o=umWzjZEzmSV+X2AX-4CvVg@mail.gmail.com>
On 11/09/2025 11:19, Ard Biesheuvel wrote:
>> diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
>> index 49f1a810df16..624edd6c4964 100644
>> --- a/arch/arm64/include/asm/mmu.h
>> +++ b/arch/arm64/include/asm/mmu.h
>> @@ -104,5 +104,11 @@ static inline bool kaslr_requires_kpti(void)
>> return true;
>> }
>>
>> +#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
>> +void kpti_install_ng_mappings(void);
>> +#else
>> +static inline void kpti_install_ng_mappings(void) {}
>> +#endif
>> +
> Nit: you might just keep the former declaration, and check for
> IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0) in the function, rather than
> propagating this distinction to the header file.
> But either is fine with me.
That's an option, but that would mean removing the #ifdef around the
functions defined in mmu.c. They would probably get eliminated by the
linker if the CONFIG isn't defined, but I'm not so sure about the static
variable (kpti_ng_temp_alloc). Probably not a big deal but I feel
keeping the #ifdef is more self-documenting as well.
- Kevin
next prev parent reply other threads:[~2025-09-11 10:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 10:44 [PATCH] arm64: mm: Move KPTI helpers to mmu.c Kevin Brodsky
2025-09-10 14:33 ` Ryan Roberts
2025-09-10 16:25 ` Kevin Brodsky
2025-09-11 5:13 ` Anshuman Khandual
2025-09-11 6:08 ` Ard Biesheuvel
2025-09-11 6:18 ` Anshuman Khandual
2025-09-11 6:24 ` Ard Biesheuvel
2025-09-11 9:10 ` Kevin Brodsky
2025-09-11 9:19 ` Ard Biesheuvel
2025-09-11 10:52 ` Kevin Brodsky [this message]
2025-09-11 11:01 ` Ard Biesheuvel
2025-09-11 12:13 ` Anshuman Khandual
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=b0b11c57-e45b-4a53-8dba-93e8ce5800c1@arm.com \
--to=kevin.brodsky@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=kees@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=ryan.roberts@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yeoreum.yun@arm.com \
/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