From: Mike Rapoport <rppt@kernel•org>
To: Rick Edgecombe <rick.p.edgecombe@intel•com>
Cc: x86@kernel•org, "H . Peter Anvin" <hpa@zytor•com>,
Thomas Gleixner <tglx@linutronix•de>,
Ingo Molnar <mingo@redhat•com>,
linux-kernel@vger•kernel.org, linux-doc@vger•kernel.org,
linux-mm@kvack•org, linux-arch@vger•kernel.org,
linux-api@vger•kernel.org, Arnd Bergmann <arnd@arndb•de>,
Andy Lutomirski <luto@kernel•org>,
Balbir Singh <bsingharora@gmail•com>,
Borislav Petkov <bp@alien8•de>,
Cyrill Gorcunov <gorcunov@gmail•com>,
Dave Hansen <dave.hansen@linux•intel.com>,
Eugene Syromiatnikov <esyr@redhat•com>,
Florian Weimer <fweimer@redhat•com>,
"H . J . Lu" <hjl.tools@gmail•com>, Jann Horn <jannh@google•com>,
Jonathan Corbet <corbet@lwn•net>,
Kees Cook <keescook@chromium•org>,
Mike Kravetz <mike.kravetz@oracle•com>,
Nadav Amit <nadav.amit@gmail•com>,
Oleg Nesterov <oleg@redhat•com>, Pavel Machek <pavel@ucw•cz>,
Peter Zijlstra <peterz@infradead•org>,
Randy Dunlap <rdunlap@infradead•org>,
Weijiang Yang <weijiang.yang@intel•com>,
"Kirill A . Shutemov" <kirill.shutemov@linux•intel.com>,
John Allen <john.allen@amd•com>,
kcc@google•com, eranian@google•com, jamorris@linux•microsoft.com,
dethoma@microsoft•com, akpm@linux-foundation•org,
Andrew.Cooper3@citrix•com, christina.schimpe@intel•com,
david@redhat•com, debug@rivosinc•com, szabolcs.nagy@arm•com,
torvalds@linux-foundation•org, broonie@kernel•org,
linux-arm-kernel@lists•infradead.org, linux-s390@vger•kernel.org,
xen-devel@lists•xenproject.org
Subject: Re: [PATCH v9 02/42] mm: Move pte/pmd_mkwrite() callers with no VMA to _novma()
Date: Tue, 13 Jun 2023 10:44:28 +0300 [thread overview]
Message-ID: <20230613074428.GS52412@kernel.org> (raw)
In-Reply-To: <20230613001108.3040476-3-rick.p.edgecombe@intel.com>
On Mon, Jun 12, 2023 at 05:10:28PM -0700, Rick Edgecombe wrote:
> The x86 Shadow stack feature includes a new type of memory called shadow
> stack. This shadow stack memory has some unusual properties, which requires
> some core mm changes to function properly.
>
> One of these unusual properties is that shadow stack memory is writable,
> but only in limited ways. These limits are applied via a specific PTE
> bit combination. Nevertheless, the memory is writable, and core mm code
> will need to apply the writable permissions in the typical paths that
> call pte_mkwrite(). Future patches will make pte_mkwrite() take a VMA, so
> that the x86 implementation of it can know whether to create regular
> writable memory or shadow stack memory.
Nit: ^ mappings?
> But there are a couple of challenges to this. Modifying the signatures of
> each arch pte_mkwrite() implementation would be error prone because some
> are generated with macros and would need to be re-implemented. Also, some
> pte_mkwrite() callers operate on kernel memory without a VMA.
>
> So this can be done in a three step process. First pte_mkwrite() can be
> renamed to pte_mkwrite_novma() in each arch, with a generic pte_mkwrite()
> added that just calls pte_mkwrite_novma(). Next callers without a VMA can
> be moved to pte_mkwrite_novma(). And lastly, pte_mkwrite() and all callers
> can be changed to take/pass a VMA.
>
> Previous patches have done the first step, so next move the callers that
> don't have a VMA to pte_mkwrite_novma(). Also do the same for
I hear x86 maintainers asking to drop "previous patches" ;-)
Maybe
This is the second step of the conversion that moves the callers ...
> pmd_mkwrite(). This will be ok for the shadow stack feature, as these
> callers are on kernel memory which will not need to be made shadow stack,
> and the other architectures only currently support one type of memory
> in pte_mkwrite()
>
> Cc: linux-doc@vger•kernel.org
> Cc: linux-arm-kernel@lists•infradead.org
> Cc: linux-s390@vger•kernel.org
> Cc: xen-devel@lists•xenproject.org
> Cc: linux-arch@vger•kernel.org
> Cc: linux-mm@kvack•org
> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel•com>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel•org>
--
Sincerely yours,
Mike.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-06-13 7:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230613001108.3040476-1-rick.p.edgecombe@intel.com>
2023-06-13 0:10 ` [PATCH v9 02/42] mm: Move pte/pmd_mkwrite() callers with no VMA to _novma() Rick Edgecombe
2023-06-13 7:44 ` Mike Rapoport [this message]
2023-06-13 16:19 ` Edgecombe, Rick P
2023-06-13 17:00 ` David Hildenbrand
2023-06-14 17:00 ` Edgecombe, Rick P
2023-06-13 12:27 ` David Hildenbrand
2023-06-13 16:20 ` Edgecombe, Rick P
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=20230613074428.GS52412@kernel.org \
--to=rppt@kernel$(echo .)org \
--cc=Andrew.Cooper3@citrix$(echo .)com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=arnd@arndb$(echo .)de \
--cc=bp@alien8$(echo .)de \
--cc=broonie@kernel$(echo .)org \
--cc=bsingharora@gmail$(echo .)com \
--cc=christina.schimpe@intel$(echo .)com \
--cc=corbet@lwn$(echo .)net \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=david@redhat$(echo .)com \
--cc=debug@rivosinc$(echo .)com \
--cc=dethoma@microsoft$(echo .)com \
--cc=eranian@google$(echo .)com \
--cc=esyr@redhat$(echo .)com \
--cc=fweimer@redhat$(echo .)com \
--cc=gorcunov@gmail$(echo .)com \
--cc=hjl.tools@gmail$(echo .)com \
--cc=hpa@zytor$(echo .)com \
--cc=jamorris@linux$(echo .)microsoft.com \
--cc=jannh@google$(echo .)com \
--cc=john.allen@amd$(echo .)com \
--cc=kcc@google$(echo .)com \
--cc=keescook@chromium$(echo .)org \
--cc=kirill.shutemov@linux$(echo .)intel.com \
--cc=linux-api@vger$(echo .)kernel.org \
--cc=linux-arch@vger$(echo .)kernel.org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-doc@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=luto@kernel$(echo .)org \
--cc=mike.kravetz@oracle$(echo .)com \
--cc=mingo@redhat$(echo .)com \
--cc=nadav.amit@gmail$(echo .)com \
--cc=oleg@redhat$(echo .)com \
--cc=pavel@ucw$(echo .)cz \
--cc=peterz@infradead$(echo .)org \
--cc=rdunlap@infradead$(echo .)org \
--cc=rick.p.edgecombe@intel$(echo .)com \
--cc=szabolcs.nagy@arm$(echo .)com \
--cc=tglx@linutronix$(echo .)de \
--cc=torvalds@linux-foundation$(echo .)org \
--cc=weijiang.yang@intel$(echo .)com \
--cc=x86@kernel$(echo .)org \
--cc=xen-devel@lists$(echo .)xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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