From nobody Fri Oct 23 15:53:27 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jB6xg50ZRz6xCCK for ; Fri, 23 Oct 2026 15:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jB6xg443pz4kD4 for ; Fri, 23 Oct 2026 15:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792770807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GMCcYxyL4pE7qD5lViroGDBA6Ip3vLqSw3rUYy1MfkI=; b=xwqkENbRuQktF2xoQxF1sCoW4rzy1zeul0D+4UJNqA3jK+rQ6FtEFAE1sW2bH7eNwNJYTx L3XhcYoE9XcKc+84be8bdaGOrdAjn2bHOL6E0leZBopAhlppSuudDMayIvKpqFCApTPagT /8WRd1QIoZXShral40jspPTFxa3OywPv6V0m7V/R6PFa4b13UymsS5DJ3xhidpxYoVk19B i0YhEKi1Bo3AZL196EHZhX6yrRmj7x7eodRJrc98+9HF+FutYLMISsEA6YnVLd74FEoO20 p+m82IHoFcuFZtFvrBrQW+QFTiQyINbeN8qsTqLvU3FyHrJJpKitWMjVfjcnmQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792770807; b=fobUigcijvBBLIke0VJELbFud2xhJi5EUGXVUIplCG8oRFDaxc8tsnA7BZGSQ4L438NnIm L4n3vYHnffJqlkuhOCdjhgqFb68a7C2xfELJYPZ9EzjLJyVhbg7aqDL7dntRd1qXWs+IYu vVFVfVF+h+RdSQP+dOCI4NqxZ9MvIvnoimBcBgaT+mDh45ME90wn2bWJV9DMgOy0QAZSxQ 5hfpb3+ba2KksDdKAPbN6inJIvq3ecntjDYDEZ1cflEeXPYkfeLfG5/EK6NZPYuVg/Rj9q sQC4vznpU1aSQnh5S2+JQc14Xt70yAT+gHmt+69HpMB+/yOuBxYWHcdKe7KRKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792770807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GMCcYxyL4pE7qD5lViroGDBA6Ip3vLqSw3rUYy1MfkI=; b=GmkCTfT2mRt1iCCtdsP1LceTDYKfrh4wMrt4FJBaFUKwvmvhepbijkMocplZ4C/qUomO7s S5zYRVw45VWxwxzOA5aDcJZt5R7TtDDeJxb0dNEBjcnXuxjNJbUheVWyfHmMZH+8Jyqs6H nBkv3ZdOTicNEvB4/eeItSl+Hc/Dfcc6R7YsPkN4/OFNuNpH7BoVBLaBvfS3AJKC3pjikX ppJNpfLfMDdx+k35rjGjs/OjpYOBqvmcp+ETGdeUoxDmKoijrhCe+qwB1nJ5p2q2R94BIZ nEfb95AhB+3Qw3pSGKOnW4InvaPjjfY6aHUkt05A0fCZonh95ll3rEU0CS3AnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jB6xg3lJvzd3b for ; Fri, 23 Oct 2026 15:53:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37c80 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 23 Oct 2026 15:53:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: bea44a836317 - main - kernel: Use external retpoline thunks List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bea44a83631704110de8bbd7693b683c81d4fe55 Auto-Submitted: auto-generated Date: Fri, 23 Oct 2026 15:53:27 +0000 Message-Id: <6adb82f7.37c80.4c72d8ef@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bea44a83631704110de8bbd7693b683c81d4fe55 commit bea44a83631704110de8bbd7693b683c81d4fe55 Author: Ed Maste AuthorDate: 2018-03-16 02:29:38 +0000 Commit: Ed Maste CommitDate: 2026-10-23 15:53:05 +0000 kernel: Use external retpoline thunks External retpoline thunks for amd64 and i386 were added in commit 74d971fe1561 ("x86: Add external retpoline thunk"). Use them when WITH_KERNEL_RETPOLINE is set. There should not be any material performance impact -- the call sites are identical, and this just replaces (on amd64) compiler-generated __llvm_retpoline_r11 functions in each object with our __x86_indirect_thunk_r11. After this change we could implement boot-time patching, replacing __x86_indirect_thunk_r11 with just jmp %r11 when retpoline is not required. Note on i386: An i386 build WITH_KERNEL_RETPOLINE was successful, but has not been extensively tested. Clang may use registers other than just eax on i386 and so in the future additional thunks beyond the one added in 74d971fe1561 could be required for i386. Patches are welcome if this is important to you. Reviewed by: kib Sponsored by: The FreeBSD Foundation --- sys/conf/kern.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 83881cc05b94..35b7a66bab49 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -246,7 +246,7 @@ CFLAGS+= -fstack-protector-strong # .if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Mretpoline} != "" && \ ${MK_KERNEL_RETPOLINE} != "no" -CFLAGS+= -mretpoline +CFLAGS+= -mretpoline-external-thunk .endif #