From nobody Thu Apr 9 12:08:48 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 61BB931618B for ; Fri, 27 Feb 2026 06:48:54 +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=1772174935; cv=none; b=XUXTjxaUFMgxAUXQphcUUZYi/1LEBxDZb/FRdmLQiYxrSbBhj3AUHGAksNvAR/5p09MjXwbfONRIWFWP3zL65/bREQDJ69vyebrwqHGRXgsueVGZKWWHaPqf87XMZNlQ9fjuFp0wLAj+EfV1iOsegdidukf+ICkaARETi5gLFHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174935; c=relaxed/simple; bh=qH0LSdlenohRxcLyGIwUFSigW7NIvoAXO5q5y8kP2G0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=aUkDBPPzM064hVBFC4JmNoOzhuqjMXMJzyMpFZacHC65/ZawguHXcWs8aO0SJ/A7q9VYXZuCfROHjXL0IOq1IRjLTPw2p4dZChq99QrJUVVtjrpxP9M4/x6c94cfcoRCFdLUnOnjanU9BvIjQdve1GBLcYc/q3hdqGGb8tKR6pE= 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=ZsZZTa9z; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=23BYSDvI; 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="ZsZZTa9z"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="23BYSDvI" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174932; 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=6dWezDDAam5qX7uulfxL4pNHM6LsBO71YEy22CGzCDY=; b=ZsZZTa9zqkwsPb0IRHJbeAYCVYLHexdou69AG9cxFAtYodPtNuXxt8HMvWkmCnqV4JOHoZ YyKb1mNkTm/wdow9uBkUHMYouWWNYx9DSv6fws3ZDHTQM6V0zIiTSyX+MROS3OK18QpXez rfAQOqU9K6hh1LwOsxY4tOrR+Im6tCKLhPUWfwbneSezuwTB35rW3E7RejwqImnZv2IQiz 0usRS7cWo3moe0gKXjepKOSkp1LZTmPegZnL88sQjsIpLL4HQ14SXdLTOHYv1o6pKBazEZ C3tXCoaMZjf5EjlSeMemNSnwgj80UDRrZ2SAzj75pjBo0ia2cqqUJL38DwvczQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174932; 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=6dWezDDAam5qX7uulfxL4pNHM6LsBO71YEy22CGzCDY=; b=23BYSDvI/ZpaMsmlQK4PCKPli1plANdqoAeqwVGR+DAJfsW6rXxoBZH83555thR6wsIq6h gFXQhzo1wkNOQoAw== Date: Fri, 27 Feb 2026 07:48:48 +0100 Subject: [PATCH v2] 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: <20260227-cc-can-link-x86-v2-1-dae7dfcb1a19@linutronix.de> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/3WNwQrCMBBEf6Xs2RU3WFM8+R+lhzTZ2kVJJKklU vLvxt49vhnmzQaJo3CCa7NB5FWSBF9BHRqws/F3RnGVQZ1US0optBat8fgU/8DcXXAy2lDLbM9 uhLp6RZ4k78Z+qDxLWkL87Acr/dL/rpWQcNSWyGltOke3Wr2XGLzko2MYSilfIxH2krIAAAA= X-Change-ID: 20251222-cc-can-link-x86-fa7a15eec4db To: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772174932; l=1586; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=qH0LSdlenohRxcLyGIwUFSigW7NIvoAXO5q5y8kP2G0=; b=mNkMbkveOzslTQ8d2JhY8YYqtH3mwAxtepSbzzpdZH8w4pvBVeJco+rzxxA5nKeq2Oj4RO1Xs Q3yEU13dk7nATCkG5EWLV7JKE1BbpUgnqqwbryytscSr08yHb81R3ik 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 --- Changes in v2: - Rebase on v7.0-rc1 - Link to v1: https://lore.kernel.org/r/20251222-cc-can-link-x86-v1-1-b7c11= d77a8d1@linutronix.de --- arch/x86/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e2df1b147184..192b592b647c 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 @@ -3185,6 +3186,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: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f change-id: 20251222-cc-can-link-x86-fa7a15eec4db Best regards, --=20 Thomas Wei=C3=9Fschuh