From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A2C8418DF9D for ; Sun, 16 Nov 2025 05:15:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763270123; cv=none; b=c95ODtT3iOZUhgO/BKwwDzXobqAXzjAfxOjntcc7XmyaxQjpEYmpuIYzydHWLX72/4YRsTj2UQm5Efb2XdIRMsWaluVrjnd6tmjUnJTqtpCle6eW3j2mun5IxOew/ZxBvgCyQ2BAQ5xxYRbqkJjfYb3ci3Ccxzn4jDEVxHNqLac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763270123; c=relaxed/simple; bh=dNLCN4xzJHk6Kx1G6l5URc9pyC3bZpgJBBPCsARSj6Y=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=jnx1PwFqDpjJ+3/zcTNoGY/LpSAxPfT9gWR479fLP+1x+FACEiW8MmPR85GtrGXVlQosFZdXlv/pLiO2C1c/WREE5hwtz/TB3pTS0SARme4tFf5Nul0Rn948j3JYf4EY4Q65UQquMCEsZhYqYMmeWwjEQAPGUahVCRMul8FxSBY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M6KRXOcm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M6KRXOcm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60650C4CEF1; Sun, 16 Nov 2025 05:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763270123; bh=dNLCN4xzJHk6Kx1G6l5URc9pyC3bZpgJBBPCsARSj6Y=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=M6KRXOcmL+/wOdSVNdXiMq4a4HDT9N0DqU6tYhh8DHBFVX78uJTwZma0RQaT/wTEV CHCXSCfQISc36CNhW/iyZuqXcUARA/4TCQXHewebZK+TGMQ8iCi0FUTExYdOdalRLm gVqEwEjZXvZrY+PlxVimT5yfud7vuPLqKbkVrP90WBWQNx+bhM3HIdmoLuPtfRe1Zz xNW2Tr3S8Hk0QnHXhHrufe8LOGG0VpIV/dSDyiTaR2jX+mGKYQnN6GVxvsaaq1A1wL KDgx0NCNJK1El2U5FdG5s1NYbw10Zs2QoCqtgOLNOBfTSX0sJdiV+TWZZrjpzI1nUY BzZf0XF7hihiA== Date: Sat, 15 Nov 2025 22:15:19 -0700 (MST) From: Paul Walmsley To: =?GB2312?B?0O280b+t?= , Nathan Chancellor cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , namcao@linutronix.de Subject: Re: [PATCH] riscv: fix KUnit test_kprobes crash when building with Clang In-Reply-To: <738dd4e2.ff73.19a7cd7b4d5.Coremail.xujiakai2025@iscas.ac.cn> Message-ID: <621798fc-68bc-504c-755f-0a2f1f83d1c2@kernel.org> References: <738dd4e2.ff73.19a7cd7b4d5.Coremail.xujiakai2025@iscas.ac.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1421703746-1763269127=:3638584" Content-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1421703746-1763269127=:3638584 Content-Type: text/plain; CHARSET=GB2312 Content-Transfer-Encoding: 8BIT Content-ID: <1ff382db-44ce-50a3-d880-c25b51849d02@kernel.org> + Nam Cao, Nathan Chancellor On Thu, 13 Nov 2025, ΠνΌΡΏ­ wrote: > Clang misaligns the test_kprobes_addresses and test_kprobes_functions > arrays, or does not export local labels by default. Both can cause > kmalloc_array() allocation errors and KUnit failures. > > This patch fixes the issue by: > - Adding .section .rodata to explicitly place arrays in the read-only data segment. > - Adding .align 3 to align arrays to 8 bytes. > - Adding .globl to probe labels to ensure symbols are visible. > > For detailed debug and analysis, see: > https://github.com/j1akai/temp/blob/main/20251113/readme.md > > Signed-off-by: Jiakai Xu Hello Jiakai Xu, Thanks for the patch. Have you reported this difference in behavior to the Clang/LLVM folks so they can render an opinion on it? We can consider this as a short term workaround if it's indeed a toolchain issue, but I'd like to hear from the LLVM folks. Also: could you please include the narrative from your page https://github.com/j1akai/temp/blob/main/20251113/readme.md in the patch description, just in case that URL eventually becomes unavailable? thanks, - Paul --8323329-1421703746-1763269127=:3638584--