From nobody Tue Apr 7 03:14:27 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 41417308F0A for ; Mon, 16 Mar 2026 15:47:27 +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=1773676048; cv=none; b=ULBmQc9lq/PMjulQIerGfHrZ9U+WWtfFVl/NHqpIntDDcNuJwnWAyw+dftqInb09Pinllsqjjtookr1L63e5fzYcWgPR7v69gABOvjLewZBizDJHTQ30Ery1HhFdVVDeV1eU/iikcpMjx+eU0hvz+uFhETPx0MToCTa6kgkTCIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773676048; c=relaxed/simple; bh=fi5JLAbOTl/+1Nk3gJx/MoRlnQFDtzWfQs1ISlV2qGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=hxuNze4zHy9XvTiOiDRqQaCvYNT/jUo6swPx5pl8xrAcDE+qvmgGtHOGsnLPRR70xdBJpHipF2pNnDN2eMrIng5OoTbMU9Q0EMtBJg7tx2ltobqLx/iV6HIUG669v5s7abL6bgaFKG2cgG8KyKC5JYVELuwAWqs/A3IraFqsxck= 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=pGRFTCw1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eDzGvxxR; 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="pGRFTCw1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eDzGvxxR" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773676044; 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=NYU2DjWIvo/s2zAJBv/B2HsELMqSCe9+by7E9gQC1/M=; b=pGRFTCw1qX1U1EjlPxvi62RAGXgFa1j0bdwSrWrjgjkb+BCyP8jQ3dvrtoWq740MRgmZlX o4w0G4ZuCn8bYGW/5I2F6XYA+SgR/j1wR4n4E3bqAcNa97Jd0LTHEicbqaI8wKf/sl2Egl 7UNWqbEuR4IRCMcWjZY+Ao8GpURWgnK+215/9oFemF885zloqYueYuMTjxOd8LasuizNE4 aRDNDXMhAi51aMATGhuA0FRzVmC8DylsXjVtkACCu0zsBBULcXDlM3D8nK4ElgM3Ry6V4T tmg27WrEZ7Fe6276PCgXOt97Po2M1x/UT2ca+RGDc+W1iylYpx34sXwJ/bPNQw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773676044; 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=NYU2DjWIvo/s2zAJBv/B2HsELMqSCe9+by7E9gQC1/M=; b=eDzGvxxRghHVmyWWP81q9AskhFLwYYWKNNSa9dJIqZ38FRzVRP+ssuydFLDlb8yd3l/pBQ ifm9UQeeIHKqy4Cw== Date: Mon, 16 Mar 2026 16:47:24 +0100 Subject: [PATCH RESEND v2] powerpc: 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: <20260316-cc-can-link-powerpc-v2-1-17af7cfce88f@linutronix.de> To: Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1773676044; l=1975; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=fi5JLAbOTl/+1Nk3gJx/MoRlnQFDtzWfQs1ISlV2qGU=; b=CjL0tKZwNG8h2luQxdMRaaAJfexb2Adw29ULcbfSlA+DcUjDP4ELrnl1kuZX0V+mcNMPI1Rlu POjtXQF2sOGAjNmQ7TCt3O7ZBd+lH0mrk8entk73vtfJteQEt6BMgPx X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic CC_CAN_LINK detection does not handle different byte orders. This may lead to userprogs which are not actually runnable on the target kernel. Use architecture-specific logic supporting byte orders instead. Signed-off-by: Thomas Wei=C3=9Fschuh --- Changes in v2: - Rebase on v7.0-rc1. - Link to v1: https://lore.kernel.org/r/20251230-cc-can-link-powerpc-v1-1-8= 2298df6e3bf@linutronix.de --- arch/powerpc/Kconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index ad7a2fe63a2a..793e6b311143 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -127,6 +127,7 @@ config PPC select ARCH_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE select ARCH_ENABLE_MEMORY_HOTPLUG select ARCH_ENABLE_MEMORY_HOTREMOVE + select ARCH_HAS_CC_CAN_LINK select ARCH_HAS_COPY_MC if PPC64 select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL @@ -1343,6 +1344,20 @@ endif config PPC_LIB_RHEAP bool =20 +config ARCH_CC_CAN_LINK + bool + default $(cc_can_link_user,$(m64-flag) -mlittle-endian) if 64BIT && CPU_L= ITTLE_ENDIAN + default $(cc_can_link_user,$(m64-flag) -mbig-endian) if 64BIT && CPU_BIG_= ENDIAN + default $(cc_can_link_user,$(m32-flag) -mlittle-endian) if CPU_LITTLE_END= IAN + default $(cc_can_link_user,$(m32-flag) -mbig-endian) if CPU_BIG_ENDIAN + +config ARCH_USERFLAGS + string + default "$(m64-flag) -mlittle-endian" if 64BIT && CPU_LITTLE_ENDIAN + default "$(m64-flag) -mbig-endian" if 64BIT && CPU_BIG_ENDIAN + default "$(m32-flag) -mlittle-endian" if CPU_LITTLE_ENDIAN + default "$(m32-flag) -mbig-endian" if CPU_BIG_ENDIAN + source "arch/powerpc/kvm/Kconfig" =20 source "kernel/livepatch/Kconfig" --- base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f change-id: 20251222-cc-can-link-powerpc-5ddd2469fd5b Best regards, --=20 Thomas Wei=C3=9Fschuh