[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKWj0SI1_qmT6dW2@lx-t490>
Date: Wed, 20 Aug 2025 12:30:41 +0200
From: "Ahmed S. Darwish" <darwi@...utronix.de>
To: Marcos Del Sol Vives <marcos@...a.pet>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Brian Gerst <brgerst@...il.com>,
Uros Bizjak <ubizjak@...il.com>, Ard Biesheuvel <ardb@...nel.org>,
David Kaplan <david.kaplan@....com>, Kees Cook <kees@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Oleg Nesterov <oleg@...hat.com>, "Xin Li (Intel)" <xin@...or.com>,
Sabyrzhan Tasbolatov <snovitoll@...il.com>
Subject: Re: [PATCH] x86: add hintable NOPs emulation
On Wed, 20 Aug 2025, Ahmed S. Darwish wrote:
>
> Please do:
>
> #ifdef CONFIG_X86_HNOP_EMU
> static bool handle_hnop(struct pt_regs *regs)
> {
> // Reference 'hnop_warn' as much as you like
> }
> #else
> static bool handle_hnop(struct pt_regs *regs)
> {
> return false;
> }
> # endif
>
And as previously suggested: remove the ugly hnop_warn stuff from
'thread_struct', then you can even just do:
static bool handle_hnop(struct pt_regs *regs)
{
if (!IS_ENABLED(CONFIG_X86_HNOP_EMU))
return false;
pr_warn_once("%s[%d] Emulating hintable NOP\n"
"This warning will not be repeated; even for other binaries\n"
current->comm, task_pid_nr(current));
...
}
And everything else will fit quietly in place.
--
Ahmed S. Darwish
Linutronix GmbH
Powered by blists - more mailing lists