[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251021144803.519e6244@pumpkin>
Date: Tue, 21 Oct 2025 14:48:03 +0100
From: David Laight <david.laight.linux@...il.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Sohil Mehta <sohil.mehta@...el.com>, x86@...nel.org, Dave Hansen
<dave.hansen@...ux.intel.com>, Thomas Gleixner <tglx@...utronix.de>, Ingo
Molnar <mingo@...hat.com>, Jonathan Corbet <corbet@....net>, "H . Peter
Anvin" <hpa@...or.com>, Andy Lutomirski <luto@...nel.org>, Josh Poimboeuf
<jpoimboe@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Ard
Biesheuvel <ardb@...nel.org>, "Kirill A . Shutemov" <kas@...nel.org>, Xin
Li <xin@...or.com>, David Woodhouse <dwmw@...zon.co.uk>, Sean
Christopherson <seanjc@...gle.com>, Rick Edgecombe
<rick.p.edgecombe@...el.com>, Vegard Nossum <vegard.nossum@...cle.com>,
Andrew Cooper <andrew.cooper3@...rix.com>, Randy Dunlap
<rdunlap@...radead.org>, Geert Uytterhoeven <geert@...ux-m68k.org>, Kees
Cook <kees@...nel.org>, Tony Luck <tony.luck@...el.com>, Alexander Shishkin
<alexander.shishkin@...ux.intel.com>, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org
Subject: Re: [PATCH v10 02/15] x86/asm: Introduce inline memcpy and memset
On Tue, 21 Oct 2025 14:47:51 +0200
Borislav Petkov <bp@...en8.de> wrote:
> On Mon, Oct 06, 2025 at 11:51:06PM -0700, Sohil Mehta wrote:
> > From: "Peter Zijlstra (Intel)" <peterz@...radead.org>
> >
> > Provide inline memcpy and memset functions that can be used instead of
> > the GCC builtins when necessary. The immediate use case is for the text
> > poking functions to avoid the standard memcpy()/memset() calls within an
> > RFLAGS.AC=1 context.
>
> ... because objtool does not allow function calls with AC=1 because... see
> objtool/Documentation/objtool.txt, warning type 9, yadda yadda...
>
But for the purpose of code patching they don't need to be 'rep movsb'.
An inline function with a C byte copy loop is fine - provided you do
something to stop gcc pessimising it.
Obvious options are a volatile pointer (or READ_ONCE()) or a barrier().
David
Powered by blists - more mailing lists