From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30804191F75 for ; Wed, 15 Jan 2025 17:57:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736963878; cv=none; b=JsVj6GypwFMcwolLOACNk0Wt2Ku1qCMFZnCA6752L0DIxS9k0jSmdINPSRXiTjzWKLViUSgrir9U66ouFkO3/MwlM2D9KOGT1finZse5dNqQZrvXVIHjIcMWsMedRJexRjx1KtuXDoGvtt7F+Hr5sZTf84EAB5bydRwufgvkCQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736963878; c=relaxed/simple; bh=LZQ8fPjz687OON6jUEjJHXKOtHqb1s5cvAQZuOJFRYQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Tj5G4jiyq7Kh07HxAeg3MJbxmBXZflDo74eSxpO0Ei8675ktikb1YKkrM/eK4AMlMxAAqXNZxu6VF6dtLJbwIEMjfd/OzS8yCppf8eQZm5Kp2Q80WDAl0+iuPvtdU5zsN53yTFzKqnSEOG/7zruTURPva1C5nOoip+dH3GwgWcg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WWiYQGLk; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WWiYQGLk" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-844de072603so1528939f.0 for ; Wed, 15 Jan 2025 09:57:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1736963875; x=1737568675; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=kchx5FBff+Jkr7uune4RFLdzHTx4luoy6cm+6F6IEz0=; b=WWiYQGLkK2BkN2Q/qjbzCk/C1hClDvGy+vbE/YezLeZVKc34PXvhgMRsyt81DuhbK1 vlbmXQSgr/jsQBfgfaasVtSUnGqMwofLBeylBVwrkBEuJknJk80bY6o8njRy8JKlmwsF 9IGmCWl+//0F/jZ2UohxulukaIu7BbibHwLVE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736963875; x=1737568675; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kchx5FBff+Jkr7uune4RFLdzHTx4luoy6cm+6F6IEz0=; b=FtInCINEKneidVyF4ZK3eVc34+Mgwm4Qpbe3Z9y15NmRtPcW/qBCx2kHEIXQJcv772 ERO7ARgK9rcyVGcqM1ddh1foiUhRk42AvujW6L6+TZNZSmA4lh5Cita+/N6yxKfkl8hG VOqtttTrArHzyh+mU57NZlegVLf0l96dX3TYo7aiBWw4VJ0xpsR1BL8Afycpg/LMDN9x QAr9wD2FfSfi/PiLgkU6FawcgEMtIrNbxCzracaZqtrblLvKUXPozJp705M8NiSWGT1o fiTs/AYkYyNI7PSFC5JkfX5ViiXVIC2kwEudhRBymERKXDIjuEsSrfvAR/9ojVjNEgWB fYgA== X-Gm-Message-State: AOJu0Yz9ZKwrgBNq5X2egsao7GI7n06PltpXqgMrVsQ3zGoY4TQ118PR 2BmbajnFImkCSx6yLBso/uTWCtso8N8yqXDgGocUPZIHbaXaSPLs7AyUwPQdsC0= X-Gm-Gg: ASbGnctfMxvAgWwudzYPRAoY00mDKID2ilUM/XGR2Y0B/lEd6kmPwHp1cvoLPy1H27O y25PJLK4DjuYNs2+yPuyCekASsh9N11wTxwYguo/j+x//85R6mTjnBkwYuF+yKkzaGzrFjlBune 3v6wr6V1awVcUI7Zl5U+3W/AYPCUAzyuHJpPYL0rD5eRnQcBHZS/Gf8LwEr2mRfq+XwwIiZVPRI rxBTIA/Bv182UXHbv4MM/JSLC6uAmDrnXLuGo5CxA9YlwSq6xIy4D9pNH/YFez9Dl0= X-Google-Smtp-Source: AGHT+IGstEoRVFWLCX1rvF+GzBxjB+Sl3fQa9h+tTaAmxar0MaFf0w/59fRqmG4CurK8euJFsPuFxA== X-Received: by 2002:a05:6602:418d:b0:84a:7902:d424 with SMTP id ca18e2360f4ac-84cdfdce129mr2968127539f.0.1736963875219; Wed, 15 Jan 2025 09:57:55 -0800 (PST) Received: from [192.168.1.14] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ea1b718433sm4164039173.109.2025.01.15.09.57.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jan 2025 09:57:54 -0800 (PST) Message-ID: <0e4bfd16-76da-430d-a7a4-f1d31448ea43@linuxfoundation.org> Date: Wed, 15 Jan 2025 10:57:53 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests/rseq: Fix handling of glibc without rseq support To: Mathieu Desnoyers Cc: linux-kernel@vger.kernel.org, Raghavendra Rao Ananta , Peter Zijlstra , Boqun Feng , "Paul E. McKenney" , Carlos O'Donell , Florian Weimer , Michael Jeanson , linux-kselftest@vger.kernel.org, stable@vger.kernel.org, Shuah Khan References: <20250114145132.612569-1-mathieu.desnoyers@efficios.com> <9b7228cf-29ed-4f35-8b8a-b4f8482c434e@linuxfoundation.org> <28c050bb-d844-4b85-a49b-39f2defc20ef@efficios.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <28c050bb-d844-4b85-a49b-39f2defc20ef@efficios.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/14/25 17:45, Mathieu Desnoyers wrote: > On 2025-01-14 19:14, Shuah Khan wrote: >> On 1/14/25 07:51, Mathieu Desnoyers wrote: >>> When porting librseq commit: >>> >>> commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") >>> >>> from librseq to the kernel selftests, the following line was missed >>> at the end of rseq_init(): >>> >>>    rseq_size = get_rseq_kernel_feature_size(); >>> >>> which effectively leaves rseq_size initialized to -1U when glibc does not >>> have rseq support. glibc supports rseq from version 2.35 onwards. >>> >>> In a following librseq commit >>> >>> commit c67d198627c2 ("Only set 'rseq_size' on first thread registration") >>> >>> to mimic the libc behavior, a new approach is taken: don't set the >>> feature size in 'rseq_size' until at least one thread has successfully >>> registered. This allows using 'rseq_size' in fast-paths to test for both >>> registration status and available features. The caveat is that on libc >>> either all threads are registered or none are, while with bare librseq >>> it is the responsability of the user to register all threads using rseq. >>> >>> This combines the changes from the following librseq commits: >>> >>> commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") >>> commit c67d198627c2 ("Only set 'rseq_size' on first thread registration") >>> >>> Fixes: 73a4f5a704a2 ("selftests/rseq: Fix mm_cid test failure") Fixed this commit id commit c7b45750fa85 ("Adapt to glibc __rseq_size feature detection") >>> Signed-off-by: Mathieu Desnoyers >> >> Hi Mathieu, >> >> Can you double check these commits and make sure these are right >> ones in the mainline rc7? >> >> I am seeing "Unknown commit id" warnings on all of these - my >> repo is at 6.13 rc7 > > This is because those are commits in the librseq project at > https://git.kernel.org/pub/scm/libs/librseq/librseq.git/ > which is a different tree from the Linux kernel. I am not > sure what is the preferred approach when citing a > commit ID from a different project ? > > I've been keeping both rseq selftests and librseq in > sync since 2018. I plan to eventually add a dependency > of the rseq selftests on librseq, but this cannot > happen until we freeze the API and cut a librseq > release. > > This was premature before we reached the major milestone > of having extensible rseq support in glibc. > > Now that it's merged into glibc (as of last week), > we can start looking forward to a librseq release, > which should eventually eliminate code duplication > with rseq selftests. > > Perhaps we should add a Link: to the librseq > repository ? > >> >> Also would you like to add Reported-by for Raghavendra Rao Ananta? Added. The patch is now in linux-kselftest next thanks, -- Shuah