From nobody Mon Feb 9 14:17:12 2026 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 534A633EAF8 for ; Mon, 22 Dec 2025 08:29:44 +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=1766392185; cv=none; b=hmC1zzCu0uLOhTEiRdTzs8SpDEAOQbf3GblSKFzbi4MAvUFzh8+JegizGM3uobO5hr2Uqos1lwyG3Ah4NUparWH7QJxHiufSlnvpfHQS9t652VvU8FXpmSnqTl1tVy9bVl1ihv1dHZ8FxHsQbeu3MlhKRrkGRrJf3kQPpwz6K90= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766392185; c=relaxed/simple; bh=I3nBmJUe/rNdS6Fyx2R01yhR1YE5aR7Daes9oyzDEW4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=lmeUpRfIeLh7NY17mkz4+EzZssXLEMBlCJZDX8QbOVywymiHLXhlR9NpYgdf7pBuuun+oHcytCD7RyF1y6TBMEulhRUeGZPanKc8znJ/ns9CkdT2vym5W71qEbbjzfIfd9DDdYy+Wl/FxAaSictxtzmcDlwEtiRCicRrfcWRQe8= 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=c7CPdEsc; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Xv/F+zRe; 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="c7CPdEsc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Xv/F+zRe" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1766392182; 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: content-transfer-encoding:content-transfer-encoding; bh=X57BEvsOlGR+2wHAkry2o1HA8QHIPpAjpEBpDNWkfiU=; b=c7CPdEsct3aWcsxcnK2Kqd65GXrYNqjyL9jCNtuIoSBfi8MKoLoIPYz330qD1hN4rcUT3a 8X4V0hVoS1rxbfrt9ScshZJ77cCMVwF2VNfTzIM7M5mC8DyYIrNwTg4vnWsiHzlvHAaP8W ZSZ73Uk1V+ysfJcKZFtaz/nvwEB2Z1De/gjLsOnvgaoxTafGnRsLVhxxbXmlpDiq+omqJc HjxQDemnabQemJbYze3jbNntzEvhsxQrYKi8deZc8xDZQ5rLV7UwC863JFsUUuvD2/EYkh rlkHi0PCJo2/hnG/1/aokcY/UxrAwQ4iGwzoZ/QO9cI1stwbjoiFpdM26V8EDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1766392182; 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: content-transfer-encoding:content-transfer-encoding; bh=X57BEvsOlGR+2wHAkry2o1HA8QHIPpAjpEBpDNWkfiU=; b=Xv/F+zRecgn6PjVxA64n6bodORua0nRWEe4CAPr211wy/7UIcGCk8+waZJSgqEqhP3OSSG hAEZcP0hxHPwHFDw== Date: Mon, 22 Dec 2025 09:29:42 +0100 Subject: [PATCH] x86/Kconfig: Implement ARCH_HAS_CC_CAN_LINK 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251222-cc-can-link-x86-v1-1-b7c11d77a8d1@linutronix.de> X-B4-Tracking: v=1; b=H4sIAHUBSWkC/x3MSwqAMAwA0atI1gZs8IdXERc1Rg1KlRakULy7x eVbzCQI4lUCDEUCL48GvVyGKQvg3bpNUJdsoIoaQ0TIjGwdnuoOjH2Lq+2saUS4XmbI1e1l1fg fx+l9P8gZsIdhAAAA X-Change-ID: 20251222-cc-can-link-x86-fa7a15eec4db To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1766392182; l=1445; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=I3nBmJUe/rNdS6Fyx2R01yhR1YE5aR7Daes9oyzDEW4=; b=DJOQwGusyBdWDA5AgKGdiwwhMNgINmR2IiUqmqCe3/m5UjgR18pvprLy4V8wwIPJBGpPGEV5F BjUCqV29uQEBi9njfp0T6AmhD6s/TB+kJWMDSRgREhChQjnIUeGErNN X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic CC_CAN_LINK detection does not work for all architectures. Make the logic easier to understand and allow the simplification of the generic CC_CAN_LINK by using a tailored implementation. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/x86/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 80527299f859..2a43e42e63fd 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -73,6 +73,7 @@ config X86 select ARCH_ENABLE_SPLIT_PMD_PTLOCK if (PGTABLE_LEVELS > 2) && (X86_64 ||= X86_PAE) select ARCH_ENABLE_THP_MIGRATION if X86_64 && TRANSPARENT_HUGEPAGE select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI + select ARCH_HAS_CC_CAN_LINK select ARCH_HAS_CPU_ATTACK_VECTORS if CPU_MITIGATIONS select ARCH_HAS_CACHE_LINE_SIZE select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION @@ -3175,6 +3176,16 @@ config HAVE_ATOMIC_IOMAP def_bool y depends on X86_32 =20 +config ARCH_CC_CAN_LINK + bool + default $(cc_can_link_user,-m64) if 64BIT + default $(cc_can_link_user,-m32) + +config ARCH_USERFLAGS + string + default "-m64" if 64BIT + default "-m32" + source "arch/x86/kvm/Kconfig" =20 source "arch/x86/Kconfig.cpufeatures" --- base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 change-id: 20251222-cc-can-link-x86-fa7a15eec4db Best regards, --=20 Thomas Wei=C3=9Fschuh