From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 703B91F585A for ; Wed, 2 Apr 2025 23:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743636167; cv=none; b=c4eNVfJgkhmJOtjznFiFUUM+Aw49q38LCxPA6cf5HoKhbn4JZLiwpbqJpU2BuPS/5WClH2SmwwSuKSxS92GDFhAqKgoD2olSOMacfQA02hhgCzGDxtn6N5HH6PjRLsGWGhJ1SsjnsvUUfdwSo9+rO1H3CZX7Audn8wfXS9w6OBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743636167; c=relaxed/simple; bh=isyr4ncjJ3SBQdCYaGRbOfH6r2m2rRrczv7I3ZV6osM=; h=MIME-Version:Date:Content-Type:From:Message-ID:Subject:To:Cc: In-Reply-To:References; b=k0weQ73n0bKAjeKAKTCfxH/AV+Ikd84D0UaQ0RoahOIoB0MQagaswkA2MF9mBXM4z+sfP7Dqkp2awSetZvk31pFJcXXmVCK2cUJtRMgy0vfZNqHBWTn8bKRmJejURnO1IXr6GUEw8PueoKq1+ZOPT2DJPCakWbMjWFQ/bSGoZzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jECkKzbF; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jECkKzbF" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1743636163; 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: in-reply-to:in-reply-to:references:references; bh=BgIONT4wQ07PU/U45BKCs+rhhpDdreAs5X6DXIqqC7s=; b=jECkKzbF7VtWW+p4Bf3+Ad355Jx6/OMGR69l1+WuJQZCwI4FmbAbxxYMayi9Sn5105D8R4 Zf+VFF5NYyVpLTCI95DGF3nhrrFKTuBTULHqQ/LLUWTnZeumggji2vauwm7/+bLWoOJ7R4 4WSVuC4Odiq2UFFOHiRTcoGnXS4XbHg= Date: Wed, 02 Apr 2025 23:22:40 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Ihor Solodrai" Message-ID: <6acbc2347a86153c2646a4bfebaa226e9b0e01f7@linux.dev> TLS-Required: No Subject: Re: [PATCH] scripts/sorttable: Fix endianness handling in build-time mcount sort To: "Vasily Gorbik" , "Steven Rostedt" Cc: "Masami Hiramatsu" , "Catalin Marinas" , "Nathan Chancellor" , "Ilya Leoshkevich" , "Heiko Carstens" , "Alexander Gordeev" , linux-kernel@vger.kernel.org, bpf@vger.kernel.org In-Reply-To: References: X-Migadu-Flow: FLOW_OUT On 4/1/25 6:15 PM, Vasily Gorbik wrote: > Kernel cross-compilation with BUILDTIME_MCOUNT_SORT produces zeroed > mcount values if the build-host endianness does not match the ELF > file endianness. > > The mcount values array is converted from ELF file > endianness to build-host endianness during initialization in > fill_relocs()/fill_addrs(). Avoid extra conversion of these values duri= ng > weak-function zeroing; otherwise, they do not match nm-parsed addresses > and all mcount values are zeroed out. > > Fixes: ef378c3b8233 ("scripts/sorttable: Zero out weak functions in mco= unt_loc table") > Reported-by: Ilya Leoshkevich > Reported-by: Ihor Solodrai > Closes: https://lore.kernel.org/all/your-ad-here.call-01743522822-ext-4= 975@work.hours/ > Signed-off-by: Vasily Gorbik > --- > scripts/sorttable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/sorttable.c b/scripts/sorttable.c > index 7b4b3714b1af..deed676bfe38 100644 > --- a/scripts/sorttable.c > +++ b/scripts/sorttable.c > @@ -857,7 +857,7 @@ static void *sort_mcount_loc(void *arg) > for (void *ptr =3D vals; ptr < vals + size; ptr +=3D long_size) { > uint64_t key; >=20=20 >=20- key =3D long_size =3D=3D 4 ? r((uint32_t *)ptr) : r8((uint64_t *)= ptr); > + key =3D long_size =3D=3D 4 ? *(uint32_t *)ptr : *(uint64_t *)ptr; > if (!find_func(key)) { > if (long_size =3D=3D 4) > *(uint32_t *)ptr =3D 0; Hi Vasily, I can confirm that this patch fixes BPF selftests on s390x: https://github.com/kernel-patches/vmtest/actions/runs/14231181710 Tested-by: Ihor Solodrai Thank you!