From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27A9A2DCC03 for ; Wed, 20 Aug 2025 10:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755685849; cv=none; b=bl7kytYqUTVOUhEVxmSBItzbtcL13/t61NfMq+Gn94djAmytxEWYlh/vFif3PVL9XEFZ9cWLpU+9v6Q1owQDokWfu1rqZAs7gNGezmtVvKXTX/FZ4ONOi24y2swNckUqYRT4KPIXnmMRO4LhHzWJvh2R1+LLAMndgI58xec01ew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755685849; c=relaxed/simple; bh=UaGYbeesrpg0oek5MewzqAMP7UUuwr2FCQtbx3jbdcE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gUrosPmzZDo403p9sSgshIQWQ8RVeHnIwRLYX2dnRiv6czCijXvlJlZVWK1eqFSoFSh/MAJHE+OR1sfrSjF9e0M872liCDjCEYVPNRWOE6mxeO7PvmOSUgrDLI93+Ht4/NvSJ25MIrv/UAgyslBiwU9/BII8JgukYcd+fYTE31Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1RcFYYBF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DJO7qjkW; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1RcFYYBF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DJO7qjkW" Date: Wed, 20 Aug 2025 12:30:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755685846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zaVTYfobWUE+bjjymjisIJ92DUMlRrRNvqMXW0nDgVA=; b=1RcFYYBF2Vmr3l7B4lixY7D+VNdGCUTCTpwvOBEON+ZWOd0uLj691dUw3ebXR5WrpHhoGC TqeDbvt5H3bBAw8emb5Sezy/wH6TkEqW5fnHfaOL3VdeBVLbsGDRvWJfj8iIy5MRBa9Aiv RuAZ6mCvWzKRNzdAjdsoFvVDQiJmeSJc4twBETfF3BiUTWrTEkl0toHIMOEfvwOGNYYSR+ 4KXJMTeIYmhKAcOOpClXqSQrYmXA+/AriOkLY24dJImR2EYcmNyaa5RVgdpWBtca7tcYaO 4KmhkQR2Z8BeIWleJhmTOZw3GCAnJG4RXBgaxnqruiePw5dC9IRhPjv8DKfwrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755685846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zaVTYfobWUE+bjjymjisIJ92DUMlRrRNvqMXW0nDgVA=; b=DJO7qjkWFYf1lN9NpbwANoJ+6LNLOFEl7azcDovrLpEdT/vTNji2GELeBQsGGBOoahxWrY xuog2d4/i1UUgkDw== From: "Ahmed S. Darwish" To: Marcos Del Sol Vives Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Brian Gerst , Uros Bizjak , Ard Biesheuvel , David Kaplan , Kees Cook , "Peter Zijlstra (Intel)" , Andrew Cooper , Oleg Nesterov , "Xin Li (Intel)" , Sabyrzhan Tasbolatov Subject: Re: [PATCH] x86: add hintable NOPs emulation Message-ID: References: <20250820013452.495481-1-marcos@orca.pet> <2cd7b099-095d-405c-a7d9-b0f1f72184c2@orca.pet> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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