From nobody Sun Apr 5 13:12:44 2026 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 407E13DD528 for ; Tue, 24 Mar 2026 09:49:50 +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=1774345791; cv=none; b=JSwFQn+d54S4ScUgJQPPzbOACjOUMFOZyc1qX/5kcdrsJ6j980UYnzA20bVXxPFrH+WHUrONVRQMalPZjWFj+tZiw67lJa/JDzCxm90leRYg89E6G1eOOIrNAADdbx6hDMNKOaLYNy9cIsfzTZ/YqUiNRPeBzx2T9CctwroCato= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774345791; c=relaxed/simple; bh=PydM+q7fKSo44l/v6IFdJAmQkeutCSBP5jnsFNy+4PU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BnalW8XE/gM2GVn9KHAjvYtgV7UICcFOZ/9NsUBQpX8NJTHYoOw/A8Kc4r2nHvZA/Eyrnn8BPGFHG05ITXshP6rTwek/7V62leeHBAB4nHGpQ2B/aI5DPRqtLRaW2GL/T8Gy7ROUwpfeDfpGiKd98xeYObrWxpKWwx9sQERUOs8= 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=Qr25MtKX; 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="Qr25MtKX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774345789; 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=E6la/YGRpfCEF4wUUEPjSzD94dCfNlkWphwgGjyKscE=; b=Qr25MtKXGa9b5n3VQuylZ0M3/qVrtNDUCvzMJ4pW4qL0zCZD4ZpCTXaXkuCniFOvoPTRuf u2CKrGkbf6FZaqaeZvZd4PB5b6jna7E9o5MMLQQ6hrTS8G1EieDoX/ob6wzxbnP8zJSkC+ GW2up/ov7THsa8KWdnvfr2R4hwfLw2k= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-q8xavQyQO_WXuiyIPfHRjw-1; Tue, 24 Mar 2026 05:49:44 -0400 X-MC-Unique: q8xavQyQO_WXuiyIPfHRjw-1 X-Mimecast-MFC-AGG-ID: q8xavQyQO_WXuiyIPfHRjw_1774345779 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 44362180044D; Tue, 24 Mar 2026 09:49:39 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.44.34.246]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C073930001BB; Tue, 24 Mar 2026 09:49:25 +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: [RFC PATCH v8 04/10] x86/retpoline: Make warn_thunk_thunk .noinstr Date: Tue, 24 Mar 2026 10:47:55 +0100 Message-ID: <20260324094801.3092968-5-vschneid@redhat.com> In-Reply-To: <20260324094801.3092968-1-vschneid@redhat.com> References: <20260324094801.3092968-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Type: text/plain; charset="utf-8" Objtool now warns about it: vmlinux.o: warning: objtool: .altinstr_replacement+0x28e1: call to warn_t= hunk_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) =20 +THUNK warn_thunk_thunk, __warn_thunk + .popsection =20 /* @@ -60,7 +62,6 @@ EXPORT_SYMBOL_FOR_KVM(x86_verw_sel); =20 .popsection =20 -THUNK warn_thunk_thunk, __warn_thunk =20 /* * 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 d0a2847a4bb05..1ddf9355a37af 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -3732,7 +3732,7 @@ ssize_t cpu_show_vmscape(struct device *dev, struct d= evice_attribute *attr, char } #endif =20 -void __warn_thunk(void) +void noinstr __warn_thunk(void) { WARN_ONCE(1, "Unpatched return thunk in use. This should not happen!\n"); } --=20 2.52.0