From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 E88673A6F05 for ; Tue, 5 May 2026 08:25:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777969550; cv=none; b=TVyUGVhY+pd4Z2PrMW6ulqmemTjQPzD5FnKwH+Pr7VJ9YPUy41UELBktgt1SfO8Hj2m2ACZfrj6G7ieL6iiyHrhsrLVIvhlSji+Ucsc0AumcCo7Jd6dfq9tX7ZmITB+tvWB6AhNDkUEaqz4wuiQwL0lozNopWEnpCBVPwbHCRUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777969550; c=relaxed/simple; bh=fq5En4/Va1nQzkpnZyca+QjaT0OS7VaIxnVg7c62W/c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Le/7XkMGnSN08lVx3UK6JjZn9F+CHLIAJf66+tODNHYLM++x5X7uSr1rsyo+Jx0tCE4L/3mHw3z0nHA0gUO+x6n3ZnQ0tYSj0ICiQwSSgK9CQCwK2YkbKTFZZ2DnigEvEkV8Edy2pYkMqJvpUwyDzpUf9P8y+6et4YBzCx/L2/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=EokH2yHW; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EokH2yHW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777969547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l2arT9BR9GQEDmoFSfkd1amcjOIN23FvDLl4qeaHtwQ=; b=EokH2yHWVPQ7Xw+Qr+7GHAb2VdsqqaggmjiG29sKCJ/jmcn65UOtJJElghuI/HlSt8Wxmd nAkg2eFf/c0z8zSAfDMwAdvq7ljiEXFGbo1M3DFC1XE5KRZex0C11cFzr6VXa5aPlQhDMv iFx+pT4C9y2fGqqTN5zjfWRUKujS6NU= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-547-ALc8xlBqNVCJlI1KL0LpvA-1; Tue, 05 May 2026 04:25:43 -0400 X-MC-Unique: ALc8xlBqNVCJlI1KL0LpvA-1 X-Mimecast-MFC-AGG-ID: ALc8xlBqNVCJlI1KL0LpvA_1777969539 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C97B71956096; Tue, 5 May 2026 08:25:38 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.44.48.109]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CF4B030001A1; Tue, 5 May 2026 08:25:26 +0000 (UTC) From: Valentin Schneider To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Arnaldo Carvalho de Melo , Josh Poimboeuf , Paolo Bonzini , Arnd Bergmann , Frederic Weisbecker , "Paul E. McKenney" , Jason Baron , Steven Rostedt , Ard Biesheuvel , Sami Tolvanen , "David S. Miller" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Mathieu Desnoyers , Mel Gorman , Andrew Morton , Masahiro Yamada , Han Shen , Rik van Riel , Jann Horn , Dan Carpenter , Oleg Nesterov , Juri Lelli , Clark Williams , Tomas Glozar , Yair Podemsky , Marcelo Tosatti , Daniel Wagner , Petr Tesarik , Shrikanth Hegde Subject: [PATCH v9 04/10] x86/retpoline: Make warn_thunk_thunk .noinstr Date: Tue, 5 May 2026 10:23:49 +0200 Message-ID: <20260505082355.1982003-5-vschneid@redhat.com> In-Reply-To: <20260505082355.1982003-1-vschneid@redhat.com> References: <20260505082355.1982003-1-vschneid@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Objtool now warns about it: vmlinux.o: warning: objtool: .altinstr_replacement+0x28e1: call to warn_thunk_thunk() leaves .noinstr.text section Mark it noinstr. Signed-off-by: Valentin Schneider --- arch/x86/entry/entry.S | 3 ++- arch/x86/kernel/cpu/bugs.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/entry.S b/arch/x86/entry/entry.S index 6ba2b3adcef0f..e76560f86b332 100644 --- a/arch/x86/entry/entry.S +++ b/arch/x86/entry/entry.S @@ -40,6 +40,8 @@ SYM_FUNC_START(__WARN_trap) SYM_FUNC_END(__WARN_trap) EXPORT_SYMBOL(__WARN_trap) +THUNK warn_thunk_thunk, __warn_thunk + .popsection /* @@ -60,7 +62,6 @@ EXPORT_SYMBOL_FOR_KVM(x86_verw_sel); .popsection -THUNK warn_thunk_thunk, __warn_thunk /* * Clang's implementation of TLS stack cookies requires the variable in diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 83f51cab0b1e3..87dffa7a95a4e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -3731,7 +3731,7 @@ ssize_t cpu_show_vmscape(struct device *dev, struct device_attribute *attr, char } #endif -void __warn_thunk(void) +void noinstr __warn_thunk(void) { WARN_ONCE(1, "Unpatched return thunk in use. This should not happen!\n"); } -- 2.52.0