Re: [PATCH] x86: add 'runtime constant' infrastructure

From: Linus Torvalds
Date: Mon Jun 10 2024 - 21:09:58 EST


On Mon, 10 Jun 2024 at 16:35, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
>
> So I would also strongly suggest that we make the code fault if it is executed unpatched if there is no fallback.

It effectively does that already, just because the address won't be a
valid address before patching.

Doing it in general is actually very very painful. Feel free to try -
but I can almost guarantee that you will throw out the "Keep It Simple
Stupid" approach and your patch will be twice the size if you do some
"rewrite the whole instruction" stuff.

I really think there's a fundamental advantage to keeping things simple.

Linus