From nobody Fri Jul 24 20:51:08 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 C097E3F328F for ; Fri, 24 Jul 2026 17:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784912507; cv=none; b=fJPmwc8fIm9d3+ugzNUQ+zjpOJl13NFN8ckTu+jijPyfhGAIceq8ugYdlZgtR+LJ4ooqMGYN09mP26TleH8HJdN8fvdu15nul6CFtzDF/D4l9Sng6rRqVaTTCa2fwHUR1YnLYXd+4fHNjnXvSwgxVACdAXsGqgu1G9CgDkGLMJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784912507; c=relaxed/simple; bh=NYj+eTtxAqvadIcZfHt5XhMrogsytK7vyrzUZuzSgC4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Yn0L3Y3JtsNGHfkZehyFduSZwGCBZYQjq81cb0nl5CeBg3AeAjFkKId5P0Ms+K/pey4SQO4V9oJREXrY1fshh8ClXnDswQNivnD6MmKWETPxEkOxkUyMi+hhOaV/ikFcGxCNthMd7FYh3B25I9SY5W5B7MVVxJHVEhZ1MO/geRY= 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=bSu7NR2i; arc=none smtp.client-ip=170.10.133.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="bSu7NR2i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784912503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=BZktO/gi5TYKbrSSgcg4YA+R7zPX2u1qrVEEQZusSxE=; b=bSu7NR2iIvpdg3ECvXHNnRVUxrTAgHfXuYd/pSG4sZY64/F4yZqel2pvTpq4CgVDIk+Nrm TUxgOzjs30hbPrAGRxnO6CKLwnfYtHN6HCsOuhBJDIlMRDGJpcpcDLHs2zrKadi0ikSEwb HIQ2TNAVQZdYLg+nCAuCrkmW0nMgHt8= Received: from mx-prod-mc-03.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-576-HVDgtrHTNieVSNbwpi0UMA-1; Fri, 24 Jul 2026 13:01:39 -0400 X-MC-Unique: HVDgtrHTNieVSNbwpi0UMA-1 X-Mimecast-MFC-AGG-ID: HVDgtrHTNieVSNbwpi0UMA_1784912497 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C5C7D1882804; Fri, 24 Jul 2026 17:01:36 +0000 (UTC) Received: from paumurph-thinkpadp1gen7.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C95A630002E2; Fri, 24 Jul 2026 17:01:33 +0000 (UTC) From: Paul Murphy To: Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?UTF-8?q?Onur=20=C3=96zkan?= , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: [PATCH] rust: enable fentry support Date: Fri, 24 Jul 2026 12:01:26 -0500 Message-ID: <20260724170132.3783816-1-murp@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" Turn it on when available if CONFIG_HAVE_FENTRY=3Dy. Rust support was added in 1.98.0 with support for x86 and s390x targets. Signed-off-by: Paul Murphy --- Makefile | 2 ++ scripts/generate_rust_target.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index bfb47ad8cb9a..bdfe93702a33 100644 --- a/Makefile +++ b/Makefile @@ -1053,10 +1053,12 @@ ifdef CONFIG_HAVE_FENTRY CC_FLAGS_FTRACE +=3D -mfentry CC_FLAGS_USING +=3D -DCC_USING_FENTRY endif + RUSTFLAGS_FTRACE :=3D $(if $(call rustc-min-version,109800),-Zinstrument= -mcount=3Dfentry,) endif export CC_FLAGS_FTRACE KBUILD_CFLAGS +=3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_USING) KBUILD_AFLAGS +=3D $(CC_FLAGS_USING) +KBUILD_RUSTFLAGS +=3D $(RUSTFLAGS_FTRACE) endif =20 # We trigger additional mismatches with less inlining diff --git a/scripts/generate_rust_target.rs b/scripts/generate_rust_target= .rs index 3bf296581a88..eb80a06d50d3 100644 --- a/scripts/generate_rust_target.rs +++ b/scripts/generate_rust_target.rs @@ -198,6 +198,7 @@ fn main() { ts.push("arch", "x86_64"); if cfg.rustc_version_atleast(1, 98, 0) { ts.push("rustc-abi", "softfloat"); + ts.push("supports-fentry", true); } else if cfg.rustc_version_atleast(1, 86, 0) { ts.push("rustc-abi", "x86-softfloat"); } @@ -240,6 +241,7 @@ fn main() { ts.push("arch", "x86"); if cfg.rustc_version_atleast(1, 98, 0) { ts.push("rustc-abi", "softfloat"); + ts.push("supports-fentry", true); } else if cfg.rustc_version_atleast(1, 86, 0) { ts.push("rustc-abi", "x86-softfloat"); } base-commit: 7059bdf4f04a3e14f4fafb3ac35fdca913e3e21a --=20 2.55.0