Re: [PATCH] docs/mm: describe set_memory() and set_direct_map() APIs

From: David Hildenbrand (Arm)

Date: Wed Sep 09 2026 - 10:41:48 EST


On 9/9/26 12:44, Mike Rapoport wrote:
> On Wed, Sep 09, 2026 at 12:30:01PM +0200, David Hildenbrand (Arm) wrote:
>> On 9/9/26 11:45, Mike Rapoport (Microsoft) wrote:
>>> The set_memory() and set_direct_map() APIs change permissions of existing
>>> kernel mappings, but their semantics are only described by the code, and
>>> that code differs from architecture to architecture.
>>>
>>> Add Documentation/mm/kernel-page-tables.rst that briefly describes what the
>>> kernel page tables consist of, defines the semantics both APIs have in
>>> common, including the parts that are easy to get wrong, and lists the
>>> differences between the architecture implementations.
>>>
>>> Add kernel-doc comments for the generic set_memory() and set_direct_map()
>>> stubs and link them into Documentation/core-api/mm-api.rst.
>>>
>>> Assisted-by: copilot:claude-opus
>>> Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
>>> ---
>>> The semantics of set_memory() and set_direct_map() are currently described
>>> only by the code, and the code differs from architecture to architecture.
>>>
>>> Document what these APIs actually promise, what they merely hint at, and how
>>> the architectures disagree.
>>>
>>> The discussions that prompted this:
>>>
>>> https://lore.kernel.org/all/a98df077-3e97-4eea-8bfe-470bad9ff9e0@xxxxxxxxxx
>>> https://lore.kernel.org/all/5026dbec-0b71-4408-a78a-484a4b8e77dd@xxxxxxxxx
>>> ---
>>> Documentation/core-api/mm-api.rst | 9 +
>>> Documentation/mm/index.rst | 1 +
>>> Documentation/mm/kernel-page-tables.rst | 402 ++++++++++++++++++++++++++++++++
>>
>> Before I read any of this, how much did you review and edit whatever the LLM
>> came up with?
>
> I never send something I don't like :)

Good. The rather excessive doc patch arrived rather fast so I had to ask :)

--
Cheers,

David