From nobody Fri Dec 19 15:48:17 2025 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 9B7E43019A3; Thu, 6 Nov 2025 10:02:14 +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=1762423337; cv=none; b=Uo3j21/UVVfjaiHt6Yqus83gJ+vR/r6dbzm+4otvIjAQ94TeiMOGXQx5CLjYnL3n9Zi7khaNKZP5L1zAY5NyaNkXC1YqLhLJ11z3l7igczD9cfYYY+jvaZkK6rKHwO8pFx4iFxO1E/XofiOwFuC7DpxIEyrTvODRgA6VQtQvDqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423337; c=relaxed/simple; bh=xwlcFnQEXqQ5ZW5NFBVaIG/RI+shPsghmy7vrrzmGh4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kwiQXOnkyTt1FfHhntXTW92Cq1zuffUqkqHkHCitQdzXeAmqUUnZg5cQfVfEFKE3t4QTtW5e40VhQ6OF5enMcIyRaFrOL0zHPdFHEXHPBNz4FQbnME7LUjaAeSfZKRKGOBvbwMh7TnebLbcti509p4S/aEsWgB4zTWxl2RVISgU= 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=3DlZXeko; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=UIrdcFPc; 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="3DlZXeko"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UIrdcFPc" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423330; 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=vpEp5M7NzfQSiFH2jKL570Ai1wZvStN2XYEWzJ3d1nM=; b=3DlZXekoeUVgZGZq1e0UHUf4vqg+iP0Iiv49LFrZb+KA4zg2DvjCmBbDy7TMduS1Vkn+sm 7lygfi+V6fz8N+54m323xijINmw7GRXOynR7P15ZdKKRFQ847u1yLmCtC8r3R4aOU8IDIj 0ZPh22CZilmq3FxLKJWQhqUErxHcNi5auVzMgBWQmx5HFYseRiBmDNp6Y1OyXOouP994Ed 9wE9yVSAipvmGt6X2/0YvMZZVkeHlkdzs7jy27JWaWJZISYo7tzdYUmRz2kmrOfQWhTDxp a1Vdqg37Qisa/UoIFU50Li3Fx32JB1OzFgZ1WPLKdJZM30+axxLPdLvckSyqOg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423330; 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=vpEp5M7NzfQSiFH2jKL570Ai1wZvStN2XYEWzJ3d1nM=; b=UIrdcFPc8+dP8m8pKm+dgGqLTWrzmrlX406z9MxIGmXKut48R0lhhFzf3GmVV5sw2g3cha 4xh1P9O64p472WBQ== Date: Thu, 06 Nov 2025 11:01:54 +0100 Subject: [PATCH v5 01/34] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types 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: <20251106-vdso-sparc64-generic-2-v5-1-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1636; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=xwlcFnQEXqQ5ZW5NFBVaIG/RI+shPsghmy7vrrzmGh4=; b=canjkzbdZHbeS1vGHhpZnqXrZGddUYcT7pedmpgnoiLPVjcEMXGH6bhQX30E0/Jm7w3U4v16Y uVrH006OPfNB/pUPz63LangKR6suhJTmLUPhdNvTeuwHl4NdBc19EoZ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= On SPARC the field tv_usec of 'struct timespec' is not a 'long int', but only a regular int. In this case the format string is incorrect and will trigger compiler warnings. Avoid the warnings by casting to 'long long', similar to how it is done for the tv_sec and what the other similar selftests are doing. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index da651cf53c6ca4242085de109c7fc57bd807297c..5229fcaae8194d51b2cdffdbae5= 9f00cfaeb96dc 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -412,10 +412,10 @@ static void test_gettimeofday(void) return; } =20 - printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n", - (unsigned long long)start.tv_sec, start.tv_usec, - (unsigned long long)vdso.tv_sec, vdso.tv_usec, - (unsigned long long)end.tv_sec, end.tv_usec); + printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n", + (unsigned long long)start.tv_sec, (long long)start.tv_usec, + (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec, + (unsigned long long)end.tv_sec, (long long)end.tv_usec); =20 if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) { printf("[FAIL]\tTimes are out of sequence\n"); --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 9B5F22C029B; Thu, 6 Nov 2025 10:02:14 +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=1762423337; cv=none; b=XujzDNhMg9w86n62ExeDeTUBVC34B1sddeEC9MgblCRHfEW18us6b5e7/ywBoiPO5hui5NOXHO3aKAnI9cb41dEGoMJU5Nu+vjyfZUGwPTiRw0KODTjuv0sKbT0TjeG3q8b7WvbiJxMNO11mWrNQEmAKkk+mYDbkekhYSRXtfCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423337; c=relaxed/simple; bh=/RM2+eho8hCHlVVsxMDHxgwRFdNnaqJNQrWh/y7GNvw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=evGoNrdN61gc5EWvUMvaBVpZHf6LJv05i0QRQu5TTVJSnoUTUIAfZfxhSzLkZay+sh+fHCdIdbSmkSuo0jV9Ff/0V3k9bS1yUnniyy23lqmAufj2HuLcjyAWAa+FWT9n2pAzlDpE32BwRNcZ7Fx2oUaL8kVGGFLq59FDbRH+qVc= 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=hm7jLjPZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wfA+JYYx; 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="hm7jLjPZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wfA+JYYx" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423330; 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=nYjHCuW3ZXlc6zM24pgVvQhnKhBaDHM/f7Xd1AFH00Q=; b=hm7jLjPZC3DNZd+mkVfN1lMzCb3u9kivIlsycw+gwfmiaCsYsN0ANrTxXLlpz5OhDS/4bh WqTGfyX9mGYLHMGKqDbVX/P3iESHlyihWmEGwhDSHW+WsOHGuTqxHlvYnZ3j3h7n9nvLln X9ifkX3o5r5rKMPzGTaXNhJwIp7/8LAlUIJMRbZvH4DgmVt+MVWs9CEEqzMEFIaTEXa6Iu JkYrVPQDma4I2SSoADQZyslE7YrabKx0HCtu4UXD7bT3nsz1J1NCJ+GYbzvZ2mbw6D15/R tbK5uAxCXPC+qTKS7CfH2ZYDmyqjkg/FDEYwypouUlsioepkOd/ygPZ/Q0/nAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423330; 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=nYjHCuW3ZXlc6zM24pgVvQhnKhBaDHM/f7Xd1AFH00Q=; b=wfA+JYYxRMMV+QkT5tYVabNViCFlYaQ2lVXLrOdy8Ok91sBH9uMkSlWws9WuhFHg9Uc6sR LAo0Jb1ENdleDJBg== Date: Thu, 06 Nov 2025 11:01:55 +0100 Subject: [PATCH v5 02/34] arm64: vDSO: getrandom: Explicitly include asm/alternative.h 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: <20251106-vdso-sparc64-generic-2-v5-2-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1038; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=/RM2+eho8hCHlVVsxMDHxgwRFdNnaqJNQrWh/y7GNvw=; b=dZ7KLH36vebcT3Ftq2fW/Lbv53KxGB1dFjCDsdQBFAwF/tOHnrR386UTCh04Ib/bMdTzsbHFG hklbRXwhAROBU6PGi5meyVTV4jtwSlU0eRZ8hJB1KKxaJbs6V5UX992 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The call to alternative_has_cap_likely(ARM64_HAS_FPSIMD) requires symbols from asm/alternative.h. Currently this header is included transitively, but that transitive inclusion is about to go away. Explicitly include the header. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/arm64/kernel/vdso/vgetrandom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kernel/vdso/vgetrandom.c b/arch/arm64/kernel/vdso/v= getrandom.c index 832fe195292b34e2029f593ea170347c98e06dac..0aef124c90899dc0c8956b0f32f= 54992aa3acf0b 100644 --- a/arch/arm64/kernel/vdso/vgetrandom.c +++ b/arch/arm64/kernel/vdso/vgetrandom.c @@ -2,6 +2,8 @@ =20 #include =20 +#include + typeof(__cvdso_getrandom) __kernel_getrandom; =20 ssize_t __kernel_getrandom(void *buffer, size_t len, unsigned int flags, v= oid *opaque_state, size_t opaque_len) --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 9B4282E11D7; Thu, 6 Nov 2025 10:02:14 +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=1762423337; cv=none; b=Or3FvvkqUxGv5sU5wgp/phBFiLmlDQsRM7DLylDp3l59WLegu9p4J6LKy1lGsaryrYkUZMOX3Knr8PlGvE6Kae3njXo/cPlFGCc6BJq+uW/kJytwJ48p7Q8up0c4xJagiURUFF5/aJLyXkUTOuhrTLmi2JYa3y69IV5AEqpoEF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423337; c=relaxed/simple; bh=XfbRCZJaIPPL9RqG5I4uWuUiOvFF0sMMnDdDPpO0Deo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cljTLa5jDFdYcbeoIybtAK+DTeN6vx/qTaKAE18twUn9MrwrdsPOCDb3eeZIT4tmLUzR1+thj1ZpGPHzhVbjQh9zNUAA/kxz0mAI+jL+/BuOSV9NawP+Lqok2xBwnm2wI+pm9U/el8NTugTZTH/qo2r9IlPxxACBmxQq2XLkTZU= 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=CZq9Wu29; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=d8Y4q6xG; 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="CZq9Wu29"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="d8Y4q6xG" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423331; 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=d61fN+YsBbfOpc/TI9xXXEgh8u4ram9nD50U99mHlYE=; b=CZq9Wu29/BJLN8xesS+fKvmG1nv36JlDSJ08JYmTChRiPH3pFjjoTZVsuEHtE7/NjtI9YA YJMEFbkvYTBVSFiTI5rExiIWya8v7PZ5xFs38uZHp2RQKD5RuPIvvxUbt5ByzazItDNu3L mAATXLbZEBLRAKhRfsUTkIfyb8OnQSzlJ1EhzuA7arp2ROcXTteWn9ravQGD5ERyklNRe1 QlUUaNbtCO5xem0Y2pgdj0nAlkOoialkJGgIMCLPp2RTu4WKwAah2lKOLYd+kDV5HcZ7kk xc+QO2kvkbD5clIRDuiddBhx7teFC6hrCM+l+CaNWS4/3hUpjSXTeK+W5ZiHWQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423331; 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=d61fN+YsBbfOpc/TI9xXXEgh8u4ram9nD50U99mHlYE=; b=d8Y4q6xGHeWZSFTaw6xKwtX2QEMXFsfEkbUXtkn6AAQuREvr9ASttKf2YQISbUxSOyht3Q cJYdpKIJ9okV3tAA== Date: Thu, 06 Nov 2025 11:01:56 +0100 Subject: [PATCH v5 03/34] arm64: vDSO: gettimeofday: Explicitly include vdso/clocksource.h 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: <20251106-vdso-sparc64-generic-2-v5-3-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=950; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=XfbRCZJaIPPL9RqG5I4uWuUiOvFF0sMMnDdDPpO0Deo=; b=3GS8tpkvgHKiJsfgHWm5ubVV3I9cKnKzRWQdI3BUDk0saE9EvuDLjaf1Hnk6AktCIMkBuZ3PL IRavzTBjoL5CCZ57tc9RUOnuLxLNp3A1Z6w12JRbI6JL0LWjT+ZOfVN X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The reference to VDSO_CLOCKMODE_NONE requires vdso/clocksource.h. Currently this header is included transitively, but that transitive inclusion is about to go away. Explicitly include the header. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/arm64/include/asm/vdso/gettimeofday.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/vdso/gettimeofday.h b/arch/arm64/includ= e/asm/vdso/gettimeofday.h index c59e84105b43cdb0c823da3dd793a83781f84302..909780bcadae92109b175e23cb0= 5e966683731d4 100644 --- a/arch/arm64/include/asm/vdso/gettimeofday.h +++ b/arch/arm64/include/asm/vdso/gettimeofday.h @@ -9,6 +9,8 @@ =20 #ifndef __ASSEMBLY__ =20 +#include + #include #include #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 9B3902E03F1; Thu, 6 Nov 2025 10:02:14 +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=1762423337; cv=none; b=bZughbX5XgAWswYCiLMc82OLQX29ixAV0EeR4WWzuSFMyUsMUGrnE5M4cZ8ubDQBfdONMSekBjfiGqmD/bBG8UlCuQv65fA9XJkCc8AG1vHJr5AK1zz91fcVqxn5SYHTH/UvG7yKC33FALnQnec3js7bn1i1a+2nTDj7ZB6DohU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423337; c=relaxed/simple; bh=V9tDNcYgJIt9GytAgrSszi/+I+38Gq3Tgc4R1PI5n6s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cY9rWgJP140TWkYpH41JCa427LIQnnQM5Ndor52dNtD52xWye2buKvyKdcXC/XE0xq4q9hD2eZh9QI0lLJF0fClsQYcbtN1+444hsMFNvwllQpbFGGyihAD0cIlSpSj0QB3Wp/u/e6mnIUuulN08UZinmTVOVvKcZjLPq1OgBDA= 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=tFcEZ+F2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dv4aXHzL; 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="tFcEZ+F2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dv4aXHzL" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423331; 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=AA1RaYevhVsm4UU0YhUEK/PYFHQA4HTGOnbLyC3tUCM=; b=tFcEZ+F2McnQR/yj4fr2Xzl/qH8/6ms9DrGJJEA7fL7kXcqCX8hv4zyKd2otBfY37FGEMv 2KoqENjQKbobna/HhKzV0a13m+kQAUyNfbgCcNeMvJwrxOwp4UUkJ5GB31sKEvK26EuVcZ J2nsupkTFncr4BO3FtqqAHgRyL9zPra2lX0RBt7EvpZmeaeHQoP8DGBinFIHBZ9exbk2mq NylqCM6rngQh4QiSqsBmuIdgwx+l77BtrybXZDDzcxnTxiRrQxzTKsgC7LJWm4+DZEOjyZ Anyou1cfZ4co6SXagzJZoC5bQwao2fnYT4x/M9WSE8oOxNat5twRj+yM8uqeiQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423331; 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=AA1RaYevhVsm4UU0YhUEK/PYFHQA4HTGOnbLyC3tUCM=; b=dv4aXHzL1Xjk+ugiHKiKHn4Zai+gBXRbTJznV37UCpAZWEQ/PoCZgmqHL6C2cMjGwpvgUK J8M/KPUkt2+qRbBg== Date: Thu, 06 Nov 2025 11:01:57 +0100 Subject: [PATCH v5 04/34] arm64: vDSO: compat_gettimeofday: Add explicit includes 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: <20251106-vdso-sparc64-generic-2-v5-4-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1077; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=V9tDNcYgJIt9GytAgrSszi/+I+38Gq3Tgc4R1PI5n6s=; b=dCws47IlDG0vkiaRQIxj8kTBcuayHBXpMon0coy1Y4wHv/D0Q6Ui17Yiv8DDkmnY/1KURKs7c RGT4PVlUYpJAvwj7qQeBdadKVIk+g7V23dttIV94IhYzkt9QxeQF/cD X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The reference to VDSO_CLOCKMODE_ARCHTIMER requires vdso/clocksource.h and 'struct old_timespec32' requires vdso/time32.h. Currently these headers are included transitively, but those transitive inclusions are about to go away. Explicitly include the headers. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/arm64/include/asm/vdso/compat_gettimeofday.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/include/asm/vdso/compat_gettimeofday.h b/arch/arm64= /include/asm/vdso/compat_gettimeofday.h index 7d1a116549b1b98d6eb7a78d053958c6a71799ec..2eb116d91235fea8362a11f3644= 619dbeb8201de 100644 --- a/arch/arm64/include/asm/vdso/compat_gettimeofday.h +++ b/arch/arm64/include/asm/vdso/compat_gettimeofday.h @@ -7,6 +7,9 @@ =20 #ifndef __ASSEMBLY__ =20 +#include +#include + #include #include #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 7F40C30DEDA; Thu, 6 Nov 2025 10:02:19 +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=1762423342; cv=none; b=Lry/QisOV7neFwJRsTgWac/n9hdXtx3YgeoRhtVSoNs3QnvljS9RpnQFvB9s5LBlj59MY4V78LAOjedCev1Rj0dA8sjwPBd5FivT2JMc34NKDMz5riJ9p8dcih+MDK8+V7sco/bILOaaKTtGqRhgTnX2GevtG2HUd38AwzhosWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423342; c=relaxed/simple; bh=tZGss8cb1z8/0WWBQUsSvBIRS+73IHhbGKdGrpAcpcw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FzFEcXEEFCyU3JNSrD9D3HiEh+hpje5Opa27FVzRnF7+OCUq+ybo7Lf4xv+KTkDf6xp5wmOZ4ilRaCCEmRsEpt04uKSoAgHg2l5jFjGIsENpWJbCPwLFanJHIMReGImoUcgGyJ7z66YUEaijLdpmvLZJatXA7IaibZ6tdBvonnA= 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=r9kzcBb9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QT8pOm0x; 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="r9kzcBb9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QT8pOm0x" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423332; 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=FIeraRtAg206FkETryDgO1ccxuAvqFlxDc9eSmaYkEM=; b=r9kzcBb9+YvtLhBZ2RS02DiToWWWbSYeZwRl8W1sHLCDhGfJnryMADIdaJekBNz1YvCCSM 1AhODjNbwCTc4Xtf2Bngh4p6auUrgjRX7jtJL9zflCqX3CLFZSyqxPPlf2vZi+rOe+lNeJ etz/wCgZ3alj9B0Ttsg1BcK/z+FQcMkmbXtvQYlCSLovv1yDJvHE++/ulOV4tLT/WbXXTq pGqKOTefBfEdUI/mxYCWEVIY2lYRChTVyjnmS5PaIdd4q2Eh1HsXjmuSn39l0UI7gaWl84 T6PJRYSD8rCYst/jdfiwtCMW0LmSdvx6FdWzghzqVKn86HfAtjvifWf273qF0w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423332; 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=FIeraRtAg206FkETryDgO1ccxuAvqFlxDc9eSmaYkEM=; b=QT8pOm0xeKLE/BsI8QXhaK1N/TxtxS9ql/DDfYYgzdbTP91feBDAN1p/kYYNXwYwpMNMg/ Ki6PLtVthWfvQeCQ== Date: Thu, 06 Nov 2025 11:01:58 +0100 Subject: [PATCH v5 05/34] ARM: vdso: gettimeofday: Add explicit includes 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: <20251106-vdso-sparc64-generic-2-v5-5-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1057; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=tZGss8cb1z8/0WWBQUsSvBIRS+73IHhbGKdGrpAcpcw=; b=4TmnZudoivPgBuTFtxV0rPx1M5gz7LfAw/U75KxmtFw8e+BgnsF5QEPLLPGqy87T6Hl18fHJv aV30wu840YVAK804kEeGj7tVA2bb02xYGGs7mPZ3a9Pr8xnfrUEuV/e X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The reference to VDSO_CLOCKMODE_NONE requires vdso/clocksource.h and 'struct old_timespec32' requires vdso/time32.h. Currently these headers are included transitively, but those transitive inclusions are about to go away. Explicitly include the headers. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/arm/include/asm/vdso/gettimeofday.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/include/asm/vdso/gettimeofday.h b/arch/arm/include/as= m/vdso/gettimeofday.h index 1e9f81639c88cc23cae7cf267bf4674c6d6acec0..26da5d8621cc938f9fdb57fc4b8= d240c71e950be 100644 --- a/arch/arm/include/asm/vdso/gettimeofday.h +++ b/arch/arm/include/asm/vdso/gettimeofday.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include =20 #define VDSO_HAS_CLOCK_GETRES 1 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 D3A6C308F32; Thu, 6 Nov 2025 10:02:18 +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=1762423343; cv=none; b=bgdNfLDpgMkPP5KVfXv5sYIAG97oIEsTnRES7bAas3sFNsyD0kA8U7AOkrx/jxgp1DvoAvnolIfwqNs75Bnzg1mn5M/ZJ7ICZFiRhm5YfAisDwK+QL6+MR5lAajCBZ3QqMYvwPAIxVW4lfNL7mNhtCwIrgCvyTXdCEtmxg1Q+e0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423343; c=relaxed/simple; bh=6Tvlz7YTVVumh7b8245ahLshfSVp1NektvW47mEcH2M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gEtdc0NnzQp0PCneNcRF7sj+rXZnDwA82jzpLCRpv02BcZxm5j5WVbXxJ6T21KOflh/ub0xy8eMoFDayWXt9F8fXMznCts5v3ch0tdsi57MqF94pMbnZnSXNDimgeEZT1Qzgtl8/Gz2tAqowukchlhTDZPxbJhUI7FQN8cAuM+c= 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=XpWHcB7B; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nX1p2/hc; 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="XpWHcB7B"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nX1p2/hc" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423333; 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=sUA+HXM2fIAbf0Dw3N5ucsyoMleN+ru8RCOZqiFNuVs=; b=XpWHcB7Bd+lGXJcotDgXeoq83f1a7nLqpvpI7dfk9M/Cp4ZtDUkeVZ657AlkeSmGVNLve2 pivb8tZYzdzEUbCqSyrUp0/t5EhEaSV7FlPEfZIGrzD9MKVCZzSR6TKyvMiW245wAqz+uI csL6V/itp73nRtlbrmz7Yc9xsbeGsVW+cALBvBJPsj1gzp+E/NVfw8/PEQyttpKiA9BSVq 96Bry5Hske8SyXdh3efUbK3qGnNRMUq9oeQq4dY/Yt3urNmQ2P0dPbYDtTnCgsiL06w4WB aiC5VLKH+e0710UDD+HNKca9yJMVuNScveDAhwB5b81J10hBvcGK2GHii+LMrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423333; 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=sUA+HXM2fIAbf0Dw3N5ucsyoMleN+ru8RCOZqiFNuVs=; b=nX1p2/hc2xczs46SriosMFRR4WogaIor5NAb3ifZJbRu0tt4XO1qOFXPY5P2xXUunFX1vE 8uTLPCsMHbydtrBQ== Date: Thu, 06 Nov 2025 11:01:59 +0100 Subject: [PATCH v5 06/34] powerpc/vdso/gettimeofday: Explicitly include vdso/time32.h 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: <20251106-vdso-sparc64-generic-2-v5-6-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1014; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=6Tvlz7YTVVumh7b8245ahLshfSVp1NektvW47mEcH2M=; b=0oq7v1NBg4xiNNGgh7hWI9tGCtfy9A8PUCFEHWN7bHKagSn4ZV8Xf61tYWIY3YBFBURCKmi/6 m3hRqg01HXmDPz/86zOc4WFFtan+8FAqbVuApgAxXfd6T3EqPxFJWcn X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The usage of 'struct old_timespec32' requires vdso/time32.h. Currently this header is included transitively, but that transitive inclusion is about to go away. Explicitly include the header. Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Reviewed-by: Christophe Leroy Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/powerpc/include/asm/vdso/gettimeofday.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/in= clude/asm/vdso/gettimeofday.h index ab3df12c8d947ed3a5b0b173567ca8469afbf2d6..b2f0e971076acaea8bc70107fc0= f5b2d23e0b312 100644 --- a/arch/powerpc/include/asm/vdso/gettimeofday.h +++ b/arch/powerpc/include/asm/vdso/gettimeofday.h @@ -8,6 +8,7 @@ #include #include #include +#include =20 #define VDSO_HAS_CLOCK_GETRES 1 =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 C320630DECE; Thu, 6 Nov 2025 10:02:18 +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=1762423342; cv=none; b=GB5aIlRIuZTohL6GI/rvy0GDfTCNAf3WCHBho8M1bZGE1mj0itJiwilX5RwVLZ+WtBzn7DGGVa2U7v7UpcWs6II71dmLzKRBJhlVGmvOnS7MCkuVLlSjD7c9x8pzyaHbHMpuLvoUcWpxT2VWdPaluXhRcGosxCn8smmJl1+MJFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423342; c=relaxed/simple; bh=gCxoA74I68jSl8hq9TPM97UMjmPrbJiPbnyKM8TAfkA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MsUxLFpg5aQGWPif//2r/MnfMTZaGBBftA6yXiPn68EbDaxmF39jcUeilqbSD35C7OyLz3fJMJ7DpqCzSk97kAegC8UNRxkMEQJLHZ4dQA/227/laXAndsdtbhUU4PBaKFFSRtBCR9Gveoq3czIymJiAqzfVMPgNaGSvAtVgLBk= 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=pGKAu8D4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XgNL7sJi; 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="pGKAu8D4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XgNL7sJi" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423333; 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=OKFAR6pTteHeDNIXFD4VW70Ndlry08cGog9KlECLSuA=; b=pGKAu8D4fEc061cuX/8I1b6YEXBmZB+Jij2zbumDrVp7mkcr5bZ81QYyEYEeP5gqLBCXy4 6PbBXRvY/KIGEdFD1/lTFoYMJJQ6wdsqhHzn3lJL5p1OAfjwx1ufn3rdRFA7M/wY2kXGBb WdabmAk+eJP+aVl41V6tejNGxADch2+s+KAwnbDbDxPCi4ghHc+FSsaFwjDVVqsPIZIrnZ 8o8eP9IeWYiyWqH0i3ASdKqg2nN/X1sPnuB2TgF/Fi28ez/WuBWiU7B43CjKXWjsYefxjY 9UB+Djm+AX03FR4d07RryHg9wLx44ieCXiPeELQYHUaAdY3VdPrADfSshmeXFg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423333; 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=OKFAR6pTteHeDNIXFD4VW70Ndlry08cGog9KlECLSuA=; b=XgNL7sJi+lSCmkMLGurUIGHZCp/CsYmI8Y4rBmd5nEsS62nWLO9buqRniBcLzS3jYcVNKr aq0KzNWXrj7nSkBw== Date: Thu, 06 Nov 2025 11:02:00 +0100 Subject: [PATCH v5 07/34] powerpc/vdso: Explicitly include asm/cputable.h and asm/feature-fixups.h 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: <20251106-vdso-sparc64-generic-2-v5-7-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1151; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=gCxoA74I68jSl8hq9TPM97UMjmPrbJiPbnyKM8TAfkA=; b=RFF+YMkg4XtMbP/jgebERvbtm9EBsSsv+Vl/Q+rdruzXogTaULARg0ULPlcx5w/TD3iiD/8Sa 2rcXxiPXz8eD9OwLKD6CQM39lUmfmKikO+u3jtuSy6ajtNbYOa2L44U X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The usage of ASM_FTR_IFCLR(CPU_TR_ARCH_31) requires asm/cputable.h and asm/feature-fixups.h. Currently these headers are included transitively, but that transitive inclusion is about to go away. Explicitly include the headers. Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Christophe Leroy Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/powerpc/include/asm/vdso/processor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/include/asm/vdso/processor.h b/arch/powerpc/inclu= de/asm/vdso/processor.h index c1f3d7aaf3ee970699fa73731412137631da347b..4c6802c3a58083efc01b4759dbd= aa3612903df6a 100644 --- a/arch/powerpc/include/asm/vdso/processor.h +++ b/arch/powerpc/include/asm/vdso/processor.h @@ -4,6 +4,9 @@ =20 #ifndef __ASSEMBLER__ =20 +#include +#include + /* Macros for adjusting thread priority (hardware multi-threading) */ #ifdef CONFIG_PPC64 #define HMT_very_low() asm volatile("or 31, 31, 31 # very low priority") --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 C328030DECF; Thu, 6 Nov 2025 10:02:18 +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=1762423342; cv=none; b=KWnN7HvQ5EgW06+MSR7jjOIFde9uYO4Zg8FwWZaC+RM2zB7SU02CHUKF3XiWCIS+zwCpmNvRkAvFV6QNQMQxh92hoWUAFXqr+rTXMo9g9qp4wwX1ohobZ2PAd4fpjhSmiQIKFgYK4pLE4KgEkI7DDXqpTdceabDlkJ/FVL09NpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423342; c=relaxed/simple; bh=qUU0j04oP+Jr+mAZy0GqF1qAR8DJbrTpfYyKIPcCdaY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V/cbv9kgxraHqtRtRE51t/nSnnLzYb5IwezR1RIfPmc5pX7DjrhqaQWT2XD/p1KplCTxv8fmj/gV2JA5Nbtdwm63tkat27AYCz8AsZAWuFnSVYi/IQx9hHbhnW+uN04LfBaVwbs6lCUg3fElYRH6Liz4xQIK3CyFBqAb/dOsEDY= 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=FlRlwdsA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D6Dm5Ar9; 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="FlRlwdsA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D6Dm5Ar9" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423334; 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=U5z1AShvfOWlUFfSGd2FO4MKKuyxsnZoNRjaX+Zb/8U=; b=FlRlwdsAo6G0XMC1cQ/WSe99ipVYZVOzhm8b9zE0HD0Qcm21ywy2yeegSduAEPKS39CfWN w6Bp9a1pR1LRNbLtWakMvM8/+JgdYXQV99L1FwQ7tVwgfyAUDL7HdEDJ0P3P37/cNa3vjy ZsGggXvmUWefF7imZOEZ79uUhPaLTM4Nm0RMLJ5h4bc15WwZ8+CTVCa9ztzuB3RvWbAoeZ fLwimjYt2kwjhDwiK8ogdXOmMpYgsF6PZDNzEnXG0rOh3qvraWpsiGgsP6wf8xkBbvnW0R mIDatd/XR8HZepN+kM5kSxUGLkmb0oJOJrGTyrQSW6wm+VpPW2Lzmz1kuTV9Dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423334; 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=U5z1AShvfOWlUFfSGd2FO4MKKuyxsnZoNRjaX+Zb/8U=; b=D6Dm5Ar91xIXFDmEO3gSz+evuL9anvE+dHUBCM0KPEgrnXro3kHBAi44Cae9clyU9Grx0w xft5Xq55yQ2Hv/Dw== Date: Thu, 06 Nov 2025 11:02:01 +0100 Subject: [PATCH v5 08/34] LoongArch: vDSO: Explicitly include asm/vdso/vdso.h 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: <20251106-vdso-sparc64-generic-2-v5-8-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1388; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=qUU0j04oP+Jr+mAZy0GqF1qAR8DJbrTpfYyKIPcCdaY=; b=S94GpFlvpxgaOrI5+qwLwnwq8xv7KGuUqd1nO70y/cLGGkYI7DNI5bgPqvODTW7lvoOpJ1QHI yZTGNJQnKzYCUzpd75EJbXEf2eLmmWUFJmp1/zfiQ27yIjI6RebRllL X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The usage of 'struct old_timespec32' requires asm/vdso/vdso.h. Currently this header is included transitively, but that transitive inclusion is about to go away. Explicitly include the header. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/loongarch/kernel/process.c | 1 + arch/loongarch/kernel/vdso.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/loongarch/kernel/process.c b/arch/loongarch/kernel/proces= s.c index efd9edf65603ccd16408dbe5d2b71a47d08561ff..84a1d3cd5ccb7418907f0a27910= 742784233a525 100644 --- a/arch/loongarch/kernel/process.c +++ b/arch/loongarch/kernel/process.c @@ -52,6 +52,7 @@ #include #include #include +#include =20 #ifdef CONFIG_STACKPROTECTOR #include diff --git a/arch/loongarch/kernel/vdso.c b/arch/loongarch/kernel/vdso.c index dee1a15d7f4c7770d6c31249c8a3f88295d9482e..663660f08a1f64f44649a8f0034= ed7d1239b857d 100644 --- a/arch/loongarch/kernel/vdso.c +++ b/arch/loongarch/kernel/vdso.c @@ -18,6 +18,7 @@ =20 #include #include +#include #include #include #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 820652773E9; Thu, 6 Nov 2025 10:02:18 +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=1762423340; cv=none; b=gs/LHRAPtVmi2/6KndhNgkbkcXNdiJfOs3yGm7C5lCJGADx/nAObJEyk6LbDneaaTSqOGB0OkiRmKCDEijUoOM2y/D2nQNfcV1NtNwH9gLIfRZT//tENkAekKLuyswostLoE0lHKx3LuChGp772/qUiHvpG2yF4Fr+XRivpAjUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423340; c=relaxed/simple; bh=mn0D+ppD5Vc5LKBIM4oGC50cwygKOdY5SYRBUbfzmNA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FnaIkG0wuZVSp+UzdWlDnWVJrzP1zW/ZIJeravWxT3h+9ruXcoJNLBtSOwfNFjrTGH3DcO9WH6PpQt6E1ti+l7eqCMM+Dou+xjpdON6dYLpr4fx6SllTWanFGmXxbdEnOOisMsQDFvuTCzYtqz0DbJVhtQW7700D2Lpp2PVYJEM= 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=r72mNKpq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KohBsW0g; 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="r72mNKpq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KohBsW0g" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423334; 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=zITwWc4LhpB6MTMFwwJ6zmjgQYWiyWcgw0BJYatvoIY=; b=r72mNKpqhkG66222iGMKNZg3zEx92HGs2QQlUBSAJefL+cGuI6bSxuDCCEpGffzLkCTVq0 KcsR4We5mwu5J9LZNE4vnLmkn+zjfph+xqzGZByaWqwd3NAjeCnsowmhB6mIlOKrgxzvta Q0AZ35JLg7vQ4LjC8UtQOH/k/Ao8nVZG1oMDrU8W3GJ6NoHRlfQWI7L4OTjdDYoTBztJ8t p7eaGXouxRfjdOwgTFAcsN1KWwiMs7L/7FYQfWnV3ujOBBWrFzjfGsLqxqdms2ujkxEiq3 nDo8KvZrPg9KWPQKHwFdeXCXSyfofm6Rv4OgsovYw+EaDTXKx7itV3TvlQ2eUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423335; 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=zITwWc4LhpB6MTMFwwJ6zmjgQYWiyWcgw0BJYatvoIY=; b=KohBsW0g7RMFzp9xaVEpdH9H/fcxzJZnkRmX84ScYqj5YMfWniYqu35sLAeDw+RLt0h9l5 htX2w1JuhcS7VQBA== Date: Thu, 06 Nov 2025 11:02:02 +0100 Subject: [PATCH v5 09/34] MIPS: vdso: Add include guard to asm/vdso/vdso.h 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: <20251106-vdso-sparc64-generic-2-v5-9-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1073; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=mn0D+ppD5Vc5LKBIM4oGC50cwygKOdY5SYRBUbfzmNA=; b=zLcxfpqTtQW1K0iHGESlW5MOjML5SVksV/gtWNVysiqi4nNtkPxje8wJhR9gRA8EjMUoknlgN 7d6gc0Enq4YCrHnrWWCblHOBsFPTiFT6QCRXf383m9pqeDj71uXEAcp X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= An upcomming patch will lead to the header file being included multiple times from the same source file. Add an include guard so this is possible. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/mips/include/asm/vdso/vdso.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/include/asm/vdso/vdso.h b/arch/mips/include/asm/vdso= /vdso.h index 6889e0f2e5db950c3ee8b4f12c15466e76a09a42..ef50d33f3439aa4c8486758012a= 1e9e71fa38fc4 100644 --- a/arch/mips/include/asm/vdso/vdso.h +++ b/arch/mips/include/asm/vdso/vdso.h @@ -4,6 +4,9 @@ * Author: Alex Smith */ =20 +#ifndef __ASM_VDSO_VDSO_H +#define __ASM_VDSO_VDSO_H + #include #include =20 @@ -70,3 +73,5 @@ static inline void __iomem *get_gic(const struct vdso_tim= e_data *data) #endif /* CONFIG_CLKSRC_MIPS_GIC */ =20 #endif /* __ASSEMBLER__ */ + +#endif /* __ASM_VDSO_VDSO_H */ --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 8213430DEAE; Thu, 6 Nov 2025 10:02:18 +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=1762423340; cv=none; b=WczF7QgvTUu2RRzoiO0IvBfyaXTcCBLXm0wBYZ2Dy4y2/j4nDlhp8vvSRgdDZlBOUmFsRIX2XHHaurmFPjpLVs3lKXkJ03LCofaiqk1F1mbEJolODeSLSGlzzOVy8kU9ZE8skpZNU46Oq5p4+3knhgrFTmEKhXc+rYOhJ87+SJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423340; c=relaxed/simple; bh=PM9q9catgRqCjb/cltSFmqCsNmoTi7HWsxpIPxIvJHQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FUNKiMwtOy5zCDvwjQqzyxb4HuwrJxK/J3eMveQh8eR1smDYj19M3SGnm1VPxad9wE0B4AZdNlWIqnKmZHS/f3ir/gOsSbBISfOAAdgBW8GZjUYVGxUNVjLGIplnorHDY5KCEbX2TMPLDZc7dQIjk4RQJFsv6kfy2ahR7Mhd40c= 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=Zho1XcZ+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jFaug79I; 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="Zho1XcZ+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jFaug79I" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423335; 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=HfqyV6Jh7glVwn00bSS6JTapm9r/93qO+3QFj5gItgM=; b=Zho1XcZ+S4DvhpdUdKFgOw4seD+vX2djJglg7GHWwWABnhj5CLsDfHlm2iSc6DS7Am8/k0 D9+z30itd8idQ6n1R3r3VQRBM7lqcel8WrqC/31qD8g0sTc7S5NCygWrFq+zJb5Wx6f9Qs gQTQiaFGkXun8Nvt0G3+EEP7znUrdLBYO9DBK26pQCPJBGbIqSi5zQyxSTDk2rzwdho02m fhkJsOA4rmir3DrkvKGDPmlGsqamDM6QG4FXj6eRjsyhq7vlvBbJE13wlXyzLAVS4HTF4X 7vOw184tdaikNzsnz6qq9Uwfbe1vSnU7o+DDTmHnk2NmYt7HXqXgzTVyfs5ivw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423335; 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=HfqyV6Jh7glVwn00bSS6JTapm9r/93qO+3QFj5gItgM=; b=jFaug79I0pwPTQjTcDLWNICQ/82GXA7c2/GG6q65trR4umWaWs5o+ZBAFZocP2anPTC5jT LfFKrttYxe6zr2BQ== Date: Thu, 06 Nov 2025 11:02:03 +0100 Subject: [PATCH v5 10/34] MIPS: vdso: Explicitly include asm/vdso/vdso.h 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: <20251106-vdso-sparc64-generic-2-v5-10-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=854; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=PM9q9catgRqCjb/cltSFmqCsNmoTi7HWsxpIPxIvJHQ=; b=DiqYQvUT7a1rqQkhVlgHJpxtlRmlJy4Nq5ws7lgq3vQz16ceI9wwxRim5MPAP9H4tET3uSCpv HhP9TKOseiwCHdRE6D6bbrB6sHhtQPyiLVZfSQ8zLFbLlGt8w6SbSxN X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The usage of __VDSO_PAGES requires asm/vdso/vdso.h. Currently this header is included transitively, but that transitive inclusion is about to go away. Explicitly include the header. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/mips/kernel/vdso.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c index de096777172f082b5b7847a5c14cae5ddaee0430..2fa4df3e46e47b5c9675aeb00eb= b96ac3353c68e 100644 --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 821F030DEB0; Thu, 6 Nov 2025 10:02:18 +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=1762423341; cv=none; b=iOSOJ9uoDB7yBGVec9vjkqr5sBITjJ19msmGxbuQPLzarFdeKxCaT3meStJsv6V50P31r2C+83QMUD9EyRLWzOJ2GB82lp0OBn+sifilyqwTaUZVih+XuQgh+UX1xvWB0r1X765MIvJdn6LqsiKYUcpfm0vJVWSaFuTCb5tQUNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423341; c=relaxed/simple; bh=M7OZaVgVTbQq1+qCCbg+AzkOEF9vaI8Civ95WdWNrvI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FDvELlRtXhptD6+3tzjUc9gPOxLBuAikcBiUgHs9gzmu879rRM/jaMEIZENyyL5ngqwkAkXKp+JixhOI2zF+KUcDxrGQr196Zvh4Fudcz0wPbM3b4iAl0E1Iwh1sQTAt2IcpVsPKdMWstbO5Q0B9A6quRmqpzG2sxwNAR8HwJ4o= 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=TYplAVad; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VUlzyT5o; 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="TYplAVad"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VUlzyT5o" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423336; 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=DEoIwwFxHmh+hun5gVD8XghoaqJckg8nGzKi4HIXz7Q=; b=TYplAVad3/6WZhVJoZAW366/E/bj1kDoWzzO1ZiXxyfxcLXBEv1PQ6jchk/pJ9oYxvQfYZ QXHrDvZHzDlz8VLBZX11sGJGUE40QcR1iIKdv9hK6RlH1juTB97xR+2pxbW6g8LARS4ndp VlWkxNMq9AX0zSpqhw5gpKIzpC2pCV39BnVMXK77Pgtnk8PwvyGCYNin1eAOXe1IvBZarA p+3r8hXvb+hSG1BxGaHXxoDCSeNztLj8qetiL/2YrYJab3vPkFGnQWHcoWh1GReQSpwc8C qC1DQwIXnRxJGL3gppYEnlaq3p3MEjSV9DL3EvupYblXthLVKFj0A+IaI+/o4w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423336; 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=DEoIwwFxHmh+hun5gVD8XghoaqJckg8nGzKi4HIXz7Q=; b=VUlzyT5oJOs/L3bV7lrazXxOwPi28oXE4emW/Gc3nI0kM4onPYShAu6v2lte+Gb/n/9GBk XqrpFnVNmA78pUDQ== Date: Thu, 06 Nov 2025 11:02:04 +0100 Subject: [PATCH v5 11/34] random: vDSO: Add explicit includes 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: <20251106-vdso-sparc64-generic-2-v5-11-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=954; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=M7OZaVgVTbQq1+qCCbg+AzkOEF9vaI8Civ95WdWNrvI=; b=PPNDwDR8vYXS1omwB4AfBNge54KbfW/bl26EQHV2FvEM2YsH9BIZh64MVxYO48Rrl4R+n1ZGx vRKXl+6Ma49C0H7LFKrFeKs9bYwhix7q4SmVGae9gNE/UEChnfALNKw X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Various used symbols are only visible through transitive includes. These transitive includes are about to go away. Explicitly include the necessary headers. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Reviewed-by: Jason A. Donenfeld Tested-by: Mark Brown Tested-by: Srikanth Aithal --- lib/vdso/getrandom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/vdso/getrandom.c b/lib/vdso/getrandom.c index 440f8a6203a69a6462aafee4ad8d5670cef6a353..7e29005aa208b498b68f16d3df8= 0b048dce8ee21 100644 --- a/lib/vdso/getrandom.c +++ b/lib/vdso/getrandom.c @@ -7,8 +7,11 @@ #include #include #include +#include #include +#include #include +#include #include #include =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 1625E30DED7; Thu, 6 Nov 2025 10:02:18 +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=1762423342; cv=none; b=V/QgUMJaOw94tvhSJM7IG6vGmSffCJe9d127pjAhm64nMw23lVHlksaqcqmH4ls/FgbohftSKCi1TG9JgcO3CIYxPwnHhGtO5DDundI2b+MqcLHiHyM+a+zvRE07TlRcOEzWl2EAsihLJvY6nGjUjZQBCa5oygykpsvfBHhXrEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423342; c=relaxed/simple; bh=8uLSosIzbxHtrLr9GBprNPDpJ3bKD05UahB9SGNPIJE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BGJPVmUHML6Nc4WwFQeZ5Hye8WsFvQ0jamDGLrlkQ2xWSYyIjZSnkGwE67DiN7G04Iq6IYuBXnmSOWv3Cv1kruPlydg6cJ+L5sibryTZaxHc/Sjjfh/CdQC94RiyrYIxvGEo69+AdjNnyf+pm105+DK50BasE3Jk+MZwBToFEdk= 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=lHjDesxw; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OozrfdVp; 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="lHjDesxw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OozrfdVp" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423336; 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=p12DOEBsm2e1glAtpDY9DYaMx7+CHoNdHdo/bDc6SLA=; b=lHjDesxwezGMqrX0JmxEEV6Wl5mCtM0E+aKDVP2fSnlmlmeP/qWYuHrWNYPCfRvEzmltTY Xkt8XR17/NaZdJzpuiGhIrgQam+Wf6xqOvuTXfttbSdXCdHmpx8GcEGofn8/8x3Eymb/n+ M3EvuoxQjpB/SW2XNA91oaoHTuZgPhc/SYdcw9jQbVJIe974cNuMQWg3Moks5pA78QJRHs GZmO/XeOFWC/1NXwPvSF1EUZfipJrPNqNuSDHywahsqj0d/ELByBTR0srhb06mh91veaQV vzIzgH3fFBmo5V+gQNFzPW+A45f4AjCE5gCXE27afHSPWO/zok3fSvjzRMplPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423336; 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=p12DOEBsm2e1glAtpDY9DYaMx7+CHoNdHdo/bDc6SLA=; b=OozrfdVpYKNWbjyfEfLh45UVZTd4dZ+V78mBGPpV+wIJfYGFCwNX6PFC1EnxSdfmzZyGDR 2Vp0voJTDxMvO5Bg== Date: Thu, 06 Nov 2025 11:02:05 +0100 Subject: [PATCH v5 12/34] vdso/gettimeofday: Add explicit includes 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: <20251106-vdso-sparc64-generic-2-v5-12-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1063; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=8uLSosIzbxHtrLr9GBprNPDpJ3bKD05UahB9SGNPIJE=; b=UpYeRRD5i1K4tW3yL6iiwC27RDLs0kYe53cKq9z3nXOAP4u1QgYtR0o6LY/9ctc9gj32hcxUx In+uqtNh48/AVVfkKdtrXRym8u75jMT3Gmwy9sYNUyFwJocANXLp6Qw X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Various used symbols are only visible through transitive includes. These transitive includes are about to go away. Explicitly include the necessary headers. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- lib/vdso/gettimeofday.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index 95df0153f05ab41c871755e005762f3442ff3ecd..7b3fbae85544c2f2f6b9abd5437= f130706fb6ec6 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -3,8 +3,14 @@ * Generic userspace implementations of gettimeofday() and similar. */ #include +#include #include #include +#include +#include +#include +#include +#include =20 /* Bring in default accessors */ #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 DE6A130E0DC; Thu, 6 Nov 2025 10:02:19 +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=1762423343; cv=none; b=nkirNUpmyznC2kmeuVqq6SK+pbQVgOssmPFJx3gWCcN7gHye7mXtPTyiJuJzQQm64ioytkqs8CPMHBolNmV8TV1Ms1mKZhl+v3TOCp5BxUXqwXAXb68Ianz83l+52o1Su9hy8WDrCQeyAAt8hkFKBZRdW/aRNfDQZYB3l8dhlXI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423343; c=relaxed/simple; bh=pWSgr9LF0PVimD93prkaQ1gUly1gwK+GgmvcantsbHs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fCOzzEmBpVs/+Me6mdHrGfFbE0rLC5plwkQUDhYH6FhJftQc4wXDKXkGW3caPmDiY/iFSXfia87dOBRvnUECDOaNC1CTbg0NeDku44OaoX4xoPmYDFWBq4FxaQ3+1YHgcyzF1YzyYPW6/tBtmh+ZX4cLEqUHaQF+uWEXr9tG7ec= 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=qp3l3VYN; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=l5WTT4o8; 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="qp3l3VYN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="l5WTT4o8" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423337; 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=dfNwuY9Nbo9A8Jz5YapUcUJT7RvIIqIGIu7ip/76FOw=; b=qp3l3VYNka5s1nY6eDnzOvG4BsEZVzoBbsrxfkDwCfjHvYy/cVdQgyWaX/hwKzCNyKhxeC IWLaRz2GgmYwypKQSt6Wi/n8Se0eWsYB5V4gYoRYLjwC4jOazBDWadM84vi6vm9QMHt4X1 UZ3gAeF4pEuJtLd7XSBJtOC7htJfBDVwTDrJGBKyByLBsGJpmwqdMhCwLhyoHwlaXRdYVs 9ENvfTx/rK9ThPrwb/zWvkOEdN+/VEN44A/83N1eln/M5vw+e/JvEHnTcXkMn8wdYOja0y z9MHXzkNFFGMZTSiRM4NJGa/Ur6QRxr6y13U7LqnKkCYKycOV4nr1n/mt6RHRw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423337; 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=dfNwuY9Nbo9A8Jz5YapUcUJT7RvIIqIGIu7ip/76FOw=; b=l5WTT4o8blJG4zOeiHHjP50+OheD82E7UKUeJOMOuthXCXGMrZEdjnhyqqf2V4QFxa8XyT LCrwDM/5KloiOeDg== Date: Thu, 06 Nov 2025 11:02:06 +0100 Subject: [PATCH v5 13/34] vdso/helpers: Explicitly include vdso/processor.h 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: <20251106-vdso-sparc64-generic-2-v5-13-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=852; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=pWSgr9LF0PVimD93prkaQ1gUly1gwK+GgmvcantsbHs=; b=FPc0jcTkM7lq8Xc6yadEp5IxwO9p/vtzhZuFOC/A71JdPZwDstZAyXmpfOJA4TmN2dNozEnnc eOzFcFg6z7DCn2Se6NHdpbuY/KU0V/s1o9E8EFmrIPUUeklAyMKOzMv X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The usage of cpu_relax() requires vdso/processor.h. Currently this header is included transitively, but that transitive inclusion is about to go away. Explicitly include the header. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- include/vdso/helpers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/vdso/helpers.h b/include/vdso/helpers.h index 1a5ee9d9052c38553c0cdf413e0030286f884d53..a1c995af4696351e55cd870c7c4= 211b0984fe9ab 100644 --- a/include/vdso/helpers.h +++ b/include/vdso/helpers.h @@ -6,6 +6,7 @@ =20 #include #include +#include =20 static __always_inline u32 vdso_read_begin(const struct vdso_clock *vc) { --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 352D630E844; Thu, 6 Nov 2025 10:02:21 +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=1762423343; cv=none; b=G1PK14TbkYONDTNJS+ynd2Qqh9f0IJeBU8t1U5HKtu6eeS6SEbCgbKcNzOveNk6oD8UAmxGFS09WKNDvTUERW4w1Jze4RwQyqNS/jknEHDjh1gtIjhjpXE3k3DmhpvjUJMSOOXxgWD/PIcwhE6TR9WbLUj2whd051EQ+Y9+RFLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423343; c=relaxed/simple; bh=4Cu28HtGZeNZ2tWXY+8GZcEypzFGKNdtzWDHnoy4D9o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NZ+OcOYhVjJ7FSPnmHAWfE7/yhura4buW09Gnhgo4tpmnHlqlCCY834P2OtZjEZVhlNhnynX7HoHpz8Xrv3Me6cuKYeyKSF+UIFVY1+IWEpZnca5btOEVS9ewRgK1eDMkmmFFoluLk59Bsag5cWiPCRfLlvPM47MqOcHQ0pSWsM= 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=Koq81XN4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NebslIGC; 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="Koq81XN4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NebslIGC" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423337; 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=L+bQGGgEleKR6qKcL7e+IzIL4DEdxuTbcX+pJZvo9tw=; b=Koq81XN4V8ajlEgOf1GpsEXnRwjdINGxTEzarRe+pvGWi3AxnBOuWGx7BKVC5ZsknjofI/ //bs8dPiQLq8cy47ZPN5f8O3DChhE/qUhNoKVj1WulDSr0P3aSE2cU9bPXX8KuNlHdhPwn 9YtIo/CkMnnC4iHzy75BZCDSDZJdol823RZJKpBAR7lxwQvMEhU0xn1DiJTbO6mCnvlwCc x1ocowmXLfAngvQWItIQNKrol6CYme1w71LKP7se2xcMLvA+NjfSjFo2vg9TG+lk7IxvEj 6/U8GMGYP+bR42PNCl8GAk/Bq4flCRBXp9dlF+NKeAHv6VjBLUZgHEFzYFBLIA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423337; 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=L+bQGGgEleKR6qKcL7e+IzIL4DEdxuTbcX+pJZvo9tw=; b=NebslIGCP/0XBY+t6xRTaJURoXZKSjWZFHf8pSrAWZ3The6aG2X+Qt9lmqbkSzAXevxSQX nu3akSQUYoAcRQCw== Date: Thu, 06 Nov 2025 11:02:07 +0100 Subject: [PATCH v5 14/34] vdso/datapage: Remove inclusion of gettimeofday.h 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: <20251106-vdso-sparc64-generic-2-v5-14-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1995; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=4Cu28HtGZeNZ2tWXY+8GZcEypzFGKNdtzWDHnoy4D9o=; b=wgfZC8v12n5R65IRKOFb/E4l4M/8XCUDoIsKPpV04GCQ82zd29+fO6qo2g7MRa/a7nzUf2+c7 F09BjOCS+zkBhCF0FslbeiK0EA0nAZIK7R42CgRjbARl3mrrIE55iOg X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= vdso/datapage.h is useful without pulling in the architecture-specific gettimeofday() helpers. Move the include to the only users which needs it. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- include/vdso/datapage.h | 11 ----------- lib/vdso/gettimeofday.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 23c39b96190fdfc2f31bf76a8614d69a3a98017c..752856b36a3abf82b849451e5d5= 233b1067b86f2 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -184,17 +184,6 @@ enum vdso_pages { VDSO_NR_PAGES }; =20 -/* - * The generic vDSO implementation requires that gettimeofday.h - * provides: - * - __arch_get_hw_counter(): to get the hw counter based on the - * clock_mode. - * - gettimeofday_fallback(): fallback for gettimeofday. - * - clock_gettime_fallback(): fallback for clock_gettime. - * - clock_getres_fallback(): fallback for clock_getres. - */ -#include - #else /* !__ASSEMBLY__ */ =20 #ifdef CONFIG_VDSO_GETRANDOM diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index 7b3fbae85544c2f2f6b9abd5437f130706fb6ec6..9dddf6c23913e87a62bdaa50c5e= 32d2951c92760 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -12,6 +12,17 @@ #include #include =20 +/* + * The generic vDSO implementation requires that gettimeofday.h + * provides: + * - __arch_get_hw_counter(): to get the hw counter based on the + * clock_mode. + * - gettimeofday_fallback(): fallback for gettimeofday. + * - clock_gettime_fallback(): fallback for clock_gettime. + * - clock_getres_fallback(): fallback for clock_getres. + */ +#include + /* Bring in default accessors */ #include =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 819FD30C61E; Thu, 6 Nov 2025 10:02:22 +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=1762423344; cv=none; b=C50VYd/2Z1QkaVRFKj4jRkGhp1s6PwD1nDeBNgcJk+LdAX8Bic7LKZtjLYLLNeq/g2TKeMoiVHHT9DTHSK0V1SK+uEL40gTikqPAj2cMs1+BcK+VXLfHLlModaab3KHlfHB0bn07LVaDW6C5zuWjyxNtxP80eax0Ox+UPrtyU2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423344; c=relaxed/simple; bh=u5qksLE0CkeBqNMjOIpIJvowjU2FK+BsJIgAtLa3Fdo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OV3dNuKAaSu767mTvhe+ujgoG6d7rJW26jRIgCRkjTB+15FUjIofzx2LvYgdKWvqkdBgh6C/fTvnxPyOeRgn5vpZdWgaitUQQLIMSqNsJWQMMEXqzKFwblUficZNlbg49mbuO6/1+OpEhNTW3VZgzJtkaLmn+VmxLybtyx9IFiI= 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=adlixGJR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cRbVY1Tm; 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="adlixGJR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cRbVY1Tm" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423338; 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=FHcQizXKIlU8rlwocB6TkeD1z+OIKxCXmz4FFDxeMJA=; b=adlixGJR4IldiRTbGD7/4BRp4OcSYWtdeSNrF85Vq87eF/Mlbnksmyg1Genmxrogv1bLDd ILIhBtMhLd1SqzqXtSms4razZg0WZxllN5xn7z6qltWk8fGA85MK8gSfC7IQhwg/FDYBGU gvEWAGygNEspZH4+Au5xEc/rwdPd0iWCf9xROjqWzuzlBsgwJOu+zHWFBpZq/xRcM3vS7L cRRQxY1KS1Ue5FLb2irZvFGclP4JbWOBwRGJsaP2LXmr2+NDuceRigCW6HNMYlO3KoNdnp cNwlUM+8Adsi135pCZ7T2XwJL1X6t7qnSywCEIcENEWE8HeqPX8vTLw4R8dLuA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423338; 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=FHcQizXKIlU8rlwocB6TkeD1z+OIKxCXmz4FFDxeMJA=; b=cRbVY1TmRvc4UXwlz4ukHwV/bbbjLtb8qIdQUfjzQTDyML/5UxZCx4EYE7iSplduoKKrwY Kk1AnhY5CxkBHBCg== Date: Thu, 06 Nov 2025 11:02:08 +0100 Subject: [PATCH v5 15/34] vdso/datapage: Trim down unnecessary includes 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: <20251106-vdso-sparc64-generic-2-v5-15-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1543; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=u5qksLE0CkeBqNMjOIpIJvowjU2FK+BsJIgAtLa3Fdo=; b=UC+kTtENPldSam5U22tKiHqhjB/6T+TDdaVD5UtltV6ZO8FyvrKwnhXnREIRJiKG1XwM+tcmX lIjJsRq1FLoDiX/jCCbyL+92WWiM9//+Y5YZp4L9lJEacbdtVVkH2I4 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= vdso/datapage.h includes a lot of headers which are not strictly necessary. Some of those headers include architecture-specific vDSO headers which prevent the usage of vdso/datapage.h in kernel code on architectures without an vDSO. This would be useful however to write generic code using IS_ENABLED(), for example in drivers/char/random.c. Remove the unnecessary includes. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- include/vdso/datapage.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 752856b36a3abf82b849451e5d5233b1067b86f2..9021b9580be229b2001dd17bfbd= c236ebda1cee7 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -4,24 +4,16 @@ =20 #ifndef __ASSEMBLY__ =20 -#include +#include + #include #include -#include -#include =20 #include #include #include -#include -#include -#include -#include #include -#include #include -#include -#include =20 #ifdef CONFIG_ARCH_HAS_VDSO_TIME_DATA #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 C9D6530F54C; Thu, 6 Nov 2025 10:02:22 +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=1762423344; cv=none; b=MgCYwyPU/CNAq0eqrng+ECuv9E9GUvC3d6qjMSddXKLI+8NYpKPJ8d9Nv4XN+No/ny4efucUzDPeG/Z8mdDuYeh6Y1gBsaFfrVy+EBnq7iofbgxIjYXEZ+1yjJFJ26bLkCXwG2RoXADJj0LYMOUU5bfYl/wFZj9CQerkos+ShBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423344; c=relaxed/simple; bh=at2WHYQMWa0qZ9sRgIO7R8kScM/WkZbDWmC1hAg3nZ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h7N9b/LchRucmG8zc+D9ckiyuzXBRhi+/PVO2vuP2bCyHkrbuu4aiwIysrm0JklvQ0Lq9zIeoZTpBC/qMMPsUFjMWyP3CLXhlpGWofT5jR8KIWH30afCz0bdtBlNnV3A6hoB3FHyRBURRSgcx6k7t2QeUn25xWViuphMzfDX/gQ= 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=agleDmAw; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=V9mvq2WP; 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="agleDmAw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="V9mvq2WP" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423339; 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=hBw5Uw1xTFSkt2IyDChXADePP6hnrVSQHkAiEvYpbaA=; b=agleDmAwZyAMFSuOJwEQBUvpvS+xtn5awHEIr056d/+t3DZZJWkCSUDNVh7Y87hk7jabg3 L3VVS7N035jh8U0RuiQDypX7mW5XxYrGIQxG5MFLqngAhiEpP+dwyK57XMTSK4cFpaKY90 3vKD7+87njYyRJs+3tVeTqe2iIzO4xcx0YXcTNXyUpRezRM9KTRpD+WS/OxyoRVDrWlKBy Z53XNYQEsyD9Y5jCs0zuLX4UcqpdY3WQbrX2HDqrL1PBWY6Jc8p578HlVYsvM41T+Ao+B6 iGZt3nFFuAO7usDc6ps/TOp3WhHjivfxlHGX9Wi8ndG5YMdRkK+FvR3RImjjbw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423339; 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=hBw5Uw1xTFSkt2IyDChXADePP6hnrVSQHkAiEvYpbaA=; b=V9mvq2WPyHzmH/rMO1GF3ZSdm/c8xglUTyqZ4gntsnqgF+UJLPuliKPdl8KdJC+Z1v40zk cgf28gqS1psaWsAg== Date: Thu, 06 Nov 2025 11:02:09 +0100 Subject: [PATCH v5 16/34] random: vDSO: trim vDSO includes 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: <20251106-vdso-sparc64-generic-2-v5-16-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=781; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=at2WHYQMWa0qZ9sRgIO7R8kScM/WkZbDWmC1hAg3nZ4=; b=IB2rdUCHkbK4hefR4nX7CQinuLUiSuxl19rXY7JTrhLVZzBEQtqlRQ5O47N+Gug/jlDIxsriT oYkXq6ALfw0A2782UbhGNc56N1ZlpSghM85EFFDXV0jttAviixFJvKK X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= These includes are not used, remove them. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Reviewed-by: Jason A. Donenfeld Tested-by: Mark Brown Tested-by: Srikanth Aithal --- drivers/char/random.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index b8b24b6ed3fe436c8102968392278d5cb5544f06..3860ddd9527930780d5c13cd474= 2fbc3c27acc42 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -57,9 +57,7 @@ #include #include #ifdef CONFIG_VDSO_GETRANDOM -#include #include -#include #endif #include #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 C2B6430EF65; Thu, 6 Nov 2025 10:02:23 +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=1762423347; cv=none; b=pCFKpvFEHI8P7+KKLieZKo1XOfiWV/BPGhYy3WcDJyDoPDCYktOSdoDLkBW4aS/HwPLbvdu9aOk8SyXJpImUCjEBR71zeUvbwCLnQ/LYdrNNnFB3QjgbOyvZXWYYjFml5W7Vxn3VS8cNaodzb3nCYXwbMr9GsQdNNDMosyF6FK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423347; c=relaxed/simple; bh=zvq1hf5MGNIYhzE4YabXwYr2K6c63l5kL3/cxd5Yi1s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bk19eIvUC0bDNJmwV/5/8/RFAvAE/My7MppFeZ9gcvPdqvomshd0jIuO6JtLiU/WSg4P+S8MFCCdP+biucaXVXfsioYIZfWyNjuCFOw7PgMYIcFGkRuXthg7fJ+R6bQc02dmjDnEBtpHPwOsE8HvvBefFU6uajfBYbx0CTtpdIc= 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=ZjdK6ta/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=H6I/XjB9; 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="ZjdK6ta/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="H6I/XjB9" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423340; 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=cixBlqzeA1rYEei235pjO9MOZJgcYixfO+t17HjPi8A=; b=ZjdK6ta/n8YYzvHEK0WHauJgsh4QmbpVm/Sx15dJXqmGL9Tv6g4v/UqBtqKmYOyEoJ7wEw fcnjuScSBGXqOWeutlo0dYVU18S9X2XOijC8nAux9aS6weSQshvGFhKLr3AxtshgqvHZ+n VZlv23w17odS0ATYJzRi4ZRQiNOtDPzGM4qrexCSp967iAxEDzqZkB9ImGV9Dcibs4mhGL 0uJYKwuNMcju2XcHKZlFAcVW54795M2vOkmbtcuEZEzALBgsbDjXJgf+FVV+jqqkOYhG1r P5TsSWyzSdI9ajUl8IZZbn9rHvFUZiUTT/m/osF65S1zn/oZkS4rv5fBk/PTlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423340; 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=cixBlqzeA1rYEei235pjO9MOZJgcYixfO+t17HjPi8A=; b=H6I/XjB9yNRprw85RtmRtDbZPIcnuU6Vs+TvVdl8mbCXa6u2VFETgx+z1hkUJuIkPtyCS3 XLs0N6CCrGL9+XAw== Date: Thu, 06 Nov 2025 11:02:10 +0100 Subject: [PATCH v5 17/34] random: vDSO: remove ifdeffery 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: <20251106-vdso-sparc64-generic-2-v5-17-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=2338; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=zvq1hf5MGNIYhzE4YabXwYr2K6c63l5kL3/cxd5Yi1s=; b=6tenBCsPcJZa6J980m/uevcOMZQcz/Zm2Udm03kgARH9LNrwTpQrKbXiW1a0BQIVpYAr+un8z KBChXogR04pCsWpoQvrOxnXZxzUJrDJS4yDmNx3X9u2nMHz0fPQY12t X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Ifdeffery in C source files is discouraged. Use IS_ENABLED() instead. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- drivers/char/random.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 3860ddd9527930780d5c13cd4742fbc3c27acc42..b0b88c6f6a1afcdb770e39b7a64= cb3408e33bd2c 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -56,9 +56,7 @@ #include #include #include -#ifdef CONFIG_VDSO_GETRANDOM #include -#endif #include #include #include @@ -274,7 +272,7 @@ static void crng_reseed(struct work_struct *work) if (next_gen =3D=3D ULONG_MAX) ++next_gen; WRITE_ONCE(base_crng.generation, next_gen); -#ifdef CONFIG_VDSO_GETRANDOM + /* base_crng.generation's invalid value is ULONG_MAX, while * vdso_k_rng_data->generation's invalid value is 0, so add one to the * former to arrive at the latter. Use smp_store_release so that this @@ -288,8 +286,9 @@ static void crng_reseed(struct work_struct *work) * because the vDSO side only checks whether the value changed, without * actually using or interpreting the value. */ - smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_gen= + 1); -#endif + if (IS_ENABLED(CONFIG_VDSO_GETRANDOM)) + smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_ge= n + 1); + if (!static_branch_likely(&crng_is_ready)) crng_init =3D CRNG_READY; spin_unlock_irqrestore(&base_crng.lock, flags); @@ -742,9 +741,8 @@ static void __cold _credit_init_bits(size_t bits) if (static_key_initialized && system_unbound_wq) queue_work(system_unbound_wq, &set_ready); atomic_notifier_call_chain(&random_ready_notifier, 0, NULL); -#ifdef CONFIG_VDSO_GETRANDOM - WRITE_ONCE(vdso_k_rng_data->is_ready, true); -#endif + if (IS_ENABLED(CONFIG_VDSO_GETRANDOM)) + WRITE_ONCE(vdso_k_rng_data->is_ready, true); wake_up_interruptible(&crng_init_wait); kill_fasync(&fasync, SIGIO, POLL_IN); pr_notice("crng init done\n"); --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 62B293019A3; Thu, 6 Nov 2025 10:02:24 +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=1762423346; cv=none; b=g8/GEyYaHqrNRhAQB7R33ZnjuyZLo26ToF7lRLnokpsaBsjr+b0n9jPOSDbFJgLXRlsG2GPLLaQAypSTfDxaxIPyFH1z2psKMrWe7jIF8vH0NEBASSbqXTjTVXRbOZZcyNoJrv7JSKd7YSTtRJ+QaiYH5xGcFzGd+CAtrFcu9mg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423346; c=relaxed/simple; bh=Yjs06k6xtXBqaQesLwEwImUgnZrxr+a65u05KeyUpws=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I3c4JvmaDQCJja+a+cG78EF4hUdlIlNGd+UqNdNDWhwk9owZrC+QF0hFLsewN2Je5YLHRTiZIxDNc9MiWYo0qzFAYFXEb6fZnT3BnInD1whYdpJvgE1x9dAoKMkUUHybzh5kp0MHR110l3TrBqR/owS2ygwUH0flVpf9EKXFaBo= 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=IUsuDmGs; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tpiCzaPo; 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="IUsuDmGs"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tpiCzaPo" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423340; 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=pR/zA7NHuz/iSgfuExTYGBCAYU1piUOghds7Ej4rutQ=; b=IUsuDmGs4PRzFFRyr7vD8MIHrSJ+2CfOmRQy52IUMQk3iUzZSmR0Z9yHYsiJqDtSDbiFvL XDo11tmBDptuROw9amD9zCloSEFM3zZyGirghc5AXtLKFjRnQZAjDMige60I6dNO/C563V 9mb2vWdM/YR3sm9ruhffdxa8tElNBvMThxftQTGOHqFXgAG3ZZiepa5WZrKrlWPFKO7Hj7 xJYDS+M3Qtol/8NuTdzPV3Gzl2ovZWsu5QkZGHb/VpDClyqoNcAISMCx3skpxA6SAFVR9V OHOXdihLe9gcmOH2y2A1c8sSAYzpzx4YR0hAdhFwCtb8ydP0SKoGxIBRO6meBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423340; 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=pR/zA7NHuz/iSgfuExTYGBCAYU1piUOghds7Ej4rutQ=; b=tpiCzaPoOQcXkY4NknlzZ/2TDP+yG4JRj8lKHuWKNHLuRAwCWQbBf1oeLYma+HGiwxuljR pBDGmjYXUpYsepAw== Date: Thu, 06 Nov 2025 11:02:11 +0100 Subject: [PATCH v5 18/34] random: vDSO: split out datapage update into helper functions 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: <20251106-vdso-sparc64-generic-2-v5-18-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=3858; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Yjs06k6xtXBqaQesLwEwImUgnZrxr+a65u05KeyUpws=; b=jUXgMFk4v+OnZC2gVGG9vK1t35/kfm+bhSmfGpborAwsZpS/GFqmA3fKYIB+bX9Tvdv7UNdzc kVcLAX4ceRmDX1YtnrgL84BUAsv/un8o1m0D75hNLssyK6QnbPcNQzF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Some upcoming changes will introduce additional callers of them. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- drivers/char/random.c | 51 +++++++++++++++++++++++++++++++++--------------= ---- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index b0b88c6f6a1afcdb770e39b7a64cb3408e33bd2c..73c53a4fb949bfd2ed723fa3cec= 3fe0d066a7fa3 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -246,6 +246,37 @@ static unsigned int crng_reseed_interval(void) /* Used by crng_reseed() and crng_make_state() to extract a new seed from = the input pool. */ static void extract_entropy(void *buf, size_t len); =20 +/* This updates the generation in the vDSO data page */ +static void random_vdso_update_generation(unsigned long next_gen) +{ + if (!IS_ENABLED(CONFIG_VDSO_GETRANDOM)) + return; + + /* base_crng.generation's invalid value is ULONG_MAX, while + * vdso_k_rng_data->generation's invalid value is 0, so add one to the + * former to arrive at the latter. Use smp_store_release so that this + * is ordered with the write above to base_crng.generation. Pairs with + * the smp_rmb() before the syscall in the vDSO code. + * + * Cast to unsigned long for 32-bit architectures, since atomic 64-bit + * operations are not supported on those architectures. This is safe + * because base_crng.generation is a 32-bit value. On big-endian + * architectures it will be stored in the upper 32 bits, but that's okay + * because the vDSO side only checks whether the value changed, without + * actually using or interpreting the value. + */ + smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_gen= + 1); +} + +/* This sets is_ready in the vDSO data page */ +static void random_vdso_set_ready(void) +{ + if (!IS_ENABLED(CONFIG_VDSO_GETRANDOM)) + return; + + WRITE_ONCE(vdso_k_rng_data->is_ready, true); +} + /* This extracts a new crng key from the input pool. */ static void crng_reseed(struct work_struct *work) { @@ -272,22 +303,7 @@ static void crng_reseed(struct work_struct *work) if (next_gen =3D=3D ULONG_MAX) ++next_gen; WRITE_ONCE(base_crng.generation, next_gen); - - /* base_crng.generation's invalid value is ULONG_MAX, while - * vdso_k_rng_data->generation's invalid value is 0, so add one to the - * former to arrive at the latter. Use smp_store_release so that this - * is ordered with the write above to base_crng.generation. Pairs with - * the smp_rmb() before the syscall in the vDSO code. - * - * Cast to unsigned long for 32-bit architectures, since atomic 64-bit - * operations are not supported on those architectures. This is safe - * because base_crng.generation is a 32-bit value. On big-endian - * architectures it will be stored in the upper 32 bits, but that's okay - * because the vDSO side only checks whether the value changed, without - * actually using or interpreting the value. - */ - if (IS_ENABLED(CONFIG_VDSO_GETRANDOM)) - smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_ge= n + 1); + random_vdso_update_generation(next_gen); =20 if (!static_branch_likely(&crng_is_ready)) crng_init =3D CRNG_READY; @@ -741,8 +757,7 @@ static void __cold _credit_init_bits(size_t bits) if (static_key_initialized && system_unbound_wq) queue_work(system_unbound_wq, &set_ready); atomic_notifier_call_chain(&random_ready_notifier, 0, NULL); - if (IS_ENABLED(CONFIG_VDSO_GETRANDOM)) - WRITE_ONCE(vdso_k_rng_data->is_ready, true); + random_vdso_set_ready(); wake_up_interruptible(&crng_init_wait); kill_fasync(&fasync, SIGIO, POLL_IN); pr_notice("crng init done\n"); --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 DCA6C30CD83; Thu, 6 Nov 2025 10:02:24 +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=1762423347; cv=none; b=tFiEBDvhJyJbGPw+D+ed+uF1BGRlsG7JTk1K9uF+CfFmk49RS7wyZ4lE8nCNxLvoD5IUOa634tLCgK4PGw9RIbv88TUYkIWVy5z1+zXxCqaNwwrFOXYWaCpBchpYgP/rNHU1p885Q+F5yzKIUuTGF/8iS2duoTE754sCNhgsuDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423347; c=relaxed/simple; bh=nnfqDyJKV+11Uo9x3MwHeHQO2C8dr6iNLVlc2B+leBE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p2vJvxReumtDn2xrtz4JJNjliCBEzhFPjXQ87LIyDUViNAI4v+SC6tfdPE96C31nD7RyX1EAMko4yT8nMMgOxeYGeNagRqNx1jUiaEl0u8IXG/2Nemx60Pf4zFGolQggBT9ywhhi8drURILEPgNeeLYKVtf2Gr6EzrQdbJxErBk= 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=rTh5AzdO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Qr5vrwnE; 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="rTh5AzdO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Qr5vrwnE" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423341; 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=0B7YkbPIlqSoj0P/D9keGEmA0f3ObTbURi5IRJM/pXM=; b=rTh5AzdOU4DHUsOMOnWbiDWfL+4uyMkWzQgAbfZJ/px5TRTZrNIDTQ5TTeK8j5rPXyufjB H7bJxlpK0rm++C8qmfPXxkLG8FHTqSD/zhELreQ8T5p9Q0cQzt6wK/V0m3dogQOnP0FbM/ 9RT3T3flvAyDs4KhiCsPF6GFdy5X0mw9oMNr4mJsaBvWQyZm6B0gkSIdvw61yN8+rF6Rbj 1nT3gT3985ewGn28YEFcGRHfNqjlQDTsvwTd0hf1tBvbJ/fRUFKilM698gBsGW0yi4YU5X B0swcNGWJWJmvRw2ZaaNfivFyarRe2OUT5yQFYyN+MysxmiWwO96f+zE3OLJEw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423341; 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=0B7YkbPIlqSoj0P/D9keGEmA0f3ObTbURi5IRJM/pXM=; b=Qr5vrwnEGTdXs43qwnoObu1jc0kRTBtVkpX/f4DQRjZTbZ71sg8u8jsQ+r2waidhpAyRu1 zkcorxtbtUVF0cBA== Date: Thu, 06 Nov 2025 11:02:12 +0100 Subject: [PATCH v5 19/34] random: vDSO: only access vDSO datapage after random_init() 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: <20251106-vdso-sparc64-generic-2-v5-19-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=2362; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=nnfqDyJKV+11Uo9x3MwHeHQO2C8dr6iNLVlc2B+leBE=; b=fzvKWRUnoil/U9ov/twv/xZgHPWkat/4jEO7Y/mddE/lMWOXMPgXrZ9vAOtQgKUINpEmg86lw xRYdU4WoK0QCIy9rphUvPkmLQd9Dh8lWklVauD+6cPeh6xhrswM7tuq X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Upcoming changes to the generic vDSO library will mean that the vDSO datapage will not yet be usable during early boot. Introduce a static key which prevents early accesses. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- drivers/char/random.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 73c53a4fb949bfd2ed723fa3cec3fe0d066a7fa3..f39524fb076a0c77bab228d4f2d= 45fee37291eb0 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -88,6 +88,7 @@ static DEFINE_STATIC_KEY_FALSE(crng_is_ready); static DECLARE_WAIT_QUEUE_HEAD(crng_init_wait); static struct fasync_struct *fasync; static ATOMIC_NOTIFIER_HEAD(random_ready_notifier); +static DEFINE_STATIC_KEY_FALSE(random_vdso_is_ready); =20 /* Control how we warn userspace. */ static struct ratelimit_state urandom_warning =3D @@ -252,6 +253,9 @@ static void random_vdso_update_generation(unsigned long= next_gen) if (!IS_ENABLED(CONFIG_VDSO_GETRANDOM)) return; =20 + if (!static_branch_likely(&random_vdso_is_ready)) + return; + /* base_crng.generation's invalid value is ULONG_MAX, while * vdso_k_rng_data->generation's invalid value is 0, so add one to the * former to arrive at the latter. Use smp_store_release so that this @@ -274,6 +278,9 @@ static void random_vdso_set_ready(void) if (!IS_ENABLED(CONFIG_VDSO_GETRANDOM)) return; =20 + if (!static_branch_likely(&random_vdso_is_ready)) + return; + WRITE_ONCE(vdso_k_rng_data->is_ready, true); } =20 @@ -925,6 +932,9 @@ void __init random_init(void) _mix_pool_bytes(&entropy, sizeof(entropy)); add_latent_entropy(); =20 + if (IS_ENABLED(CONFIG_VDSO_GETRANDOM)) + static_branch_enable(&random_vdso_is_ready); + /* * If we were initialized by the cpu or bootloader before jump labels * or workqueues are initialized, then we should enable the static @@ -934,8 +944,10 @@ void __init random_init(void) crng_set_ready(NULL); =20 /* Reseed if already seeded by earlier phases. */ - if (crng_ready()) + if (crng_ready()) { crng_reseed(NULL); + random_vdso_set_ready(); + } =20 WARN_ON(register_pm_notifier(&pm_notifier)); =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 BB4B83115B0; Thu, 6 Nov 2025 10:02:25 +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=1762423347; cv=none; b=p14rUuQdYhD7IwWD6k+N75jbt2LTQbvyjvgIWVcuxiLVsiwJNOihm4ll9ysnHwHC+K0eAVyMYYciYdXOzzhjYQmmij+s2eIrrNhkxZViXYrXHVuzDC/hxAJmr8e2E+zrUDPtPs9cbD2Cq+ijW5jkT6vrDEK9em6jyq2p++Mcpwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423347; c=relaxed/simple; bh=2hSFMUISgDavbKKRu1atPOpNqM6l7sLyIWcWtFRLYDU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=H7+vV9yzxapXn53ZtRfIdDQZyjHqSNMhr7LRuJfcRGTUVVESV0STWwmt6XZIh54IX/NNpDQ17bJ2BrAwg1Vi9ptmwCRDLZKP/GIRjkhpwy4cQs3BfJBWAKW/xXqdwEp200ivzzDGDtVj8BLEBccGufsUnlVIPnlRipnGg4hAkqk= 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=IS82j6FD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=IQzJWc/I; 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="IS82j6FD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IQzJWc/I" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423341; 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=y3tGpR5SbTtmYH9/UhUB7FG7sTK6XysaxzCJ0fbVJv4=; b=IS82j6FDl7Ny+WZ6JAbmEnikWn5fk5BKXLGg330FI4L/O4Ay1WXhQlvWJtGmMxqipV2KLM Yyi4cIW0x+8Z2gsq3GhASyD0VgfilEm9lZ852jE1hsXYHm3cDkzarje7iUbTCAsZhb+S/F S6KBL64/N/d2QDM6THqZ+LqVn6PKSjwLFqdScgsG7JZs8K/EtL/xi/oSJiH6kxEmhKV6I1 p17oBsinUPILAKY3wKRPgBuyjXUEpZSL5RajdlPtxQKX4x0iZgr9QXFRBNCjmBMu6jZGEe UaofP2CLbPOqvVUKeUrwqBkqrrGejcEdVWGiL4mjxm0L/wY2zNP1hWX+Fwz+4Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423341; 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=y3tGpR5SbTtmYH9/UhUB7FG7sTK6XysaxzCJ0fbVJv4=; b=IQzJWc/I58sgXAbxGDnvHbnbx22zuN+uYONk9lslfn28Stw1YS7Z19VBWQxpa8nJ0rzmlF 5ao8jqHUHC914jBQ== Date: Thu, 06 Nov 2025 11:02:13 +0100 Subject: [PATCH v5 20/34] s390/time: Set up vDSO datapage later 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: <20251106-vdso-sparc64-generic-2-v5-20-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1384; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=2hSFMUISgDavbKKRu1atPOpNqM6l7sLyIWcWtFRLYDU=; b=Ov4mzaNxAT2GTQwh7RPz3N1qjaNCSocF2bw0jkDMXSFmOiEJkoHSjG7+bqcrj2PG3wzY60VRh T/MQVcZTM9PDCxCMhOiQu3NLt8WCtCrc/0M9p20icPbA/+4/MccBS9w X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Upcoming changes to the generic vDSO library will mean that the vDSO datapage will not yet be usable during time_early_init(). Move the initialization to time_init() which is called later. This is valid as the value of tod_clock_base.tod only changes in stop_machine() context and both time_init_early() and time_init() are called before interrupts are enabled. Signed-off-by: Thomas Wei=C3=9Fschuh Acked-by: Heiko Carstens Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/s390/kernel/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 63517b85f4c930b799235c381d9d6b263fff5431..6b948b9e61fe674bbc842a0143d= d35a26b91a860 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -78,8 +78,6 @@ void __init time_early_init(void) struct ptff_qto qto; struct ptff_qui qui; =20 - vdso_k_time_data->arch_data.tod_delta =3D tod_clock_base.tod; - if (!test_facility(28)) return; =20 @@ -248,6 +246,8 @@ struct clocksource * __init clocksource_default_clock(v= oid) */ void __init time_init(void) { + vdso_k_time_data->arch_data.tod_delta =3D tod_clock_base.tod; + /* Reset time synchronization interfaces. */ stp_reset(); =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 63F6C312805; Thu, 6 Nov 2025 10:02:26 +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=1762423348; cv=none; b=K6grsZlfN2ljEkdpivAfhHCmGC1y7Wm+RBMqeFyk8N8Ej0sCaqFGdxrdFrub+rF1s/LThEZY9zFbOBBCuT8gHZDLojRBhng4cimPNYknUM6QMXUelQpeX7fWsVdglxMDv4l3uAVVLKryRSFaCFGeD32Od4ucgcH8iqzSDZp10fA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423348; c=relaxed/simple; bh=yVlwKjEkg/2DD/Mb0uz8N0TzPw8B5Wtv5ed+5obQYGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JxtJsoCkfR+DAJw6Q+iCkL5Eua11NWvOreHEChfAJb1f40etpor2KC9sFr61ndBvTmwDLCGfWj8JoxqxWukvnNbHWEG2DHsjWcerJxL4ORnWOuNZzLdn4tee1VmbVQYMd1hJQrqOJU/ZS68wv9o20Dc/+Y7grVVVejqx0gK/gFo= 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=w9PW9ll4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=roC/+VvH; 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="w9PW9ll4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="roC/+VvH" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423343; 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=w1SV+PqSrKcBXRE0Ygl0UiayHdt8moxs7tJ8I+04D+8=; b=w9PW9ll4SirBP3p5BmkWSwcxX9yBXq2ZLAtMao42da/rXWAnfeOtC1bJ9E8uAfpxuSE2b8 o07hAS/4ARBr1kRqhqTX3XwZDQsgQ+FrFmE7XJMCGEXaB3jbVJrTSErDfCMYnV+vU7oRWd M3pggh1B7o4RNaeIYbjFDC15R3pGSZ7sPp7WD5gZIuZcMJxq/sUfoDglnjG5zT3qid2PH7 jzIhhtDpYrfa0KoL3/elxR9+XxUP7WmSF6bX5TALqR88WnUut9GIod+6V4RB+c4yddjEKh PRaFadMESxmzpE2bz01vYUPmZZWNXbrxU0DD02uX7uuDs1tPvs5rlLRHiMFQ7g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423343; 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=w1SV+PqSrKcBXRE0Ygl0UiayHdt8moxs7tJ8I+04D+8=; b=roC/+VvH0dZdpOXVcl5LaZh8YoB3OJiAs7429ePimDjbFeWjQFkuAY1yyXpFRnqgrs+hL8 3HyvwAGXnWd15yDQ== Date: Thu, 06 Nov 2025 11:02:14 +0100 Subject: [PATCH v5 21/34] vdso/datastore: Reduce scope of some variables in vvar_fault() 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: <20251106-vdso-sparc64-generic-2-v5-21-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1296; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=yVlwKjEkg/2DD/Mb0uz8N0TzPw8B5Wtv5ed+5obQYGU=; b=rikyX4UvTCgMDvnqGEuNjGrWUOEUBhmdyXJkxjtZyBaXdECGv3cgj+MOuFa0Z7Wx1uBoedvNc xcGQPOSE4rSBWH/8RnmCUhVj64mbOeK2j099iHbxdTUw9CYVbrde/2i X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= These variables are only used inside a single branch. Move their declarations there. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- lib/vdso/datastore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vdso/datastore.c b/lib/vdso/datastore.c index a565c30c71a04ff4116c14f43f4450210eba99c5..2cca4e84e5b5e7686d6a2b42b41= af4f399cc5261 100644 --- a/lib/vdso/datastore.c +++ b/lib/vdso/datastore.c @@ -41,8 +41,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapp= ing *sm, struct vm_area_struct *vma, struct vm_fault *vmf) { struct page *timens_page =3D find_timens_vvar_page(vma); - unsigned long addr, pfn; - vm_fault_t err; + unsigned long pfn; =20 switch (vmf->pgoff) { case VDSO_TIME_PAGE_OFFSET: @@ -54,6 +53,9 @@ static vm_fault_t vvar_fault(const struct vm_special_mapp= ing *sm, * Fault in VVAR page too, since it will be accessed * to get clock data anyway. */ + unsigned long addr; + vm_fault_t err; + addr =3D vmf->address + VDSO_TIMENS_PAGE_OFFSET * PAGE_SIZE; err =3D vmf_insert_pfn(vma, addr, pfn); if (unlikely(err & VM_FAULT_ERROR)) --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 B57A33148C5; Thu, 6 Nov 2025 10:02: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=1762423349; cv=none; b=EPjtBltkQ1EjXZBhNYJ8oqwRx/0jZS066TX63YRjtbg6f1fwS+EOuXz8Yn9zD8mogS9ojn4COgW3sHD7r3QIPW4sSpV9qKhEud+2L2kIzsjqCuwFmbDPtBPgIE3WR+M7rxhznsAU+eRDaDT4tsuE4oa3RQnxLdIVh481U2u3Arg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423349; c=relaxed/simple; bh=T+uiAGc1CKmq8YVTkteEEzyKwhHBee7QKhXDO+NLJos=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mqvJM/n7WLbFBiBNY0G3MI25JkUULmIdeGI24An2hpt1/SCBhK62tnr86xgw2GkPEPZOxN8LZa2FSH7IS82znDl6JMTZ8UK7QFUwV/dd3mKALpYCgqAiVWiuHylI5N7ipMv7dGTSESdUFAtDxQyZETL9yZnHoM1unDrOOTtxpRI= 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=tbND+MAM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KJxy0Hu0; 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="tbND+MAM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KJxy0Hu0" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423344; 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=KXnY5RDni4beXSbCleFNj0bRZgRx9ddsylJ7nscxaEI=; b=tbND+MAMeyx+fk0yJ/fd24KGe5mJWd1cpYUF+EgEy5RSMWNU9wVKBFuZYuVDE0ZKa2FEK+ W8fOKOfS90fbs7xsRINOdinHo39c88MVnDe5/117liIbYwLgOL/lTECYOP+9IsfjWCDYqJ CWfH13aFVOnG27l6AZN+9QhOdCyMcFh7MWNVicil+DbnVZ7IwFynyz9dt7qCBWjMNhxbeW GCwDQun6KMhFpv40hsVTFVyhZVASE11p/ufs+S/uqPKRRF9KkWq37UarEwHZkIB9R9XgSb aSesWat6wMyC2ENPjNaBUMEQXsfU/nf7vY8MMienT1glPNzLtNaOTk8pSTeg5A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423344; 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=KXnY5RDni4beXSbCleFNj0bRZgRx9ddsylJ7nscxaEI=; b=KJxy0Hu0nIBB0e3Xqn7BzYWIodf33bvrkshbLjQ3LDFKz2LO6cHs19pUT2WMB6WMI6WIGu YulAuRKpCrMmrfBw== Date: Thu, 06 Nov 2025 11:02:15 +0100 Subject: [PATCH v5 22/34] vdso/datastore: Drop inclusion of linux/mmap_lock.h 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: <20251106-vdso-sparc64-generic-2-v5-22-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=869; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=T+uiAGc1CKmq8YVTkteEEzyKwhHBee7QKhXDO+NLJos=; b=l/pDlRvM2BSxqqMkxOdOUvUnuXngh23FFVWXSCYQvPR+cRdcuQH2SRNBlbp3Bc8G73DYayDcK 5pW8XK3eTAaAwV+0g4nLCmb2Ffn03OnxY51ln9XIdb5JvG1h5gFOsl7 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= This header is unnecessary and together with some upcoming changes would introduce compiler warnings. Link: https://lore.kernel.org/lkml/20250916-mm-rcuwait-v1-1-39a3beea6ec3@li= nutronix.de/ Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- lib/vdso/datastore.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/vdso/datastore.c b/lib/vdso/datastore.c index 2cca4e84e5b5e7686d6a2b42b41af4f399cc5261..7377fcb6e1dfe31d02ffcae371f= df9da069ae4c1 100644 --- a/lib/vdso/datastore.c +++ b/lib/vdso/datastore.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only =20 #include -#include #include #include #include --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 8AA29314D19; Thu, 6 Nov 2025 10:02:28 +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=1762423351; cv=none; b=DLr97fg1RZ3FrG05uDkqYotDoJTWr3Y03l+gfUlvbYXkfTx7JAIoSx+57MqmCVIHop837cwcyQM7uHitd4v+/EdiD5lIAzaZuphLyw1R0c3eRFFdA/Lmq/DQh4F5BpG/NlsWr+l7R9EcHmN3pWCth0Rt+Qt2nNVHQrW8+bTgO0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423351; c=relaxed/simple; bh=KUrKSj/8f02prXozcbh1y+45HCCmTOvddQy/Fjvkmuc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u/OEhuMrCZQYPLf95Aw6dwOAj8HWh2KWu7XN6YD45Kao3vVTbOaNq8e2unyOQ5cNDSTsd8Nsct2AoNw6vhlYLBOIJxFl50gdyeHrm0LG7xf7/X+vv1mQk79rS6/9GhA6LWJTUfQtMjSyxvf0gWP2Ebrh51vOE5Ee4vvIgUsJEbY= 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=hod7lxXu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LDK8qDC1; 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="hod7lxXu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LDK8qDC1" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423345; 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=Kc8Bzx9ugdMuBCH5n5olH8MPXze3f2dyeA69C+6Yvlo=; b=hod7lxXuzvWGCwvHUBLCNsxQY18vUTE1RK9tRFD5deogA9rzOQ0w6wx5uQrt6VMKb6xCoW OScgE1uwcl9Ppv7i5xEkq2tvqkWNhIkOZKhep5CoxHyofBFFlFWcqle1rNXqS2JONMCw8f 1mO0iLatjFT+iS9OE3kcPHtyQZWzA2lIKlFBcsD+hDWDIXbjwpaHkv2HxDDpsz802pu9XE q98svr261+FIG0+dxauopgGrqbQls8HLrgcashMXPEPGyIUSb4BACdrGKDtjti8hfJLtMm lEGPRwWCulV5lz13eulGjv1DUfm3GFz7ij11tNDv4p6dkfaiO6k7Xjl/dUb2Ww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423345; 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=Kc8Bzx9ugdMuBCH5n5olH8MPXze3f2dyeA69C+6Yvlo=; b=LDK8qDC1zGU5GTK2Xj8DGG7L507w7NkzJaLudz3kj4+O2fDP1Zu0sxDlpt8EQvlbVJuTx/ 6lYf6UbweJMOMOAQ== Date: Thu, 06 Nov 2025 11:02:16 +0100 Subject: [PATCH v5 23/34] vdso/datastore: Allocate data pages dynamically 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: <20251106-vdso-sparc64-generic-2-v5-23-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=7325; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=KUrKSj/8f02prXozcbh1y+45HCCmTOvddQy/Fjvkmuc=; b=UxoHkOStUJytuvy/1z+V4DTApXNkZwzC41300pCa1gMdlaeqNJkUboAM5CEbEeXASFOcGSSrX 2HydbCRqPtaCnEwbYkIx31g11CiabFv77h6qtXP25qklkR37ZudKLll X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Allocating the datapages as part of the kernel image does not work on SPARC. It is also problematic with regards to dcache aliasing as there is no guarantee that the virtual addresses used by the kernel are compatible with those used by userspace. Allocate the data pages through the page allocator instead. Unused pages in the vDSO VMA are still allocated to keep the virtual addresses aligned. Switch the mapping from PFNs to 'struct page' as that is required for dynamically allocated pages. VM_MIXEDMAP is necessary for the call to vmf_insert_page() in the timens prefault path to work. These pages are also used by the timekeeping, random pool and architecture initialization code. Introduce a new early initialization step, to make sure they are available when needed. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- include/linux/vdso_datastore.h | 6 ++++ init/main.c | 2 ++ lib/vdso/datastore.c | 69 ++++++++++++++++++++++----------------= ---- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/include/linux/vdso_datastore.h b/include/linux/vdso_datastore.h index a91fa24b06e09321fdff8c2c7bdfbc1b206db574..0b530428db711e58660e797d9d3= cf5dce60217fe 100644 --- a/include/linux/vdso_datastore.h +++ b/include/linux/vdso_datastore.h @@ -2,9 +2,15 @@ #ifndef _LINUX_VDSO_DATASTORE_H #define _LINUX_VDSO_DATASTORE_H =20 +#ifdef CONFIG_HAVE_GENERIC_VDSO #include =20 extern const struct vm_special_mapping vdso_vvar_mapping; struct vm_area_struct *vdso_install_vvar_mapping(struct mm_struct *mm, uns= igned long addr); =20 +void __init vdso_setup_data_pages(void); +#else /* !CONFIG_HAVE_GENERIC_VDSO */ +static inline void vdso_setup_data_pages(void) { } +#endif /* CONFIG_HAVE_GENERIC_VDSO */ + #endif /* _LINUX_VDSO_DATASTORE_H */ diff --git a/init/main.c b/init/main.c index 07a3116811c5d72cbab48410493b3d0f89d1f1b2..01fa389eb33d58e13388bfaf6a8= 21fe8523f2c76 100644 --- a/init/main.c +++ b/init/main.c @@ -104,6 +104,7 @@ #include #include #include +#include #include =20 #include @@ -1020,6 +1021,7 @@ void start_kernel(void) srcu_init(); hrtimers_init(); softirq_init(); + vdso_setup_data_pages(); timekeeping_init(); time_init(); =20 diff --git a/lib/vdso/datastore.c b/lib/vdso/datastore.c index 7377fcb6e1dfe31d02ffcae371fdf9da069ae4c1..222ae268715d0413f54a477c65d= 456bd8d58981e 100644 --- a/lib/vdso/datastore.c +++ b/lib/vdso/datastore.c @@ -1,52 +1,56 @@ // SPDX-License-Identifier: GPL-2.0-only =20 -#include +#include #include #include #include #include #include =20 -/* - * The vDSO data page. - */ #ifdef CONFIG_GENERIC_GETTIMEOFDAY -static union { - struct vdso_time_data data; - u8 page[PAGE_SIZE]; -} vdso_time_data_store __page_aligned_data; -struct vdso_time_data *vdso_k_time_data =3D &vdso_time_data_store.data; -static_assert(sizeof(vdso_time_data_store) =3D=3D PAGE_SIZE); +struct vdso_time_data *vdso_k_time_data; +static_assert(sizeof(struct vdso_time_data) <=3D PAGE_SIZE); #endif /* CONFIG_GENERIC_GETTIMEOFDAY */ =20 #ifdef CONFIG_VDSO_GETRANDOM -static union { - struct vdso_rng_data data; - u8 page[PAGE_SIZE]; -} vdso_rng_data_store __page_aligned_data; -struct vdso_rng_data *vdso_k_rng_data =3D &vdso_rng_data_store.data; -static_assert(sizeof(vdso_rng_data_store) =3D=3D PAGE_SIZE); +struct vdso_rng_data *vdso_k_rng_data; +static_assert(sizeof(struct vdso_rng_data) <=3D PAGE_SIZE); #endif /* CONFIG_VDSO_GETRANDOM */ =20 #ifdef CONFIG_ARCH_HAS_VDSO_ARCH_DATA -static union { - struct vdso_arch_data data; - u8 page[VDSO_ARCH_DATA_SIZE]; -} vdso_arch_data_store __page_aligned_data; -struct vdso_arch_data *vdso_k_arch_data =3D &vdso_arch_data_store.data; +struct vdso_arch_data *vdso_k_arch_data; #endif /* CONFIG_ARCH_HAS_VDSO_ARCH_DATA */ =20 +void __init vdso_setup_data_pages(void) +{ + unsigned int order =3D get_order(VDSO_NR_PAGES * PAGE_SIZE); + struct folio *folio =3D folio_alloc(GFP_KERNEL | __GFP_ZERO, order); + + if (!folio) + panic("Unable to allocate VDSO storage pages"); + + if (IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)) + vdso_k_time_data =3D page_address(folio_page(folio, VDSO_TIME_PAGE_OFFSE= T)); + + if (IS_ENABLED(CONFIG_VDSO_GETRANDOM)) + vdso_k_rng_data =3D page_address(folio_page(folio, VDSO_RNG_PAGE_OFFSET)= ); + + if (IS_ENABLED(CONFIG_ARCH_HAS_VDSO_ARCH_DATA)) + vdso_k_arch_data =3D page_address(folio_page(folio, VDSO_ARCH_PAGES_STAR= T)); +} + static vm_fault_t vvar_fault(const struct vm_special_mapping *sm, struct vm_area_struct *vma, struct vm_fault *vmf) { - struct page *timens_page =3D find_timens_vvar_page(vma); - unsigned long pfn; + struct page *page, *timens_page; + + timens_page =3D find_timens_vvar_page(vma); =20 switch (vmf->pgoff) { case VDSO_TIME_PAGE_OFFSET: if (!IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)) return VM_FAULT_SIGBUS; - pfn =3D __phys_to_pfn(__pa_symbol(vdso_k_time_data)); + page =3D virt_to_page(vdso_k_time_data); if (timens_page) { /* * Fault in VVAR page too, since it will be accessed @@ -56,10 +60,10 @@ static vm_fault_t vvar_fault(const struct vm_special_ma= pping *sm, vm_fault_t err; =20 addr =3D vmf->address + VDSO_TIMENS_PAGE_OFFSET * PAGE_SIZE; - err =3D vmf_insert_pfn(vma, addr, pfn); + err =3D vmf_insert_page(vma, addr, page); if (unlikely(err & VM_FAULT_ERROR)) return err; - pfn =3D page_to_pfn(timens_page); + page =3D timens_page; } break; case VDSO_TIMENS_PAGE_OFFSET: @@ -72,24 +76,25 @@ static vm_fault_t vvar_fault(const struct vm_special_ma= pping *sm, */ if (!IS_ENABLED(CONFIG_TIME_NS) || !timens_page) return VM_FAULT_SIGBUS; - pfn =3D __phys_to_pfn(__pa_symbol(vdso_k_time_data)); + page =3D virt_to_page(vdso_k_time_data); break; case VDSO_RNG_PAGE_OFFSET: if (!IS_ENABLED(CONFIG_VDSO_GETRANDOM)) return VM_FAULT_SIGBUS; - pfn =3D __phys_to_pfn(__pa_symbol(vdso_k_rng_data)); + page =3D virt_to_page(vdso_k_rng_data); break; case VDSO_ARCH_PAGES_START ... VDSO_ARCH_PAGES_END: if (!IS_ENABLED(CONFIG_ARCH_HAS_VDSO_ARCH_DATA)) return VM_FAULT_SIGBUS; - pfn =3D __phys_to_pfn(__pa_symbol(vdso_k_arch_data)) + - vmf->pgoff - VDSO_ARCH_PAGES_START; + page =3D virt_to_page(vdso_k_arch_data) + vmf->pgoff - VDSO_ARCH_PAGES_S= TART; break; default: return VM_FAULT_SIGBUS; } =20 - return vmf_insert_pfn(vma, vmf->address, pfn); + get_page(page); + vmf->page =3D page; + return 0; } =20 const struct vm_special_mapping vdso_vvar_mapping =3D { @@ -101,7 +106,7 @@ struct vm_area_struct *vdso_install_vvar_mapping(struct= mm_struct *mm, unsigned { return _install_special_mapping(mm, addr, VDSO_NR_PAGES * PAGE_SIZE, VM_READ | VM_MAYREAD | VM_IO | VM_DONTDUMP | - VM_PFNMAP | VM_SEALED_SYSMAP, + VM_MIXEDMAP | VM_SEALED_SYSMAP, &vdso_vvar_mapping); } =20 --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 B9B373168E4; Thu, 6 Nov 2025 10:02:29 +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=1762423352; cv=none; b=XGOARkTQhhX0CKKEbrIjGiSbGZ8VOP+HvnOsv8YB7ASgSyyt7iUjdyvs02tZI7LSEM2Kd5B9nhxf1Au53BB3Z8vNuMaOA8bNHsWYWdFwbquLkhyLSL7RS09NVjL1i2sXSDLnroLD1k3Kka4ZO8gfJmw/Rri6PGIGc1TjTI/Zi8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423352; c=relaxed/simple; bh=i+D0m1xzFKLn45sG3YvmSAccyUMoIH83lYmvGLk5jvY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kkpmUPBq/x6O86yJOrDWCQRRd4U8lCOvQw2H4QbuDMMpVxwB0+zlSLRGA2Xpwtty76F97Ju35KYtYF716G2PDZ45IN0627zfaMMRY5Qu2tpBaFQ5OAgKhkXGpVYYFQe5HppnOCmmsABi8JMtY8XLlbBZeDCZWm+22QlS0zIwl34= 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=skVRgC4g; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=i1XQoQKJ; 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="skVRgC4g"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="i1XQoQKJ" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423346; 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=uwthaOGY1VLvaz+koev4FhKg8AeyDPmuh05iyUl1cmc=; b=skVRgC4gH6P2zvvdBEhPvMceZicgLV7G3ARfHqsu7kote6DHRA1PtpLzA7tGQYqOXl6sqz 8mJd46SiCGNtgwx2XNiGcQi8CVKlhdj8BIJdAj/SrmYbOV4klkoXsKCBALWTVXnv/BNjYA CZXpAqKp87ytTrKr73gbu4+wCARGw6q/rtMtx29iJP++LrV/GCT2ZrngzSGNuN+veor700 peaULKA70XOJ0BY/6bdYVVuVbCdiAwNOFPvLXByJoW7LFXU/jKAwn27R7bLxDexkUpyEPw wzBO0dxniDk6roNkDEhnQSt60stDELuuEoO3kyuujunps/NdnvvWzFMesDpQzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423346; 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=uwthaOGY1VLvaz+koev4FhKg8AeyDPmuh05iyUl1cmc=; b=i1XQoQKJV2sbgKjkS47zedaQfY5QPp6KbbqYKW+POJnEjHLwRUHOmHy9fFFURqsCFCPQ/+ t1Y0kMeqhEW74XAg== Date: Thu, 06 Nov 2025 11:02:17 +0100 Subject: [PATCH v5 24/34] sparc64: vdso: Link with -z noexecstack 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: <20251106-vdso-sparc64-generic-2-v5-24-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Arnd Bergmann X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1559; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=i+D0m1xzFKLn45sG3YvmSAccyUMoIH83lYmvGLk5jvY=; b=42sTJ2X7fGiMZ5Xu7zBc6SU+l12x/X0CKpjbGH10IJZD5almYA+auGYbhtGawL/Max8sluWXS orCrl7JSnOzCM27WaZ4mymSYVL9a/a9q3Bf824fP0Eq94V9mllhIkUR X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The vDSO stack does not need to be executable. Prevent the linker from creating executable. For more background see commit ffcf9c5700e4 ("x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments"). Also prevent the following warning from the linker: sparc64-linux-ld: warning: arch/sparc/vdso/vdso-note.o: missing .note.GNU-s= tack section implies executable stack sparc64-linux-ld: NOTE: This behaviour is deprecated and will be removed in= a future version of the linker Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/20250707144726.4008707-1-arnd@kernel.org/ Fixes: 9a08862a5d2e ("vDSO for sparc") Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/vdso/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile index 1a4e585c91d7d03d8444cc2e4914fd10cd078fb8..2e911ccc9db71b2888ffc432d75= ac8815ecce0f7 100644 --- a/arch/sparc/vdso/Makefile +++ b/arch/sparc/vdso/Makefile @@ -107,4 +107,4 @@ quiet_cmd_vdso =3D VDSO $@ $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ -T $(filter %.lds,$^) $(filter %.o,$^) =20 -VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 -Bsymbolic = --no-undefined +VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 -Bsymbolic = --no-undefined -z noexecstack --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 C51F53195F6; Thu, 6 Nov 2025 10:02:30 +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=1762423353; cv=none; b=bmfv4UPrqVQV0Ak38MSVMyKVAThlWofg/cFwru+gez3zGlFssuRPYU4fsz8vhwsucmzj/GlOsPgX+NvyYPYlz4zHkFBpeG0XwPDzKUKvnRV+Jj6lPlS39Xb8Ni+rbZxtTtl4aQw8bSICGb5UXNDVzknm1M4OwMnCbAV0zIKsxtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423353; c=relaxed/simple; bh=GDhW6FGM84lRP3KSHJ2KY17zwk8LQQyNxwfOvs9V2nc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XuIldnfIzdN5wmzilVanHxXCGGvdmV7+LNeVDmQ7UgaKrhDCfF4HEM1dE6raXB4PqnIM16hVisTj/xN2Buq9QgOS/ZfYVeE02/7nhzqjq3pC4qH8U8UA5BYWpERy531tGbQdhuVr6PcuvfR2M27dEHULpZYjid4RUhKHm3/Nky4= 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=Wpn5TBFc; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=MPlaJ2oX; 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="Wpn5TBFc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MPlaJ2oX" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423346; 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=4Gwgq8AosyJkorQ2Vw4pdkWCqDOsbs+MKvc8HYWAt8Q=; b=Wpn5TBFcz+TLf6k15Chy3nxL1iQZHa89Ifq3BgFDR3tjw2z5GT6b8ZeWW/PUdHhTX2ObXE HLhC2bQCTL3+3t8eecSuCeDOPaeh01bd0ZpjKP+AiurqC4dRD6z0rAkaH2DjKkfZ192W5y Gqi575+2GkY/36msQBVBwSxgpol6psVs7tkfhIYwr+7bALKk7VLV0nrvvT3v0eX/0C3zDt 1jCp7HGfZWFW/EJf804MykMkC8pBdu1KUNjq/+H5L4K9XykarmB1oxRXHRvITQApHW/wyQ wTXVgZE4f07+RFx8lGOIxQ2rtWW5m/KIcYKYXHEcFtE3Ff6uGKuS0IGxgSZBSw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423346; 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=4Gwgq8AosyJkorQ2Vw4pdkWCqDOsbs+MKvc8HYWAt8Q=; b=MPlaJ2oXDOC79k+wbKcStJe48ElKWz/4NdJV9VTVo8fV2mjuZEkEU3UnrQlMEfYFZBlLhI m2HYzDURzmoQ5NBw== Date: Thu, 06 Nov 2025 11:02:18 +0100 Subject: [PATCH v5 25/34] sparc64: vdso: Remove obsolete "fake section table" reservation 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: <20251106-vdso-sparc64-generic-2-v5-25-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=2715; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=GDhW6FGM84lRP3KSHJ2KY17zwk8LQQyNxwfOvs9V2nc=; b=zZfZYTdKl8XpGGMBfdQpIBy75in2sgaWAqUbbXJgw3wbrEZdfYUPvZgrq4x3BrA+K0lD7nhn2 r1+6qpM8QE/CceBH3mkFPM089UKvto97lGe1g75Z5BgV1cpdbFWBk2M X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= When the vDSO logic was copied from x86 to SPARC some unused remnants of the fake section handling were copied, too. In x86 the original fake section handling had already been removed incompletely in commit da861e18eccc ("x86, vdso: Get rid of the fake section mechanism"). On x86 the reservation was only cleaned up in commit 24b7c77bbb24 ("x86/vdso: Remove obsolete "fake section table" reservation"). Remove the reservation for SPARC, too. Fixes: 9a08862a5d2e ("vDSO for sparc") Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/vdso/vdso-layout.lds.S | 21 --------------------- arch/sparc/vdso/vdso2c.c | 8 -------- 2 files changed, 29 deletions(-) diff --git a/arch/sparc/vdso/vdso-layout.lds.S b/arch/sparc/vdso/vdso-layou= t.lds.S index d31e57e8a3bbffd3afb187cd631e2491fde64148..9e0804789d11696948f11be3674= 80b530a1f18d9 100644 --- a/arch/sparc/vdso/vdso-layout.lds.S +++ b/arch/sparc/vdso/vdso-layout.lds.S @@ -4,16 +4,6 @@ * This script controls its layout. */ =20 -#if defined(BUILD_VDSO64) -# define SHDR_SIZE 64 -#elif defined(BUILD_VDSO32) -# define SHDR_SIZE 40 -#else -# error unknown VDSO target -#endif - -#define NUM_FAKE_SHDRS 7 - SECTIONS { /* @@ -47,19 +37,8 @@ SECTIONS *(.bss*) *(.dynbss*) *(.gnu.linkonce.b.*) - - /* - * Ideally this would live in a C file: kept in here for - * compatibility with x86-64. - */ - VDSO_FAKE_SECTION_TABLE_START =3D .; - . =3D . + NUM_FAKE_SHDRS * SHDR_SIZE; - VDSO_FAKE_SECTION_TABLE_END =3D .; } :text =20 - .fake_shstrtab : { *(.fake_shstrtab) } :text - - .note : { *(.note.*) } :text :note =20 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr diff --git a/arch/sparc/vdso/vdso2c.c b/arch/sparc/vdso/vdso2c.c index dc81240aab6fd31a72b8a751cc2a4a821a3c4e4e..b97af5ec9f35c01f2a976b6213b= 1768b677ad231 100644 --- a/arch/sparc/vdso/vdso2c.c +++ b/arch/sparc/vdso/vdso2c.c @@ -61,8 +61,6 @@ const char *outfilename; /* Symbols that we need in vdso2c. */ enum { sym_vvar_start, - sym_VDSO_FAKE_SECTION_TABLE_START, - sym_VDSO_FAKE_SECTION_TABLE_END, }; =20 struct vdso_sym { @@ -72,12 +70,6 @@ struct vdso_sym { =20 struct vdso_sym required_syms[] =3D { [sym_vvar_start] =3D {"vvar_start", 1}, - [sym_VDSO_FAKE_SECTION_TABLE_START] =3D { - "VDSO_FAKE_SECTION_TABLE_START", 0 - }, - [sym_VDSO_FAKE_SECTION_TABLE_END] =3D { - "VDSO_FAKE_SECTION_TABLE_END", 0 - }, }; =20 __attribute__((format(printf, 1, 2))) __attribute__((noreturn)) --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 1BACF319608; Thu, 6 Nov 2025 10:02:31 +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=1762423354; cv=none; b=Y/r3HfNm+TYrxoCvpU56TH7pG6g75Q9lGq2gnfIZv7J2gvzp3P6uGj2IQzGFY1FrJip/dDxUjagnMiohDHbz01FbPQq+RMH8rJf8iYfWMV1Nl1BBltRAlNfvrKETWn/DKpcKPECY7+lUanQYWG+57yYqBu4XiofyZOAa2rYD8I8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423354; c=relaxed/simple; bh=Dk6/zRvs6hLB0DxUOBRWjYkWGPTE1GSbA4Q7HUa9KRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UnkrgoWKn3ZF3NJ8rwcvQIqAem2hVus0vI62CwOhMrMPuPqP/2E/XNNBDZ1XFAt6Xhr/a7MwetdI+K1bLO5RQ3vlZH45cwl5OfgPHH76ZitF+eIHN6Kp2cGBE+aI47CC3ZKYDvMtBUA3XHoryJSqaQYd6IV9i3kB4j5euP7B9Jk= 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=GZh7yXHR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NOK3jp+B; 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="GZh7yXHR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NOK3jp+B" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423347; 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=AmCyXJM9g6bCmh6RN/1dLd0bXdDFECj++OPWFkMJwek=; b=GZh7yXHRE6jcB6SUBle/vVRqlU5iQYZNvUyq0NTwRg8eufs7iVn4m2vbaEWprrzdQnYLnh 7YrHLm1wKX2qe01YPup7x5wgri16o3eUwU9Ow7QKUShGc/VCw7GVxIfH+rZ2GqJ81Pr3ah LYfjLwB78WHQ3PtHhxljP7WscGZuNWOFcShGwblWQiymWHWXndLnws5WKDcNVb73GbwTcU N+my2GnDkrdUrRSTaXHmRv4CzLENhf76gbHiiVzNzpTdb3nq+5kX05knaewclYjmigaJ6W DTRBFtc4DrUCkXfPJ/iomNFnSuTZNyoL5c6dOSbpx1H/wQZrnHgsn39TU8VJ7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423347; 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=AmCyXJM9g6bCmh6RN/1dLd0bXdDFECj++OPWFkMJwek=; b=NOK3jp+Bts1iFld/XpMYSiF8iNYUPaVJ5+r99hZY0ETQAl0e9LbfeBlQnZgH9vKVC8LVP3 wiowC6WvzXjHRgDg== Date: Thu, 06 Nov 2025 11:02:19 +0100 Subject: [PATCH v5 26/34] sparc64: vdso: Replace code patching with runtime conditional 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: <20251106-vdso-sparc64-generic-2-v5-26-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=12052; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Dk6/zRvs6hLB0DxUOBRWjYkWGPTE1GSbA4Q7HUa9KRM=; b=1a7wEL+1EC9D2PSqoXmnbpzxgfC/OnX1uimhRxaeCAboU45AopbMFjjTl9R02EfRgzOq/CNgm eV4cat4tunmB0cYgvqqeJk5Mdc2e06+SvHCMwoDX93gokofq8lUIgK9 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The patching logic is unnecessarily complicated and stands in the way of the adoption of the generic vDSO framework. Replace it by a simple runtime switch, similar to other architectures. Suggested-by: Thomas Gleixner Link: https://lore.kernel.org/lkml/87ecu9tfhw.ffs@tglx/ Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/vdso/vclock_gettime.c | 112 +------------------- arch/sparc/vdso/vdso.lds.S | 2 - arch/sparc/vdso/vdso32/vdso32.lds.S | 2 - arch/sparc/vdso/vma.c | 204 --------------------------------= ---- 4 files changed, 4 insertions(+), 316 deletions(-) diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gett= ime.c index 79607804ea1b0f321215a9c4b5ead1edeb912e64..643608bffe13d904c5f77edd585= b2e58277491fb 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -148,17 +148,11 @@ notrace static __always_inline u64 vgetsns(struct vva= r_data *vvar) u64 v; u64 cycles; =20 - cycles =3D vread_tick(); - v =3D (cycles - vvar->clock.cycle_last) & vvar->clock.mask; - return v * vvar->clock.mult; -} - -notrace static __always_inline u64 vgetsns_stick(struct vvar_data *vvar) -{ - u64 v; - u64 cycles; + if (likely(vvar->vclock_mode =3D=3D VCLOCK_STICK)) + cycles =3D vread_tick_stick(); + else + cycles =3D vread_tick(); =20 - cycles =3D vread_tick_stick(); v =3D (cycles - vvar->clock.cycle_last) & vvar->clock.mask; return v * vvar->clock.mult; } @@ -183,26 +177,6 @@ notrace static __always_inline int do_realtime(struct = vvar_data *vvar, return 0; } =20 -notrace static __always_inline int do_realtime_stick(struct vvar_data *vva= r, - struct __kernel_old_timespec *ts) -{ - unsigned long seq; - u64 ns; - - do { - seq =3D vvar_read_begin(vvar); - ts->tv_sec =3D vvar->wall_time_sec; - ns =3D vvar->wall_time_snsec; - ns +=3D vgetsns_stick(vvar); - ns =3D __shr64(ns, vvar->clock.shift); - } while (unlikely(vvar_read_retry(vvar, seq))); - - ts->tv_sec +=3D __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); - ts->tv_nsec =3D ns; - - return 0; -} - notrace static __always_inline int do_monotonic(struct vvar_data *vvar, struct __kernel_old_timespec *ts) { @@ -223,26 +197,6 @@ notrace static __always_inline int do_monotonic(struct= vvar_data *vvar, return 0; } =20 -notrace static __always_inline int do_monotonic_stick(struct vvar_data *vv= ar, - struct __kernel_old_timespec *ts) -{ - unsigned long seq; - u64 ns; - - do { - seq =3D vvar_read_begin(vvar); - ts->tv_sec =3D vvar->monotonic_time_sec; - ns =3D vvar->monotonic_time_snsec; - ns +=3D vgetsns_stick(vvar); - ns =3D __shr64(ns, vvar->clock.shift); - } while (unlikely(vvar_read_retry(vvar, seq))); - - ts->tv_sec +=3D __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); - ts->tv_nsec =3D ns; - - return 0; -} - notrace static int do_realtime_coarse(struct vvar_data *vvar, struct __kernel_old_timespec *ts) { @@ -298,31 +252,6 @@ int clock_gettime(clockid_t, struct __kernel_old_timespec *) __attribute__((weak, alias("__vdso_clock_gettime"))); =20 -notrace int -__vdso_clock_gettime_stick(clockid_t clock, struct __kernel_old_timespec *= ts) -{ - struct vvar_data *vvd =3D get_vvar_data(); - - switch (clock) { - case CLOCK_REALTIME: - if (unlikely(vvd->vclock_mode =3D=3D VCLOCK_NONE)) - break; - return do_realtime_stick(vvd, ts); - case CLOCK_MONOTONIC: - if (unlikely(vvd->vclock_mode =3D=3D VCLOCK_NONE)) - break; - return do_monotonic_stick(vvd, ts); - case CLOCK_REALTIME_COARSE: - return do_realtime_coarse(vvd, ts); - case CLOCK_MONOTONIC_COARSE: - return do_monotonic_coarse(vvd, ts); - } - /* - * Unknown clock ID ? Fall back to the syscall. - */ - return vdso_fallback_gettime(clock, ts); -} - notrace int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { @@ -358,36 +287,3 @@ __vdso_gettimeofday(struct __kernel_old_timeval *tv, s= truct timezone *tz) int gettimeofday(struct __kernel_old_timeval *, struct timezone *) __attribute__((weak, alias("__vdso_gettimeofday"))); - -notrace int -__vdso_gettimeofday_stick(struct __kernel_old_timeval *tv, struct timezone= *tz) -{ - struct vvar_data *vvd =3D get_vvar_data(); - - if (likely(vvd->vclock_mode !=3D VCLOCK_NONE)) { - if (likely(tv !=3D NULL)) { - union tstv_t { - struct __kernel_old_timespec ts; - struct __kernel_old_timeval tv; - } *tstv =3D (union tstv_t *) tv; - do_realtime_stick(vvd, &tstv->ts); - /* - * Assign before dividing to ensure that the division is - * done in the type of tv_usec, not tv_nsec. - * - * There cannot be > 1 billion usec in a second: - * do_realtime() has already distributed such overflow - * into tv_sec. So we can assign it to an int safely. - */ - tstv->tv.tv_usec =3D tstv->ts.tv_nsec; - tstv->tv.tv_usec /=3D 1000; - } - if (unlikely(tz !=3D NULL)) { - /* Avoid memcpy. Some old compilers fail to inline it */ - tz->tz_minuteswest =3D vvd->tz_minuteswest; - tz->tz_dsttime =3D vvd->tz_dsttime; - } - return 0; - } - return vdso_fallback_gettimeofday(tv, tz); -} diff --git a/arch/sparc/vdso/vdso.lds.S b/arch/sparc/vdso/vdso.lds.S index 629ab6900df7156fc18b450dc3bbfba1bbd20e65..f3caa29a331c58175b67ea60d7a= c15cd467fe5ff 100644 --- a/arch/sparc/vdso/vdso.lds.S +++ b/arch/sparc/vdso/vdso.lds.S @@ -18,10 +18,8 @@ VERSION { global: clock_gettime; __vdso_clock_gettime; - __vdso_clock_gettime_stick; gettimeofday; __vdso_gettimeofday; - __vdso_gettimeofday_stick; local: *; }; } diff --git a/arch/sparc/vdso/vdso32/vdso32.lds.S b/arch/sparc/vdso/vdso32/v= dso32.lds.S index 218930fdff03d598d74a991657c109c3b15ce752..53575ee154c492f9503efdd8f99= 5ac2a035203c7 100644 --- a/arch/sparc/vdso/vdso32/vdso32.lds.S +++ b/arch/sparc/vdso/vdso32/vdso32.lds.S @@ -17,10 +17,8 @@ VERSION { global: clock_gettime; __vdso_clock_gettime; - __vdso_clock_gettime_stick; gettimeofday; __vdso_gettimeofday; - __vdso_gettimeofday_stick; local: *; }; } diff --git a/arch/sparc/vdso/vma.c b/arch/sparc/vdso/vma.c index bab7a59575e882d911c5d1b0903f45cec353aef0..582d84e2e5ba8932f39948bb0ca= 2678fc8f06a10 100644 --- a/arch/sparc/vdso/vma.c +++ b/arch/sparc/vdso/vma.c @@ -42,203 +42,6 @@ static struct vm_special_mapping vdso_mapping32 =3D { =20 struct vvar_data *vvar_data; =20 -struct vdso_elfinfo32 { - Elf32_Ehdr *hdr; - Elf32_Sym *dynsym; - unsigned long dynsymsize; - const char *dynstr; - unsigned long text; -}; - -struct vdso_elfinfo64 { - Elf64_Ehdr *hdr; - Elf64_Sym *dynsym; - unsigned long dynsymsize; - const char *dynstr; - unsigned long text; -}; - -struct vdso_elfinfo { - union { - struct vdso_elfinfo32 elf32; - struct vdso_elfinfo64 elf64; - } u; -}; - -static void *one_section64(struct vdso_elfinfo64 *e, const char *name, - unsigned long *size) -{ - const char *snames; - Elf64_Shdr *shdrs; - unsigned int i; - - shdrs =3D (void *)e->hdr + e->hdr->e_shoff; - snames =3D (void *)e->hdr + shdrs[e->hdr->e_shstrndx].sh_offset; - for (i =3D 1; i < e->hdr->e_shnum; i++) { - if (!strcmp(snames+shdrs[i].sh_name, name)) { - if (size) - *size =3D shdrs[i].sh_size; - return (void *)e->hdr + shdrs[i].sh_offset; - } - } - return NULL; -} - -static int find_sections64(const struct vdso_image *image, struct vdso_elf= info *_e) -{ - struct vdso_elfinfo64 *e =3D &_e->u.elf64; - - e->hdr =3D image->data; - e->dynsym =3D one_section64(e, ".dynsym", &e->dynsymsize); - e->dynstr =3D one_section64(e, ".dynstr", NULL); - - if (!e->dynsym || !e->dynstr) { - pr_err("VDSO64: Missing symbol sections.\n"); - return -ENODEV; - } - return 0; -} - -static Elf64_Sym *find_sym64(const struct vdso_elfinfo64 *e, const char *n= ame) -{ - unsigned int i; - - for (i =3D 0; i < (e->dynsymsize / sizeof(Elf64_Sym)); i++) { - Elf64_Sym *s =3D &e->dynsym[i]; - if (s->st_name =3D=3D 0) - continue; - if (!strcmp(e->dynstr + s->st_name, name)) - return s; - } - return NULL; -} - -static int patchsym64(struct vdso_elfinfo *_e, const char *orig, - const char *new) -{ - struct vdso_elfinfo64 *e =3D &_e->u.elf64; - Elf64_Sym *osym =3D find_sym64(e, orig); - Elf64_Sym *nsym =3D find_sym64(e, new); - - if (!nsym || !osym) { - pr_err("VDSO64: Missing symbols.\n"); - return -ENODEV; - } - osym->st_value =3D nsym->st_value; - osym->st_size =3D nsym->st_size; - osym->st_info =3D nsym->st_info; - osym->st_other =3D nsym->st_other; - osym->st_shndx =3D nsym->st_shndx; - - return 0; -} - -static void *one_section32(struct vdso_elfinfo32 *e, const char *name, - unsigned long *size) -{ - const char *snames; - Elf32_Shdr *shdrs; - unsigned int i; - - shdrs =3D (void *)e->hdr + e->hdr->e_shoff; - snames =3D (void *)e->hdr + shdrs[e->hdr->e_shstrndx].sh_offset; - for (i =3D 1; i < e->hdr->e_shnum; i++) { - if (!strcmp(snames+shdrs[i].sh_name, name)) { - if (size) - *size =3D shdrs[i].sh_size; - return (void *)e->hdr + shdrs[i].sh_offset; - } - } - return NULL; -} - -static int find_sections32(const struct vdso_image *image, struct vdso_elf= info *_e) -{ - struct vdso_elfinfo32 *e =3D &_e->u.elf32; - - e->hdr =3D image->data; - e->dynsym =3D one_section32(e, ".dynsym", &e->dynsymsize); - e->dynstr =3D one_section32(e, ".dynstr", NULL); - - if (!e->dynsym || !e->dynstr) { - pr_err("VDSO32: Missing symbol sections.\n"); - return -ENODEV; - } - return 0; -} - -static Elf32_Sym *find_sym32(const struct vdso_elfinfo32 *e, const char *n= ame) -{ - unsigned int i; - - for (i =3D 0; i < (e->dynsymsize / sizeof(Elf32_Sym)); i++) { - Elf32_Sym *s =3D &e->dynsym[i]; - if (s->st_name =3D=3D 0) - continue; - if (!strcmp(e->dynstr + s->st_name, name)) - return s; - } - return NULL; -} - -static int patchsym32(struct vdso_elfinfo *_e, const char *orig, - const char *new) -{ - struct vdso_elfinfo32 *e =3D &_e->u.elf32; - Elf32_Sym *osym =3D find_sym32(e, orig); - Elf32_Sym *nsym =3D find_sym32(e, new); - - if (!nsym || !osym) { - pr_err("VDSO32: Missing symbols.\n"); - return -ENODEV; - } - osym->st_value =3D nsym->st_value; - osym->st_size =3D nsym->st_size; - osym->st_info =3D nsym->st_info; - osym->st_other =3D nsym->st_other; - osym->st_shndx =3D nsym->st_shndx; - - return 0; -} - -static int find_sections(const struct vdso_image *image, struct vdso_elfin= fo *e, - bool elf64) -{ - if (elf64) - return find_sections64(image, e); - else - return find_sections32(image, e); -} - -static int patch_one_symbol(struct vdso_elfinfo *e, const char *orig, - const char *new_target, bool elf64) -{ - if (elf64) - return patchsym64(e, orig, new_target); - else - return patchsym32(e, orig, new_target); -} - -static int stick_patch(const struct vdso_image *image, struct vdso_elfinfo= *e, bool elf64) -{ - int err; - - err =3D find_sections(image, e, elf64); - if (err) - return err; - - err =3D patch_one_symbol(e, - "__vdso_gettimeofday", - "__vdso_gettimeofday_stick", elf64); - if (err) - return err; - - return patch_one_symbol(e, - "__vdso_clock_gettime", - "__vdso_clock_gettime_stick", elf64); - return 0; -} - /* * Allocate pages for the vdso and vvar, and copy in the vdso text from the * kernel image. @@ -250,15 +53,8 @@ static int __init init_vdso_image(const struct vdso_ima= ge *image, int cnpages =3D (image->size) / PAGE_SIZE; struct page *dp, **dpp =3D NULL; struct page *cp, **cpp =3D NULL; - struct vdso_elfinfo ei; int i, dnpages =3D 0; =20 - if (tlb_type !=3D spitfire) { - int err =3D stick_patch(image, &ei, elf64); - if (err) - return err; - } - /* * First, the vdso text. This is initialied data, an integral number of * pages long. --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 44F9D31B108; Thu, 6 Nov 2025 10:02:32 +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=1762423354; cv=none; b=t79Z5+oLKGjZYLHHBTD7+CJcxRrfYXTURpJoQz1tNzH55h0CU38Ualtc8tg6f9a3aWUbGsj8UU4DFeeN11Ne/xB2uQZPQd5zYyF14s61Cdk64AjOmP39sMcBbYSrpQ1K4M26ucar0oSn1vJ5VTRrP48RT1FD0iAEYGxI4XrkXDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423354; c=relaxed/simple; bh=T690CgHOC0+pGW9MJ3oWsROYo+v+vkE9Ah57C6iq4Fo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IpUvtulDSaGjuwWvomtH4/hUt0d8SwxiPCZoR/kkHRnbZ5q0D6ZGS7oLAYFejzIgZgFGFGD8MdkoAa2RQPrkWKNMNGgSw3+wRl9+2A+h+tEmAGvm2qhT4MgiIdMp+m+FLQP6gi5eLOWz9IEqZmWGlRYRuJZ1xjvwY5OvFCXkkwY= 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=sCapkKIo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JglCIafv; 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="sCapkKIo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JglCIafv" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423347; 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=1o80+pTTZok9t083p85VuG7odpUuHMCDXyiNCCOOgcQ=; b=sCapkKIoouYdkRP7+9ZuTz2+na3lZc6flKNFXoHWi20wk1AMBFYMNb+ByBtP3G+QoXt9Xr la/djSdZjttD9BQ9vfrqBQRTZV3+qlTMKgw2Fua/t5HAK393VGvESGIL4oKMC73PT4zfRk 63GITbQ0ejzbksNK09fQmXSvG8odapaQ9iDof7VnYHJo0W+L7yT0maXl5HfQ6A0ztgWArl zKbx1TUf23cTpxT7xseMVPEO6Hv10+ZsV77Rhw4iDb7NyNN52TLLCXF2eDj60FgLjXRng8 t+biPNeryT6zzPSq9zmm7m9l+aBE4MERb/XE0I1X5O4E16F1W/iFNXVjBrZeOw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423347; 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=1o80+pTTZok9t083p85VuG7odpUuHMCDXyiNCCOOgcQ=; b=JglCIafv0KCjy21QSmmkOyD4a53cdE4hoFoxlRR2yYhzJsdi4eJHovVs4jjp4OivLX06qE tGvA5Kikye1HjBCw== Date: Thu, 06 Nov 2025 11:02:20 +0100 Subject: [PATCH v5 27/34] sparc64: vdso: Move hardware counter read into header 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: <20251106-vdso-sparc64-generic-2-v5-27-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=5859; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=T690CgHOC0+pGW9MJ3oWsROYo+v+vkE9Ah57C6iq4Fo=; b=6P3U+kHM0Yq1NrlRtnvnMF9b65o8BVW/UIbecHp87PtehJgSculNMNRCIZqsZsb2qr1DnwuLQ VhSJ5wDmEXnCDUHbeQpSyIDt4d/CM3N0sm1FMhhzzqEJWUCKucdF7BF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic vDSO libraries expected the architecture glue around hardware counter reading in asm/vdso/gettimeofday.h. To prepare the adoption of the generic library, move the existing functions there. While at it, perform some trivial alignment with the generic vDSO library: * Drop 'notrace', as the functions are __always_inline anyways * Use the same parameter types * Use the same function names Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/include/asm/vdso/gettimeofday.h | 78 ++++++++++++++++++++++++++= ++++ arch/sparc/vdso/vclock_gettime.c | 70 ++------------------------- 2 files changed, 82 insertions(+), 66 deletions(-) diff --git a/arch/sparc/include/asm/vdso/gettimeofday.h b/arch/sparc/includ= e/asm/vdso/gettimeofday.h new file mode 100644 index 0000000000000000000000000000000000000000..31f6505d3ab5dde9e02eca6da91= 82e5fb91031c4 --- /dev/null +++ b/arch/sparc/include/asm/vdso/gettimeofday.h @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2006 Andi Kleen, SUSE Labs. + */ + +#ifndef _ASM_SPARC_VDSO_GETTIMEOFDAY_H +#define _ASM_SPARC_VDSO_GETTIMEOFDAY_H + +#include +#include + +#ifdef CONFIG_SPARC64 +static __always_inline u64 vdso_shift_ns(u64 val, u32 amt) +{ + return val >> amt; +} + +static __always_inline u64 vread_tick(void) +{ + u64 ret; + + __asm__ __volatile__("rd %%tick, %0" : "=3Dr" (ret)); + return ret; +} + +static __always_inline u64 vread_tick_stick(void) +{ + u64 ret; + + __asm__ __volatile__("rd %%asr24, %0" : "=3Dr" (ret)); + return ret; +} +#else +static __always_inline u64 vdso_shift_ns(u64 val, u32 amt) +{ + u64 ret; + + __asm__ __volatile__("sllx %H1, 32, %%g1\n\t" + "srl %L1, 0, %L1\n\t" + "or %%g1, %L1, %%g1\n\t" + "srlx %%g1, %2, %L0\n\t" + "srlx %L0, 32, %H0" + : "=3Dr" (ret) + : "r" (val), "r" (amt) + : "g1"); + return ret; +} + +static __always_inline u64 vread_tick(void) +{ + register unsigned long long ret asm("o4"); + + __asm__ __volatile__("rd %%tick, %L0\n\t" + "srlx %L0, 32, %H0" + : "=3Dr" (ret)); + return ret; +} + +static __always_inline u64 vread_tick_stick(void) +{ + register unsigned long long ret asm("o4"); + + __asm__ __volatile__("rd %%asr24, %L0\n\t" + "srlx %L0, 32, %H0" + : "=3Dr" (ret)); + return ret; +} +#endif + +static __always_inline u64 __arch_get_hw_counter(struct vvar_data *vvar) +{ + if (likely(vvar->vclock_mode =3D=3D VCLOCK_STICK)) + return vread_tick_stick(); + else + return vread_tick(); +} + +#endif /* _ASM_SPARC_VDSO_GETTIMEOFDAY_H */ diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gett= ime.c index 643608bffe13d904c5f77edd585b2e58277491fb..16ac80982a00b9f965453b89a0c= c111312baa9b2 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -19,6 +19,7 @@ #include #include #include +#include #include =20 #ifdef CONFIG_SPARC64 @@ -85,73 +86,10 @@ notrace static long vdso_fallback_gettimeofday(struct _= _kernel_old_timeval *tv, return o0; } =20 -#ifdef CONFIG_SPARC64 -notrace static __always_inline u64 __shr64(u64 val, int amt) -{ - return val >> amt; -} - -notrace static __always_inline u64 vread_tick(void) -{ - u64 ret; - - __asm__ __volatile__("rd %%tick, %0" : "=3Dr" (ret)); - return ret; -} - -notrace static __always_inline u64 vread_tick_stick(void) -{ - u64 ret; - - __asm__ __volatile__("rd %%asr24, %0" : "=3Dr" (ret)); - return ret; -} -#else -notrace static __always_inline u64 __shr64(u64 val, int amt) -{ - u64 ret; - - __asm__ __volatile__("sllx %H1, 32, %%g1\n\t" - "srl %L1, 0, %L1\n\t" - "or %%g1, %L1, %%g1\n\t" - "srlx %%g1, %2, %L0\n\t" - "srlx %L0, 32, %H0" - : "=3Dr" (ret) - : "r" (val), "r" (amt) - : "g1"); - return ret; -} - -notrace static __always_inline u64 vread_tick(void) -{ - register unsigned long long ret asm("o4"); - - __asm__ __volatile__("rd %%tick, %L0\n\t" - "srlx %L0, 32, %H0" - : "=3Dr" (ret)); - return ret; -} - -notrace static __always_inline u64 vread_tick_stick(void) -{ - register unsigned long long ret asm("o4"); - - __asm__ __volatile__("rd %%asr24, %L0\n\t" - "srlx %L0, 32, %H0" - : "=3Dr" (ret)); - return ret; -} -#endif - notrace static __always_inline u64 vgetsns(struct vvar_data *vvar) { u64 v; - u64 cycles; - - if (likely(vvar->vclock_mode =3D=3D VCLOCK_STICK)) - cycles =3D vread_tick_stick(); - else - cycles =3D vread_tick(); + u64 cycles =3D __arch_get_hw_counter(vvar); =20 v =3D (cycles - vvar->clock.cycle_last) & vvar->clock.mask; return v * vvar->clock.mult; @@ -168,7 +106,7 @@ notrace static __always_inline int do_realtime(struct v= var_data *vvar, ts->tv_sec =3D vvar->wall_time_sec; ns =3D vvar->wall_time_snsec; ns +=3D vgetsns(vvar); - ns =3D __shr64(ns, vvar->clock.shift); + ns =3D vdso_shift_ns(ns, vvar->clock.shift); } while (unlikely(vvar_read_retry(vvar, seq))); =20 ts->tv_sec +=3D __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); @@ -188,7 +126,7 @@ notrace static __always_inline int do_monotonic(struct = vvar_data *vvar, ts->tv_sec =3D vvar->monotonic_time_sec; ns =3D vvar->monotonic_time_snsec; ns +=3D vgetsns(vvar); - ns =3D __shr64(ns, vvar->clock.shift); + ns =3D vdso_shift_ns(ns, vvar->clock.shift); } while (unlikely(vvar_read_retry(vvar, seq))); =20 ts->tv_sec +=3D __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 47A8331B839; Thu, 6 Nov 2025 10:02:33 +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=1762423355; cv=none; b=Ysrv1ksJRjDOssz/2Y8UlDlXw7gHpujztnFJuqG8Z8UTN6BkZpTIUBhMnJBhqcTNgtozFQqiLBUFTrxUMbBxeMHqPV4lg708AVPnger+2it418rphA5B97eOIpvBhnF9bqZsvZ9jQxR+9AmgGrsn5JfHFP7lyxI4ijjl4fAAceg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423355; c=relaxed/simple; bh=54fVsevF6wJL94FjT3o2LBMAQrSAU/5OtqL2hTA5L+g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uwKSbLJxc4tbV02XhtPBKSF3+yyl2+N1N833FXCwPW9oKKOq0feNwNmsOpNqqZfxG9EwnZb5hoH0e9KD3h9z9vyCxjkDTpyf0Mn4/X6HjDpNjyyxx/Si9Rvek5yNnC0TrE29Kf1GmNXqJ/JdgyyBP4fZcoGr3Tij5wH1HiZJkZ8= 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=ewORpPSI; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Ehu4Nnp2; 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="ewORpPSI"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ehu4Nnp2" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423348; 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=OR5Q4ZuRkIA741qF/DuLi5z3bNd2XCtlxY+P3oghy5c=; b=ewORpPSINxIarWqzqFOPKYxCR5amHys/rNImmWUbHAfd1+8IDKDOripwkY28a87y5Xs328 NjocchTp9rSgtLXsCNZHZufHLHc+cIc5ws2zTCj1P2xwI2iferEnfCeg1sntZjX1N/xPti 6PkdKshrMEXlAi4/QJvrK1E/wFKYrf6F2l14ozqLalJFBOnhpnU7KFiBohyeT9mi04z8at Toy1Grq8wT93zeAKhI/19J334TPF5WWXSMbwCga+fDt9swwN+CnZs3/7P1LzzexThZaxi2 Cx5PkQUSiCkeklJ9/6ZV6tLzHogY7rY3KsBzGnTMhlL49EY231g8ohVvr4dRrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423348; 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=OR5Q4ZuRkIA741qF/DuLi5z3bNd2XCtlxY+P3oghy5c=; b=Ehu4Nnp2Jx/jJ89XmjS0TU0ZyMLmT/lUH5Zx/GFj9Q675+Ldwma6OKZWEBP+c/4wrxokqL SSllEL7irDXyC2Bw== Date: Thu, 06 Nov 2025 11:02:21 +0100 Subject: [PATCH v5 28/34] sparc64: vdso: Move syscall fallbacks into header 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: <20251106-vdso-sparc64-generic-2-v5-28-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=5844; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=54fVsevF6wJL94FjT3o2LBMAQrSAU/5OtqL2hTA5L+g=; b=GE+z1lzIrwo6b9gotEsWAVqlfFV/4lWk7aBHYKZHquK3Dlqf241AfhwoKqK4g7J0bxE2Ol25i Y121f7OC6ohCFV3kG7ZDMAXTJEs9e9vt6q6U8tk2NEC9a8HdHgDN53J X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic vDSO libraries expected the syscall fallbacks in asm/vdso/gettimeofday.h. To prepare the adoption of the generic library, move the existing functions there. While at it, rename them so they match what the generic library expects. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/include/asm/vdso/gettimeofday.h | 50 ++++++++++++++++++++++++++= +++ arch/sparc/vdso/vclock_gettime.c | 51 ++------------------------= ---- 2 files changed, 52 insertions(+), 49 deletions(-) diff --git a/arch/sparc/include/asm/vdso/gettimeofday.h b/arch/sparc/includ= e/asm/vdso/gettimeofday.h index 31f6505d3ab5dde9e02eca6da9182e5fb91031c4..429dc080568f59145cc0bc69606= 0adeb60ac177a 100644 --- a/arch/sparc/include/asm/vdso/gettimeofday.h +++ b/arch/sparc/include/asm/vdso/gettimeofday.h @@ -6,6 +6,9 @@ #ifndef _ASM_SPARC_VDSO_GETTIMEOFDAY_H #define _ASM_SPARC_VDSO_GETTIMEOFDAY_H =20 +#include +#include + #include #include =20 @@ -75,4 +78,51 @@ static __always_inline u64 __arch_get_hw_counter(struct = vvar_data *vvar) return vread_tick(); } =20 +#ifdef CONFIG_SPARC64 +#define SYSCALL_STRING \ + "ta 0x6d;" \ + "bcs,a 1f;" \ + " sub %%g0, %%o0, %%o0;" \ + "1:" +#else +#define SYSCALL_STRING \ + "ta 0x10;" \ + "bcs,a 1f;" \ + " sub %%g0, %%o0, %%o0;" \ + "1:" +#endif + +#define SYSCALL_CLOBBERS \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ + "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ + "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ + "cc", "memory" + +static __always_inline +long clock_gettime_fallback(clockid_t clock, struct __kernel_old_timespec = *ts) +{ + register long num __asm__("g1") =3D __NR_clock_gettime; + register long o0 __asm__("o0") =3D clock; + register long o1 __asm__("o1") =3D (long) ts; + + __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), + "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); + return o0; +} + +static __always_inline +long gettimeofday_fallback(struct __kernel_old_timeval *tv, struct timezon= e *tz) +{ + register long num __asm__("g1") =3D __NR_gettimeofday; + register long o0 __asm__("o0") =3D (long) tv; + register long o1 __asm__("o1") =3D (long) tz; + + __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), + "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); + return o0; +} + #endif /* _ASM_SPARC_VDSO_GETTIMEOFDAY_H */ diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gett= ime.c index 16ac80982a00b9f965453b89a0cc111312baa9b2..e768c0b84b3420deab2f7433589= 2d40a5b515ee7 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -13,38 +13,13 @@ */ =20 #include -#include #include #include -#include #include #include #include #include =20 -#ifdef CONFIG_SPARC64 -#define SYSCALL_STRING \ - "ta 0x6d;" \ - "bcs,a 1f;" \ - " sub %%g0, %%o0, %%o0;" \ - "1:" -#else -#define SYSCALL_STRING \ - "ta 0x10;" \ - "bcs,a 1f;" \ - " sub %%g0, %%o0, %%o0;" \ - "1:" -#endif - -#define SYSCALL_CLOBBERS \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ - "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ - "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ - "cc", "memory" - /* * Compute the vvar page's address in the process address space, and retur= n it * as a pointer to the vvar_data. @@ -64,28 +39,6 @@ notrace static __always_inline struct vvar_data *get_vva= r_data(void) return (struct vvar_data *) ret; } =20 -notrace static long vdso_fallback_gettime(long clock, struct __kernel_old_= timespec *ts) -{ - register long num __asm__("g1") =3D __NR_clock_gettime; - register long o0 __asm__("o0") =3D clock; - register long o1 __asm__("o1") =3D (long) ts; - - __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), - "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); - return o0; -} - -notrace static long vdso_fallback_gettimeofday(struct __kernel_old_timeval= *tv, struct timezone *tz) -{ - register long num __asm__("g1") =3D __NR_gettimeofday; - register long o0 __asm__("o0") =3D (long) tv; - register long o1 __asm__("o1") =3D (long) tz; - - __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), - "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); - return o0; -} - notrace static __always_inline u64 vgetsns(struct vvar_data *vvar) { u64 v; @@ -184,7 +137,7 @@ __vdso_clock_gettime(clockid_t clock, struct __kernel_o= ld_timespec *ts) /* * Unknown clock ID ? Fall back to the syscall. */ - return vdso_fallback_gettime(clock, ts); + return clock_gettime_fallback(clock, ts); } int clock_gettime(clockid_t, struct __kernel_old_timespec *) @@ -220,7 +173,7 @@ __vdso_gettimeofday(struct __kernel_old_timeval *tv, st= ruct timezone *tz) } return 0; } - return vdso_fallback_gettimeofday(tv, tz); + return gettimeofday_fallback(tv, tz); } int gettimeofday(struct __kernel_old_timeval *, struct timezone *) --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 D9B1A320383; Thu, 6 Nov 2025 10:02:34 +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=1762423356; cv=none; b=sTJNncSM3CKSgkIDSoqIHLZUUrlguW7YeTKWEhKya++ZogzWBMsYKlGui1STnNqkACOpza7LlHzCegBHlm2ovm1Y+2A5RK6tF/JZgSjZ7K+iyJwzni06uOu6QrP4jnAfIviSSgMPHo8ckZhf9kHpOesB0qwBXHmp7dlbGnSg0CQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423356; c=relaxed/simple; bh=69d1+4gsu5NkCOVxynY9ZDBF0HEBmIzlBhmM7Uhwm2U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VoIxqZqh1ObHBJOl+NeQ3a3oP5Fpc0dZW2wT2vH5jTNoYUbuVZfmPDQoXggfpvWtlkfUmQcKxjoT91ZFn/DiaS8YboszY5kYR9U5sqcb1UvEdkINqZzdvc0XvsEhNrxzq6GDnht/HVEOa11rGxCqfyofbYUG+/gBeQMq+/fXslg= 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=nhDhWl1H; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/8WZVdWR; 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="nhDhWl1H"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/8WZVdWR" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423348; 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=9h2pb1V7ipgZNlCnvpCW+AmTuEcf1Qtqf7GVE2UhA9Q=; b=nhDhWl1Hy+J2FwGreKqIM2FzECo3XwwLQAVOEdBM8gOEmVBz6tVyWrLY3o/dz5Gos+0WOZ j1SftwxNaTa2kzwU3VvXnailN0IRw8GrKTk6foKmOZCz8Gg4ams3xV4MFMZVAlcSVboBQo dfpmPHc2abnAqFP+Y2BL9IzwADsJwaEr6Q4Q+sRcnI6aO57jQA70VB40VSLf9RTEQTm+O0 4MA55cdosrqslDUzZCPHKxW0WzFFCo/VjeXEG9IoR7LcZ79a+Zair6Il4kGRRkbZCYFTvW 6AQ6W06Re/O4cq0tY9f6UtDA36tTd/yOlUzVyXV67g1F/TDhfudhypKIGEAOmg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423348; 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=9h2pb1V7ipgZNlCnvpCW+AmTuEcf1Qtqf7GVE2UhA9Q=; b=/8WZVdWRyJfnxDSbRyoKS3gb7RfZQo5yJT7eJkBmW9T61AYhhF6QjLdxdchIOBVba1WWEd L/sBkUoV+/hYGnAQ== Date: Thu, 06 Nov 2025 11:02:22 +0100 Subject: [PATCH v5 29/34] sparc64: vdso: Introduce vdso/processor.h 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: <20251106-vdso-sparc64-generic-2-v5-29-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=4770; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=69d1+4gsu5NkCOVxynY9ZDBF0HEBmIzlBhmM7Uhwm2U=; b=6gdIewuHG3XJugRIyyATke5iOs62aXKBZC0E52Y4jFJZCjp0gJ9wSyDPutjxobM27bAeGHUXL 6GrxL80fo83AlXuKijShN+0hAXiZ7mHbI5IUO+U3ojKKSsScdljy5k5 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic vDSO library expects a vdso/processor.h with an definition of cpu_relax(). Split out cpu_relax() into this dedicated header. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/include/asm/processor.h | 3 +++ arch/sparc/include/asm/processor_32.h | 2 -- arch/sparc/include/asm/processor_64.h | 25 -------------------- arch/sparc/include/asm/vdso/processor.h | 41 +++++++++++++++++++++++++++++= ++++ 4 files changed, 44 insertions(+), 27 deletions(-) diff --git a/arch/sparc/include/asm/processor.h b/arch/sparc/include/asm/pr= ocessor.h index 18295ea625dd7271617c15caa003a173099dd4d0..e34de956519aaca0e9bf82a2200= 0d9096f868968 100644 --- a/arch/sparc/include/asm/processor.h +++ b/arch/sparc/include/asm/processor.h @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ #ifndef ___ASM_SPARC_PROCESSOR_H #define ___ASM_SPARC_PROCESSOR_H + +#include + #if defined(__sparc__) && defined(__arch64__) #include #else diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm= /processor_32.h index ba8b70ffec085feb17de9050f37de98e0039f7c3..a074d313f4f80621c1bc4273352= 9c6d9450b1275 100644 --- a/arch/sparc/include/asm/processor_32.h +++ b/arch/sparc/include/asm/processor_32.h @@ -91,8 +91,6 @@ unsigned long __get_wchan(struct task_struct *); extern struct task_struct *last_task_used_math; int do_mathemu(struct pt_regs *regs, struct task_struct *fpt); =20 -#define cpu_relax() barrier() - extern void (*sparc_idle)(void); =20 #endif diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm= /processor_64.h index 321859454ca4c55817bfcd0c627dae4f51d12041..4850704952634133aad143327bc= baa618fe66fde 100644 --- a/arch/sparc/include/asm/processor_64.h +++ b/arch/sparc/include/asm/processor_64.h @@ -182,31 +182,6 @@ unsigned long __get_wchan(struct task_struct *task); #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP]) =20 -/* Please see the commentary in asm/backoff.h for a description of - * what these instructions are doing and how they have been chosen. - * To make a long story short, we are trying to yield the current cpu - * strand during busy loops. - */ -#ifdef BUILD_VDSO -#define cpu_relax() asm volatile("\n99:\n\t" \ - "rd %%ccr, %%g0\n\t" \ - "rd %%ccr, %%g0\n\t" \ - "rd %%ccr, %%g0\n\t" \ - ::: "memory") -#else /* ! BUILD_VDSO */ -#define cpu_relax() asm volatile("\n99:\n\t" \ - "rd %%ccr, %%g0\n\t" \ - "rd %%ccr, %%g0\n\t" \ - "rd %%ccr, %%g0\n\t" \ - ".section .pause_3insn_patch,\"ax\"\n\t"\ - ".word 99b\n\t" \ - "wr %%g0, 128, %%asr27\n\t" \ - "nop\n\t" \ - "nop\n\t" \ - ".previous" \ - ::: "memory") -#endif - /* Prefetch support. This is tuned for UltraSPARC-III and later. * UltraSPARC-I will treat these as nops, and UltraSPARC-II has * a shallower prefetch queue than later chips. diff --git a/arch/sparc/include/asm/vdso/processor.h b/arch/sparc/include/a= sm/vdso/processor.h new file mode 100644 index 0000000000000000000000000000000000000000..f7a9adc807f7c9a0444afa51aeb= 47649a9bdb079 --- /dev/null +++ b/arch/sparc/include/asm/vdso/processor.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _ASM_SPARC_VDSO_PROCESSOR_H +#define _ASM_SPARC_VDSO_PROCESSOR_H + +#include + +#if defined(__arch64__) + +/* Please see the commentary in asm/backoff.h for a description of + * what these instructions are doing and how they have been chosen. + * To make a long story short, we are trying to yield the current cpu + * strand during busy loops. + */ +#ifdef BUILD_VDSO +#define cpu_relax() asm volatile("\n99:\n\t" \ + "rd %%ccr, %%g0\n\t" \ + "rd %%ccr, %%g0\n\t" \ + "rd %%ccr, %%g0\n\t" \ + ::: "memory") +#else /* ! BUILD_VDSO */ +#define cpu_relax() asm volatile("\n99:\n\t" \ + "rd %%ccr, %%g0\n\t" \ + "rd %%ccr, %%g0\n\t" \ + "rd %%ccr, %%g0\n\t" \ + ".section .pause_3insn_patch,\"ax\"\n\t"\ + ".word 99b\n\t" \ + "wr %%g0, 128, %%asr27\n\t" \ + "nop\n\t" \ + "nop\n\t" \ + ".previous" \ + ::: "memory") +#endif /* BUILD_VDSO */ + +#else /* ! __arch64__ */ + +#define cpu_relax() barrier() + +#endif /* __arch64__ */ + +#endif /* _ASM_SPARC_VDSO_PROCESSOR_H */ --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 6527A320A0C; Thu, 6 Nov 2025 10:02:35 +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=1762423358; cv=none; b=X2tZz8hV0bhQYYK/NZ+wEtRetTxygthGawAOfJiov7pT+ZMUGXtRJXE2Ie78nkg7Z/WnR6VuVF7dlZfAmc4ZF1DkSA/IbCAu3ywF5UXLiNNUbGDb8pEhrgV1c1K7PXWCwVNe5R+CweI1zi8f8egoZGspO/QbUbVavo9q6tqgBe8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423358; c=relaxed/simple; bh=JGEdDNQqI96lDS16VanvUj5KipZ/qsAjsCRSdQmV+1I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dPClcFMrt3MPTuLLuDyaCTrDi1ggN2ruUcokyn7D9410SrsbFraKvHQBUscPnWjWUVeXBIn8+b/khN+uutdrXRsAJABJqq/5yetJycp0F1l49Mzrh9mJrNc5Fyc/ncRcibm1wAjssQm5eEJO8EqDjpU2DgcOn12FxN34iXIC28M= 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=YVfxbhAB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JIko1HoD; 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="YVfxbhAB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JIko1HoD" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423349; 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=AOfmdTRGSdQNFoZmWDuk2vT3PGkkDHv6vLd11s49CqI=; b=YVfxbhABMMe5Eoi8h8PJQ1SvlG8E6j9eEdquqsU/gVz/XaRO/KreBjCuK8Jpy+WLoNLF3N W262JhhC18oM4KVDvrho4PCCMocwBINB+KjwBfiSoZkJ+IXPbeEtK5FRxNTCTV8kqrNM1+ ZG9xG9iguR0/v+YwqC+4YIoLOegc6jD0O0IY0qwII3xJebn5OH8kMjT5tLYPN5DA49247z wvFPFWwXQscRrfKmamm8ANozccvZgZaTIX1mE79v8vkJHf7xTS/MFkShJ+/y08oqxjYiWq IvSZbcV6GsiyoEROxoTspZ2FK4kzdUtISptjx2h3fPlNuERvRSpUZ6EjMnY5vA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423349; 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=AOfmdTRGSdQNFoZmWDuk2vT3PGkkDHv6vLd11s49CqI=; b=JIko1HoD1Ug/YvLja133vAbDjhXuSuFsr8gqmqLaV8VeNlbmzav46ZVv4azeqY49JhFacZ qNKyjC9mxmOjK0DQ== Date: Thu, 06 Nov 2025 11:02:23 +0100 Subject: [PATCH v5 30/34] sparc64: vdso: Switch to the generic vDSO library 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: <20251106-vdso-sparc64-generic-2-v5-30-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=24732; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=JGEdDNQqI96lDS16VanvUj5KipZ/qsAjsCRSdQmV+1I=; b=btLuMT1h1F0PpovVibLG2ujhezruCESQwRKxt/0laoS0L+ZEiarI/eY3c1/LcUw/vUPwZX884 fTOeaOUXzkWAHF5BtIhG56ewusJ8dyUxAxiW5QFLF01GJeNYg/aJQ4m X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The generic vDSO provides a lot common functionality shared between different architectures. SPARC is the last architecture not using it, preventing some necessary code cleanup. Make use of the generic infrastructure. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/Kconfig | 3 +- arch/sparc/include/asm/clocksource.h | 9 -- arch/sparc/include/asm/vdso/clocksource.h | 10 ++ arch/sparc/include/asm/vdso/gettimeofday.h | 58 ++++++++-- arch/sparc/include/asm/vdso/vsyscall.h | 10 ++ arch/sparc/include/asm/vvar.h | 75 ------------- arch/sparc/kernel/Makefile | 1 - arch/sparc/kernel/time_64.c | 6 +- arch/sparc/kernel/vdso.c | 69 ------------ arch/sparc/vdso/Makefile | 6 +- arch/sparc/vdso/vclock_gettime.c | 169 ++++---------------------= ---- arch/sparc/vdso/vdso-layout.lds.S | 7 +- arch/sparc/vdso/vma.c | 70 +++--------- 13 files changed, 118 insertions(+), 375 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index a630d373e6453c745ab8bf58fc5622cf0edaf4c9..404b4c790eac0859e2d64963f90= fbc62dbbab3e3 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -102,7 +102,6 @@ config SPARC64 select ARCH_USE_QUEUED_RWLOCKS select ARCH_USE_QUEUED_SPINLOCKS select GENERIC_TIME_VSYSCALL - select ARCH_CLOCKSOURCE_DATA select ARCH_HAS_PTE_SPECIAL select PCI_DOMAINS if PCI select ARCH_HAS_GIGANTIC_PAGE @@ -112,6 +111,8 @@ config SPARC64 select NEED_PER_CPU_PAGE_FIRST_CHUNK select ARCH_SUPPORTS_SCHED_SMT if SMP select ARCH_SUPPORTS_SCHED_MC if SMP + select HAVE_GENERIC_VDSO + select GENERIC_GETTIMEOFDAY =20 config ARCH_PROC_KCORE_TEXT def_bool y diff --git a/arch/sparc/include/asm/clocksource.h b/arch/sparc/include/asm/= clocksource.h index d63ef224befebd68637d0be5d19c5cbf657d590d..68303ad26eb26e99180bb71789f= 1d6fafe4a2225 100644 --- a/arch/sparc/include/asm/clocksource.h +++ b/arch/sparc/include/asm/clocksource.h @@ -5,13 +5,4 @@ #ifndef _ASM_SPARC_CLOCKSOURCE_H #define _ASM_SPARC_CLOCKSOURCE_H =20 -/* VDSO clocksources */ -#define VCLOCK_NONE 0 /* Nothing userspace can do. */ -#define VCLOCK_TICK 1 /* Use %tick. */ -#define VCLOCK_STICK 2 /* Use %stick. */ - -struct arch_clocksource_data { - int vclock_mode; -}; - #endif /* _ASM_SPARC_CLOCKSOURCE_H */ diff --git a/arch/sparc/include/asm/vdso/clocksource.h b/arch/sparc/include= /asm/vdso/clocksource.h new file mode 100644 index 0000000000000000000000000000000000000000..007aa8ceaf522ebc11b05dd46df= cdf72a328822f --- /dev/null +++ b/arch/sparc/include/asm/vdso/clocksource.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_VDSO_CLOCKSOURCE_H +#define __ASM_VDSO_CLOCKSOURCE_H + +/* VDSO clocksources */ +#define VDSO_ARCH_CLOCKMODES \ + VDSO_CLOCKMODE_TICK, \ + VDSO_CLOCKMODE_STICK + +#endif /* __ASM_VDSO_CLOCKSOURCE_H */ diff --git a/arch/sparc/include/asm/vdso/gettimeofday.h b/arch/sparc/includ= e/asm/vdso/gettimeofday.h index 429dc080568f59145cc0bc696060adeb60ac177a..a35875fba45470ba961a7df3ae5= 2bc17d2a4a4a0 100644 --- a/arch/sparc/include/asm/vdso/gettimeofday.h +++ b/arch/sparc/include/asm/vdso/gettimeofday.h @@ -9,15 +9,14 @@ #include #include =20 +#include +#include +#include +#include + #include -#include =20 #ifdef CONFIG_SPARC64 -static __always_inline u64 vdso_shift_ns(u64 val, u32 amt) -{ - return val >> amt; -} - static __always_inline u64 vread_tick(void) { u64 ret; @@ -48,6 +47,7 @@ static __always_inline u64 vdso_shift_ns(u64 val, u32 amt) : "g1"); return ret; } +#define vdso_shift_ns vdso_shift_ns =20 static __always_inline u64 vread_tick(void) { @@ -70,9 +70,9 @@ static __always_inline u64 vread_tick_stick(void) } #endif =20 -static __always_inline u64 __arch_get_hw_counter(struct vvar_data *vvar) +static __always_inline u64 __arch_get_hw_counter(s32 clock_mode, const str= uct vdso_time_data *vd) { - if (likely(vvar->vclock_mode =3D=3D VCLOCK_STICK)) + if (likely(clock_mode =3D=3D VDSO_CLOCKMODE_STICK)) return vread_tick_stick(); else return vread_tick(); @@ -102,7 +102,20 @@ static __always_inline u64 __arch_get_hw_counter(struc= t vvar_data *vvar) "cc", "memory" =20 static __always_inline -long clock_gettime_fallback(clockid_t clock, struct __kernel_old_timespec = *ts) +long clock_gettime_fallback(clockid_t clock, struct __kernel_timespec *ts) +{ + register long num __asm__("g1") =3D __NR_clock_gettime; + register long o0 __asm__("o0") =3D clock; + register long o1 __asm__("o1") =3D (long) ts; + + __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), + "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); + return o0; +} + +#ifndef CONFIG_SPARC64 +static __always_inline +long clock_gettime32_fallback(clockid_t clock, struct old_timespec32 *ts) { register long num __asm__("g1") =3D __NR_clock_gettime; register long o0 __asm__("o0") =3D clock; @@ -112,6 +125,7 @@ long clock_gettime_fallback(clockid_t clock, struct __k= ernel_old_timespec *ts) "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); return o0; } +#endif =20 static __always_inline long gettimeofday_fallback(struct __kernel_old_timeval *tv, struct timezon= e *tz) @@ -125,4 +139,30 @@ long gettimeofday_fallback(struct __kernel_old_timeval= *tv, struct timezone *tz) return o0; } =20 +static __always_inline const struct vdso_time_data *__arch_get_vdso_u_time= _data(void) +{ + unsigned long ret; + + /* + * SPARC does not support native PC-relative code relocations. + * Calculate the address manually, works for 32 and 64 bit code. + */ + __asm__ __volatile__( + "1:\n" + "call 3f\n" // Jump over the embedded data and set u= p %o7 + "nop\n" // Delay slot + "2:\n" + ".word vdso_u_time_data - .\n" // Embedded offset to external symbol + "3:\n" + "add %%o7, 2b - 1b, %%o7\n" // Point %o7 to the embedded offset + "ldsw [%%o7], %0\n" // Load the offset + "add %0, %%o7, %0\n" // Calculate the absolute address + : "=3Dr" (ret) + : + : "o7"); + + return (const struct vdso_time_data *)ret; +} +#define __arch_get_vdso_u_time_data __arch_get_vdso_u_time_data + #endif /* _ASM_SPARC_VDSO_GETTIMEOFDAY_H */ diff --git a/arch/sparc/include/asm/vdso/vsyscall.h b/arch/sparc/include/as= m/vdso/vsyscall.h new file mode 100644 index 0000000000000000000000000000000000000000..8bfe703fedc56f9334773b26b5e= 1ecec42781378 --- /dev/null +++ b/arch/sparc/include/asm/vdso/vsyscall.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _ASM_SPARC_VDSO_VSYSCALL_H +#define _ASM_SPARC_VDSO_VSYSCALL_H + +#define __VDSO_PAGES 4 + +#include + +#endif /* _ASM_SPARC_VDSO_VSYSCALL_H */ diff --git a/arch/sparc/include/asm/vvar.h b/arch/sparc/include/asm/vvar.h deleted file mode 100644 index 6eaf5cfcaae1319808e63884d624899895d9b6a5..000000000000000000000000000= 0000000000000 --- a/arch/sparc/include/asm/vvar.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. - */ - -#ifndef _ASM_SPARC_VVAR_DATA_H -#define _ASM_SPARC_VVAR_DATA_H - -#include -#include -#include -#include -#include - -struct vvar_data { - unsigned int seq; - - int vclock_mode; - struct { /* extract of a clocksource struct */ - u64 cycle_last; - u64 mask; - int mult; - int shift; - } clock; - /* open coded 'struct timespec' */ - u64 wall_time_sec; - u64 wall_time_snsec; - u64 monotonic_time_snsec; - u64 monotonic_time_sec; - u64 monotonic_time_coarse_sec; - u64 monotonic_time_coarse_nsec; - u64 wall_time_coarse_sec; - u64 wall_time_coarse_nsec; - - int tz_minuteswest; - int tz_dsttime; -}; - -extern struct vvar_data *vvar_data; -extern int vdso_fix_stick; - -static inline unsigned int vvar_read_begin(const struct vvar_data *s) -{ - unsigned int ret; - -repeat: - ret =3D READ_ONCE(s->seq); - if (unlikely(ret & 1)) { - cpu_relax(); - goto repeat; - } - smp_rmb(); /* Finish all reads before we return seq */ - return ret; -} - -static inline int vvar_read_retry(const struct vvar_data *s, - unsigned int start) -{ - smp_rmb(); /* Finish all reads before checking the value of seq */ - return unlikely(s->seq !=3D start); -} - -static inline void vvar_write_begin(struct vvar_data *s) -{ - ++s->seq; - smp_wmb(); /* Makes sure that increment of seq is reflected */ -} - -static inline void vvar_write_end(struct vvar_data *s) -{ - smp_wmb(); /* Makes the value of seq current before we increment */ - ++s->seq; -} - - -#endif /* _ASM_SPARC_VVAR_DATA_H */ diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index 22170d4f8e06023eb9de917e91e94254afd9a6ae..497b5714fa8ff52c4c048f88c16= 7cdc39ec35b51 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -41,7 +41,6 @@ obj-$(CONFIG_SPARC32) +=3D systbls_32.o obj-y +=3D time_$(BITS).o obj-$(CONFIG_SPARC32) +=3D windows.o obj-y +=3D cpu.o -obj-$(CONFIG_SPARC64) +=3D vdso.o obj-$(CONFIG_SPARC32) +=3D devices.o obj-y +=3D ptrace_$(BITS).o obj-y +=3D unaligned_$(BITS).o diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index b32f27f929d1ab49a5aa05cde60d3b88e90928ba..87b267043ccd21b9397e316b017= f0ae3ab8585c6 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c @@ -838,14 +838,14 @@ void __init time_init_early(void) if (tlb_type =3D=3D spitfire) { if (is_hummingbird()) { init_tick_ops(&hbtick_operations); - clocksource_tick.archdata.vclock_mode =3D VCLOCK_NONE; + clocksource_tick.vdso_clock_mode =3D VDSO_CLOCKMODE_NONE; } else { init_tick_ops(&tick_operations); - clocksource_tick.archdata.vclock_mode =3D VCLOCK_TICK; + clocksource_tick.vdso_clock_mode =3D VDSO_CLOCKMODE_TICK; } } else { init_tick_ops(&stick_operations); - clocksource_tick.archdata.vclock_mode =3D VCLOCK_STICK; + clocksource_tick.vdso_clock_mode =3D VDSO_CLOCKMODE_STICK; } } =20 diff --git a/arch/sparc/kernel/vdso.c b/arch/sparc/kernel/vdso.c deleted file mode 100644 index 0e27437eb97bff16aba53b1634c7e9fa7db20b46..000000000000000000000000000= 0000000000000 --- a/arch/sparc/kernel/vdso.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2001 Andrea Arcangeli SuSE - * Copyright 2003 Andi Kleen, SuSE Labs. - * - * Thanks to hpa@transmeta.com for some useful hint. - * Special thanks to Ingo Molnar for his early experience with - * a different vsyscall implementation for Linux/IA32 and for the name. - */ - -#include -#include - -#include - -void update_vsyscall_tz(void) -{ - if (unlikely(vvar_data =3D=3D NULL)) - return; - - vvar_data->tz_minuteswest =3D sys_tz.tz_minuteswest; - vvar_data->tz_dsttime =3D sys_tz.tz_dsttime; -} - -void update_vsyscall(struct timekeeper *tk) -{ - struct vvar_data *vdata =3D vvar_data; - - if (unlikely(vdata =3D=3D NULL)) - return; - - vvar_write_begin(vdata); - vdata->vclock_mode =3D tk->tkr_mono.clock->archdata.vclock_mode; - vdata->clock.cycle_last =3D tk->tkr_mono.cycle_last; - vdata->clock.mask =3D tk->tkr_mono.mask; - vdata->clock.mult =3D tk->tkr_mono.mult; - vdata->clock.shift =3D tk->tkr_mono.shift; - - vdata->wall_time_sec =3D tk->xtime_sec; - vdata->wall_time_snsec =3D tk->tkr_mono.xtime_nsec; - - vdata->monotonic_time_sec =3D tk->xtime_sec + - tk->wall_to_monotonic.tv_sec; - vdata->monotonic_time_snsec =3D tk->tkr_mono.xtime_nsec + - (tk->wall_to_monotonic.tv_nsec << - tk->tkr_mono.shift); - - while (vdata->monotonic_time_snsec >=3D - (((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) { - vdata->monotonic_time_snsec -=3D - ((u64)NSEC_PER_SEC) << tk->tkr_mono.shift; - vdata->monotonic_time_sec++; - } - - vdata->wall_time_coarse_sec =3D tk->xtime_sec; - vdata->wall_time_coarse_nsec =3D - (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift); - - vdata->monotonic_time_coarse_sec =3D - vdata->wall_time_coarse_sec + tk->wall_to_monotonic.tv_sec; - vdata->monotonic_time_coarse_nsec =3D - vdata->wall_time_coarse_nsec + tk->wall_to_monotonic.tv_nsec; - - while (vdata->monotonic_time_coarse_nsec >=3D NSEC_PER_SEC) { - vdata->monotonic_time_coarse_nsec -=3D NSEC_PER_SEC; - vdata->monotonic_time_coarse_sec++; - } - - vvar_write_end(vdata); -} diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile index 2e911ccc9db71b2888ffc432d75ac8815ecce0f7..1822676b4ebdc2dc55ea1a9fb83= be0e25ea2cfef 100644 --- a/arch/sparc/vdso/Makefile +++ b/arch/sparc/vdso/Makefile @@ -3,6 +3,9 @@ # Building vDSO images for sparc. # =20 +# Include the generic Makefile to check the built vDSO: +include $(srctree)/lib/vdso/Makefile.include + # files to link into the vdso vobjs-y :=3D vdso-note.o vclock_gettime.o =20 @@ -105,6 +108,7 @@ $(obj)/vdso32.so.dbg: FORCE \ quiet_cmd_vdso =3D VDSO $@ cmd_vdso =3D $(LD) -nostdlib -o $@ \ $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \ - -T $(filter %.lds,$^) $(filter %.o,$^) + -T $(filter %.lds,$^) $(filter %.o,$^); \ + $(cmd_vdso_check) =20 VDSO_LDFLAGS =3D -shared --hash-style=3Dboth --build-id=3Dsha1 -Bsymbolic = --no-undefined -z noexecstack diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gett= ime.c index e768c0b84b3420deab2f74335892d40a5b515ee7..093a7ff4dafce1cf0af5af4c303= bef86e159858a 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -12,169 +12,40 @@ * Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. */ =20 -#include -#include -#include -#include -#include -#include -#include +#include +#include =20 -/* - * Compute the vvar page's address in the process address space, and retur= n it - * as a pointer to the vvar_data. - */ -notrace static __always_inline struct vvar_data *get_vvar_data(void) -{ - unsigned long ret; +#include =20 - /* - * vdso data page is the first vDSO page so grab the PC - * and move up a page to get to the data page. - */ - __asm__("rd %%pc, %0" : "=3Dr" (ret)); - ret &=3D ~(8192 - 1); - ret -=3D 8192; +#include =20 - return (struct vvar_data *) ret; -} +#include "../../../../lib/vdso/gettimeofday.c" =20 -notrace static __always_inline u64 vgetsns(struct vvar_data *vvar) +int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *= tz) { - u64 v; - u64 cycles =3D __arch_get_hw_counter(vvar); - - v =3D (cycles - vvar->clock.cycle_last) & vvar->clock.mask; - return v * vvar->clock.mult; + return __cvdso_gettimeofday(tv, tz); } =20 -notrace static __always_inline int do_realtime(struct vvar_data *vvar, - struct __kernel_old_timespec *ts) -{ - unsigned long seq; - u64 ns; - - do { - seq =3D vvar_read_begin(vvar); - ts->tv_sec =3D vvar->wall_time_sec; - ns =3D vvar->wall_time_snsec; - ns +=3D vgetsns(vvar); - ns =3D vdso_shift_ns(ns, vvar->clock.shift); - } while (unlikely(vvar_read_retry(vvar, seq))); - - ts->tv_sec +=3D __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); - ts->tv_nsec =3D ns; +int gettimeofday(struct __kernel_old_timeval *, struct timezone *) + __weak __alias(__vdso_gettimeofday); =20 - return 0; -} - -notrace static __always_inline int do_monotonic(struct vvar_data *vvar, - struct __kernel_old_timespec *ts) +#if defined(CONFIG_SPARC64) +int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) { - unsigned long seq; - u64 ns; - - do { - seq =3D vvar_read_begin(vvar); - ts->tv_sec =3D vvar->monotonic_time_sec; - ns =3D vvar->monotonic_time_snsec; - ns +=3D vgetsns(vvar); - ns =3D vdso_shift_ns(ns, vvar->clock.shift); - } while (unlikely(vvar_read_retry(vvar, seq))); - - ts->tv_sec +=3D __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); - ts->tv_nsec =3D ns; - - return 0; -} - -notrace static int do_realtime_coarse(struct vvar_data *vvar, - struct __kernel_old_timespec *ts) -{ - unsigned long seq; - - do { - seq =3D vvar_read_begin(vvar); - ts->tv_sec =3D vvar->wall_time_coarse_sec; - ts->tv_nsec =3D vvar->wall_time_coarse_nsec; - } while (unlikely(vvar_read_retry(vvar, seq))); - return 0; + return __cvdso_clock_gettime(clock, ts); } =20 -notrace static int do_monotonic_coarse(struct vvar_data *vvar, - struct __kernel_old_timespec *ts) -{ - unsigned long seq; - - do { - seq =3D vvar_read_begin(vvar); - ts->tv_sec =3D vvar->monotonic_time_coarse_sec; - ts->tv_nsec =3D vvar->monotonic_time_coarse_nsec; - } while (unlikely(vvar_read_retry(vvar, seq))); +int clock_gettime(clockid_t, struct __kernel_timespec *) + __weak __alias(__vdso_clock_gettime); =20 - return 0; -} +#else =20 -notrace int -__vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts) +int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts) { - struct vvar_data *vvd =3D get_vvar_data(); - - switch (clock) { - case CLOCK_REALTIME: - if (unlikely(vvd->vclock_mode =3D=3D VCLOCK_NONE)) - break; - return do_realtime(vvd, ts); - case CLOCK_MONOTONIC: - if (unlikely(vvd->vclock_mode =3D=3D VCLOCK_NONE)) - break; - return do_monotonic(vvd, ts); - case CLOCK_REALTIME_COARSE: - return do_realtime_coarse(vvd, ts); - case CLOCK_MONOTONIC_COARSE: - return do_monotonic_coarse(vvd, ts); - } - /* - * Unknown clock ID ? Fall back to the syscall. - */ - return clock_gettime_fallback(clock, ts); + return __cvdso_clock_gettime32(clock, ts); } -int -clock_gettime(clockid_t, struct __kernel_old_timespec *) - __attribute__((weak, alias("__vdso_clock_gettime"))); =20 -notrace int -__vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) -{ - struct vvar_data *vvd =3D get_vvar_data(); +int clock_gettime(clockid_t, struct old_timespec32 *) + __weak __alias(__vdso_clock_gettime); =20 - if (likely(vvd->vclock_mode !=3D VCLOCK_NONE)) { - if (likely(tv !=3D NULL)) { - union tstv_t { - struct __kernel_old_timespec ts; - struct __kernel_old_timeval tv; - } *tstv =3D (union tstv_t *) tv; - do_realtime(vvd, &tstv->ts); - /* - * Assign before dividing to ensure that the division is - * done in the type of tv_usec, not tv_nsec. - * - * There cannot be > 1 billion usec in a second: - * do_realtime() has already distributed such overflow - * into tv_sec. So we can assign it to an int safely. - */ - tstv->tv.tv_usec =3D tstv->ts.tv_nsec; - tstv->tv.tv_usec /=3D 1000; - } - if (unlikely(tz !=3D NULL)) { - /* Avoid memcpy. Some old compilers fail to inline it */ - tz->tz_minuteswest =3D vvd->tz_minuteswest; - tz->tz_dsttime =3D vvd->tz_dsttime; - } - return 0; - } - return gettimeofday_fallback(tv, tz); -} -int -gettimeofday(struct __kernel_old_timeval *, struct timezone *) - __attribute__((weak, alias("__vdso_gettimeofday"))); +#endif diff --git a/arch/sparc/vdso/vdso-layout.lds.S b/arch/sparc/vdso/vdso-layou= t.lds.S index 9e0804789d11696948f11be367480b530a1f18d9..180e5d0ee07170a5dec88016a30= 4a44f87eb8d88 100644 --- a/arch/sparc/vdso/vdso-layout.lds.S +++ b/arch/sparc/vdso/vdso-layout.lds.S @@ -4,6 +4,10 @@ * This script controls its layout. */ =20 +#include +#include +#include + SECTIONS { /* @@ -13,8 +17,7 @@ SECTIONS * segment. Page size is 8192 for both 64-bit and 32-bit vdso binaries */ =20 - vvar_start =3D . -8192; - vvar_data =3D vvar_start; + VDSO_VVAR_SYMS =20 . =3D SIZEOF_HEADERS; =20 diff --git a/arch/sparc/vdso/vma.c b/arch/sparc/vdso/vma.c index 582d84e2e5ba8932f39948bb0ca2678fc8f06a10..38a664d697829b8203f0c7cd9e6= d7cc8bed4796f 100644 --- a/arch/sparc/vdso/vma.c +++ b/arch/sparc/vdso/vma.c @@ -16,17 +16,16 @@ #include #include #include +#include #include #include #include -#include #include =20 -unsigned int __read_mostly vdso_enabled =3D 1; +#include +#include =20 -static struct vm_special_mapping vvar_mapping =3D { - .name =3D "[vvar]" -}; +unsigned int __read_mostly vdso_enabled =3D 1; =20 #ifdef CONFIG_SPARC64 static struct vm_special_mapping vdso_mapping64 =3D { @@ -40,10 +39,8 @@ static struct vm_special_mapping vdso_mapping32 =3D { }; #endif =20 -struct vvar_data *vvar_data; - /* - * Allocate pages for the vdso and vvar, and copy in the vdso text from the + * Allocate pages for the vdso and copy in the vdso text from the * kernel image. */ static int __init init_vdso_image(const struct vdso_image *image, @@ -51,9 +48,8 @@ static int __init init_vdso_image(const struct vdso_image= *image, bool elf64) { int cnpages =3D (image->size) / PAGE_SIZE; - struct page *dp, **dpp =3D NULL; struct page *cp, **cpp =3D NULL; - int i, dnpages =3D 0; + int i; =20 /* * First, the vdso text. This is initialied data, an integral number of @@ -76,31 +72,6 @@ static int __init init_vdso_image(const struct vdso_imag= e *image, copy_page(page_address(cp), image->data + i * PAGE_SIZE); } =20 - /* - * Now the vvar page. This is uninitialized data. - */ - - if (vvar_data =3D=3D NULL) { - dnpages =3D (sizeof(struct vvar_data) / PAGE_SIZE) + 1; - if (WARN_ON(dnpages !=3D 1)) - goto oom; - dpp =3D kcalloc(dnpages, sizeof(struct page *), GFP_KERNEL); - vvar_mapping.pages =3D dpp; - - if (!dpp) - goto oom; - - dp =3D alloc_page(GFP_KERNEL); - if (!dp) - goto oom; - - dpp[0] =3D dp; - vvar_data =3D page_address(dp); - memset(vvar_data, 0, PAGE_SIZE); - - vvar_data->seq =3D 0; - } - return 0; oom: if (cpp !=3D NULL) { @@ -112,15 +83,6 @@ static int __init init_vdso_image(const struct vdso_ima= ge *image, vdso_mapping->pages =3D NULL; } =20 - if (dpp !=3D NULL) { - for (i =3D 0; i < dnpages; i++) { - if (dpp[i] !=3D NULL) - __free_page(dpp[i]); - } - kfree(dpp); - vvar_mapping.pages =3D NULL; - } - pr_warn("Cannot allocate vdso\n"); vdso_enabled =3D 0; return -ENOMEM; @@ -155,9 +117,12 @@ static unsigned long vdso_addr(unsigned long start, un= signed int len) return start + (offset << PAGE_SHIFT); } =20 +static_assert(VDSO_NR_PAGES =3D=3D __VDSO_PAGES); + static int map_vdso(const struct vdso_image *image, struct vm_special_mapping *vdso_mapping) { + const size_t area_size =3D image->size + VDSO_NR_PAGES * PAGE_SIZE; struct mm_struct *mm =3D current->mm; struct vm_area_struct *vma; unsigned long text_start, addr =3D 0; @@ -170,23 +135,20 @@ static int map_vdso(const struct vdso_image *image, * region is free. */ if (current->flags & PF_RANDOMIZE) { - addr =3D get_unmapped_area(NULL, 0, - image->size - image->sym_vvar_start, - 0, 0); + addr =3D get_unmapped_area(NULL, 0, area_size, 0, 0); if (IS_ERR_VALUE(addr)) { ret =3D addr; goto up_fail; } - addr =3D vdso_addr(addr, image->size - image->sym_vvar_start); + addr =3D vdso_addr(addr, area_size); } - addr =3D get_unmapped_area(NULL, addr, - image->size - image->sym_vvar_start, 0, 0); + addr =3D get_unmapped_area(NULL, addr, area_size, 0, 0); if (IS_ERR_VALUE(addr)) { ret =3D addr; goto up_fail; } =20 - text_start =3D addr - image->sym_vvar_start; + text_start =3D addr + VDSO_NR_PAGES * PAGE_SIZE; current->mm->context.vdso =3D (void __user *)text_start; =20 /* @@ -204,11 +166,7 @@ static int map_vdso(const struct vdso_image *image, goto up_fail; } =20 - vma =3D _install_special_mapping(mm, - addr, - -image->sym_vvar_start, - VM_READ|VM_MAYREAD, - &vvar_mapping); + vma =3D vdso_install_vvar_mapping(mm, addr); =20 if (IS_ERR(vma)) { ret =3D PTR_ERR(vma); --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 A752731DDBF; Thu, 6 Nov 2025 10:02:36 +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=1762423358; cv=none; b=rmfW0Dv+g+FhgEixa9cE6RYHLqDZy6mq2ALVDc4fMPRmYICpZ9TBcgmhEYvTYtWbziQuxjUDBhprUbPPYdF0ttF0c2VWxQvZiWV0vwAVgk5M/911k/I8OSn97qJHLHLQtwq0LAZFxEk81zESuxqIbnem3hPIFLpHV4hsMAbsa4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423358; c=relaxed/simple; bh=xwcj3q/CdIriTySoC7OX6peFSSoIsXzZXvpqY2dDPDE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tWcY9R2/LfZkVPc//wsKKS00+JcWX2K8aVrxeOYJx0XVH52NTSVfhD644XhbBgPrjmsnys2sbmHKAq1NqpEG0nIF5vuQlFqTdDAP0xTfjU+O0/9gEAojoi4JY2A+J8AZ0Zow/aYNRQjjmFVoYG58wR8QmdruUNkxopBRcFRk8eA= 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=MrCzWGLB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=97OHrgIN; 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="MrCzWGLB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="97OHrgIN" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423349; 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=VjJXMHE/nZ0JgqIfSCrtFNclnrKwtH1lYk/BfThnBk0=; b=MrCzWGLB0lWIu1LSOV7PEGZzY5qO4h6kdgxM8sQ+P464cvUQMfG66p7Gwm5GPvPSxzpLkC nmOM0yBFy/xcoQ1cY9QkjuO2gA2kOf5N9WEzg//839WZH2Nk9RPUt9hQkDj3BZI+OocJtg xPNG2uZwyhGTsOy7jz8Q38RJ9SzQy65nJ5IWY9JAfG1P/6FJ7hS4s7bc5cUdy4tUI+3BUj xWGGYL08804xu3NZQ3Kr6N9Yb0yK5PkEW5N9ZwUxVwj6JZzTM+FCBFok+gPfjGK27YAkmR BMyte0UKIExqEe3dRc0HHzn/5RzkQTaV1ILYv3sDugaIQSAiYvqF42KE2fj89Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423349; 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=VjJXMHE/nZ0JgqIfSCrtFNclnrKwtH1lYk/BfThnBk0=; b=97OHrgINP8T9ndtnJwjqGrhlOPrUfwm5+CbB7joJIF4im/+8DzD4RTmYgzhZnWUk/8KLmE nxe0T1sIShI4n3Dw== Date: Thu, 06 Nov 2025 11:02:24 +0100 Subject: [PATCH v5 31/34] sparc64: vdso2c: Drop sym_vvar_start handling 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: <20251106-vdso-sparc64-generic-2-v5-31-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=2109; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=xwcj3q/CdIriTySoC7OX6peFSSoIsXzZXvpqY2dDPDE=; b=Hhn5daOJZVisGyTN/NvVhaoCDQr87SW2SzQzmBYTJUPA7K9CAYpDfc4FfkaH9b3CHzTVSr4gJ Ojm7TIxY+OwAeSKIQM/TV9HPLqgjzJrSZrgtkxEic1v3ACiYOlghq+l X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= After the adoption of the generic vDSO library this symbol does not exist. The alignment invariant is now guaranteed by the generic code. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/include/asm/vdso.h | 2 -- arch/sparc/vdso/vdso2c.c | 6 ------ arch/sparc/vdso/vdso2c.h | 4 ---- 3 files changed, 12 deletions(-) diff --git a/arch/sparc/include/asm/vdso.h b/arch/sparc/include/asm/vdso.h index 59e79d35cd7384e2dd752e92d20bc599e38cb8b0..f08562d10215bd3e9a2d4eaa0aa= dc8400b40e256 100644 --- a/arch/sparc/include/asm/vdso.h +++ b/arch/sparc/include/asm/vdso.h @@ -8,8 +8,6 @@ struct vdso_image { void *data; unsigned long size; /* Always a multiple of PAGE_SIZE */ - - long sym_vvar_start; /* Negative offset to the vvar area */ }; =20 #ifdef CONFIG_SPARC64 diff --git a/arch/sparc/vdso/vdso2c.c b/arch/sparc/vdso/vdso2c.c index b97af5ec9f35c01f2a976b6213b1768b677ad231..70b14a436fe2297ab446f778ab0= d43155c272421 100644 --- a/arch/sparc/vdso/vdso2c.c +++ b/arch/sparc/vdso/vdso2c.c @@ -58,18 +58,12 @@ =20 const char *outfilename; =20 -/* Symbols that we need in vdso2c. */ -enum { - sym_vvar_start, -}; - struct vdso_sym { const char *name; int export; }; =20 struct vdso_sym required_syms[] =3D { - [sym_vvar_start] =3D {"vvar_start", 1}, }; =20 __attribute__((format(printf, 1, 2))) __attribute__((noreturn)) diff --git a/arch/sparc/vdso/vdso2c.h b/arch/sparc/vdso/vdso2c.h index 60d69acc748f2401156a730027fe34abfb9fb6bc..ba0794659eb5af53b8c86b24f32= 21a5d0b3f74ab 100644 --- a/arch/sparc/vdso/vdso2c.h +++ b/arch/sparc/vdso/vdso2c.h @@ -104,10 +104,6 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_le= n, } } =20 - /* Validate mapping addresses. */ - if (syms[sym_vvar_start] % 8192) - fail("vvar_begin must be a multiple of 8192\n"); - if (!name) { fwrite(stripped_addr, stripped_len, 1, outfile); return; --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 B1ABB322774; Thu, 6 Nov 2025 10:02:37 +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=1762423359; cv=none; b=rhmSrsp76ojzWiGfxKjaYqYduAoWhxUUiXIYwWOMqQO/2q4nKZSHfQHVc/wjUo+Gyn+fGES9qr2imEWcmO5jU/mLAWVQcZbDPFEHH0fhnCUK7pXPx39e8TleumHFF1//U9S06R78koYXnCU5TrhmDevL1aInqzlSai+MmXZc+3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423359; c=relaxed/simple; bh=rscVeDO1P+cKaXX/Ha1fTrfGby5/x6sbnmbmn2plnQg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O3yCPSvYDjyzRI2sLOm4lyG18hCvTDVtpDc4+3k3Y/voNbv7C65bGGH7uQ3RR7b1ZuhC3PpFeY37NQCvAuJ5uDsV5wDDckyr702dq0MaCY1gI3SqqYay5KWQnQQRfcCTfs0jV7ra5k22+Hq7e4gyEmdsAKqme7BgbxpBMKwF7YM= 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=zzn8GNtx; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Sc2KMZXG; 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="zzn8GNtx"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Sc2KMZXG" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423350; 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=W2Ul6+VkoAGtk+fbsWo8FnOHy/g1Ec+KdWjD8933yrE=; b=zzn8GNtxXQFoEaa+oOM4Hn66k9j4jy8ZoB7IVuciMPbwMSeekysm7Pgrx31hA5SpJcD59F IeUV1idTFmiLR1XBwgWgqsAMn8mLiGV4QseV2EJMxWQiRvjXpOnF2yRKubmxoVvn0x22AI GrQ27+Ro5s1jxynIaILnk1bumKg9F5pEPwO8OaCFfJGk1gLfAHfVK1UGK/81cpBOdtjKtY 3un6M5hvZiLdnQ2jJyKAuvDWp+27AZ0SlqNhHBvYSV1jgFarCbQp1gh99Yl9mp3pZY4uSF 3z2ANPQ1XKHGfQsXqRK/nabqYEG0GqhzPQeq3xF4jaV7bzTveSBZInNQQM+tTw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423350; 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=W2Ul6+VkoAGtk+fbsWo8FnOHy/g1Ec+KdWjD8933yrE=; b=Sc2KMZXGMiSsHbm8MYfddzr66E3sO7dpadeOTTva5Wo7ak7n3k94fbb29g9pelz6nJjyOs hPIGLP7DiK7guoCQ== Date: Thu, 06 Nov 2025 11:02:25 +0100 Subject: [PATCH v5 32/34] sparc64: vdso2c: Remove symbol handling 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: <20251106-vdso-sparc64-generic-2-v5-32-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=3583; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=rscVeDO1P+cKaXX/Ha1fTrfGby5/x6sbnmbmn2plnQg=; b=PULV7avTJJBnwuA28r3mPVOxYpRH9jY8icZE/ATVclSu1a37GckUbIeW+wl+hOeEDrcA6Rzf6 XHLLxsdHHSgCyPlJsmGp+ChkGkWtlb5UZrqfEYqXuyxVx567j+h/oAR X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= There are no handled symbols left. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/vdso/vdso2c.c | 10 ---------- arch/sparc/vdso/vdso2c.h | 41 +---------------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/arch/sparc/vdso/vdso2c.c b/arch/sparc/vdso/vdso2c.c index 70b14a436fe2297ab446f778ab0d43155c272421..e5c61214a0e285547ac57c99975= 42546464bde23 100644 --- a/arch/sparc/vdso/vdso2c.c +++ b/arch/sparc/vdso/vdso2c.c @@ -58,14 +58,6 @@ =20 const char *outfilename; =20 -struct vdso_sym { - const char *name; - int export; -}; - -struct vdso_sym required_syms[] =3D { -}; - __attribute__((format(printf, 1, 2))) __attribute__((noreturn)) static void fail(const char *format, ...) { @@ -105,8 +97,6 @@ static void fail(const char *format, ...) #define PUT_BE(x, val) \ PBE(x, val, 64, PBE(x, val, 32, PBE(x, val, 16, LAST_PBE(x, val)))) =20 -#define NSYMS ARRAY_SIZE(required_syms) - #define BITSFUNC3(name, bits, suffix) name##bits##suffix #define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix) #define BITSFUNC(name) BITSFUNC2(name, ELF_BITS, ) diff --git a/arch/sparc/vdso/vdso2c.h b/arch/sparc/vdso/vdso2c.h index ba0794659eb5af53b8c86b24f3221a5d0b3f74ab..bad6a0593f4ca293feca201a634= 3833268ad1cb8 100644 --- a/arch/sparc/vdso/vdso2c.h +++ b/arch/sparc/vdso/vdso2c.h @@ -17,11 +17,9 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, unsigned long mapping_size; int i; unsigned long j; - ELF(Shdr) *symtab_hdr =3D NULL, *strtab_hdr; + ELF(Shdr) *symtab_hdr =3D NULL; ELF(Ehdr) *hdr =3D (ELF(Ehdr) *)raw_addr; ELF(Dyn) *dyn =3D 0, *dyn_end =3D 0; - INT_BITS syms[NSYMS] =3D {}; - ELF(Phdr) *pt =3D (ELF(Phdr) *)(raw_addr + GET_BE(&hdr->e_phoff)); =20 /* Walk the segment table. */ @@ -72,38 +70,6 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, if (!symtab_hdr) fail("no symbol table\n"); =20 - strtab_hdr =3D raw_addr + GET_BE(&hdr->e_shoff) + - GET_BE(&hdr->e_shentsize) * GET_BE(&symtab_hdr->sh_link); - - /* Walk the symbol table */ - for (i =3D 0; - i < GET_BE(&symtab_hdr->sh_size) / GET_BE(&symtab_hdr->sh_entsize); - i++) { - int k; - - ELF(Sym) *sym =3D raw_addr + GET_BE(&symtab_hdr->sh_offset) + - GET_BE(&symtab_hdr->sh_entsize) * i; - const char *name =3D raw_addr + GET_BE(&strtab_hdr->sh_offset) + - GET_BE(&sym->st_name); - - for (k =3D 0; k < NSYMS; k++) { - if (!strcmp(name, required_syms[k].name)) { - if (syms[k]) { - fail("duplicate symbol %s\n", - required_syms[k].name); - } - - /* - * Careful: we use negative addresses, but - * st_value is unsigned, so we rely - * on syms[k] being a signed type of the - * correct width. - */ - syms[k] =3D GET_BE(&sym->st_value); - } - } - } - if (!name) { fwrite(stripped_addr, stripped_len, 1, outfile); return; @@ -129,10 +95,5 @@ static void BITSFUNC(go)(void *raw_addr, size_t raw_len, fprintf(outfile, "const struct vdso_image %s_builtin =3D {\n", name); fprintf(outfile, "\t.data =3D raw_data,\n"); fprintf(outfile, "\t.size =3D %lu,\n", mapping_size); - for (i =3D 0; i < NSYMS; i++) { - if (required_syms[i].export && syms[i]) - fprintf(outfile, "\t.sym_%s =3D %" PRIi64 ",\n", - required_syms[i].name, (int64_t)syms[i]); - } fprintf(outfile, "};\n"); } --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 BD1F7324B1B; Thu, 6 Nov 2025 10:02:38 +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=1762423360; cv=none; b=LCn3Gy0UvSxU0MxWZTft3jhmbI0qKsdYgWCWvgFlFWHJovoA0TdsCq6EhTt7OTkIwk8WfuB/93JVY3EeJYBBWf/GKyeY0VD/jxn1fDicqzdwC9dmBTGJ2tdgkdjU86Ipdel1UvDj9DQvbpbbmHZUXmOWo5vswG+L5pyjgJgTkhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423360; c=relaxed/simple; bh=niJ5zV3fOozEUYGk5vpPy390WfaoIhw2fIWLZusJAMg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xviuj8PjUUlEsBjPhVPWmWgTziyzvSFGyYqpfNcGzBlqtvoYmf6qKZ+oMv1RQRLDWWHSt9G903RI7x9Dl43xPXoiTe6YtXRkskxzAAqk2h6VD9PSHmMvPCfYm2yhxcBsJe5lXgYASxq4kgLCR8A3vwFAJhCmlvT2pFPeRrc6lRI= 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=W2avoLV5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=z51/jrwc; 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="W2avoLV5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="z51/jrwc" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423350; 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=v0BySyb43wBJ5y5cuP5lO0V/BYHsArDn7KOGMPsnnl4=; b=W2avoLV5mLheM0n5+VZU/iRACei7ZPJhPyf2ExPvLCJLtOg8cTO5cd6e0BxTXS/WW7pnXc v+578OvHwUliGIDwzoV2b58PoI3jwPTH0haNviB6ZMRYjk6sA81FviYVDJ7GgTgS1kCUD5 7MKUqYVYrY1Y7ROD4jHoQqdHRcpUBpW5IovjNC3/00GdWQkPFlykkD2TSpOeSs7yQk/JaE 5kwfCYaE4sj2Idc1y9EXljkfa/jAV73NEUH0LTti0CIgRi2Oo1YpvROL50esn4yaVONVsG H17prNqscppvKmPuWRhLtk0D1jl8JC6cK8l1fLwZ5n/4lHZJjav01KyIU1bKqw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423350; 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=v0BySyb43wBJ5y5cuP5lO0V/BYHsArDn7KOGMPsnnl4=; b=z51/jrwcetl2rrEVfIpSaQ//9zH9OlqAQ+nk+QPbvOf633X9qXNJGn2VcFPCn1qgUSp3iQ yGzsmODS6mDoFvDg== Date: Thu, 06 Nov 2025 11:02:26 +0100 Subject: [PATCH v5 33/34] sparc64: vdso: Implement clock_gettime64() 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: <20251106-vdso-sparc64-generic-2-v5-33-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=3381; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=niJ5zV3fOozEUYGk5vpPy390WfaoIhw2fIWLZusJAMg=; b=ok1VbX/B5odLmNfowHwPvvMIhYc5QqeLEYb3A+eNa2NoDF5JfkeWry4J2iGYC3MGA86BfM9to z6uUO5Ty3z4AaZE/5z2FUlLx9vo2RsEX//6dyM6WrpmK1DEsSnwDS8E X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= To be y2038-safe, 32-bit userspace needs to explicitly call the 64-bit safe time APIs. Implement clock_gettime64() in the 32-bit vDSO. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- arch/sparc/include/asm/vdso/gettimeofday.h | 20 ++++++++++++++++++-- arch/sparc/vdso/vclock_gettime.c | 8 ++++++++ arch/sparc/vdso/vdso32/vdso32.lds.S | 2 ++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/arch/sparc/include/asm/vdso/gettimeofday.h b/arch/sparc/includ= e/asm/vdso/gettimeofday.h index a35875fba45470ba961a7df3ae52bc17d2a4a4a0..b0c80c8a28bb71e16398ab38904= ba826457ac71d 100644 --- a/arch/sparc/include/asm/vdso/gettimeofday.h +++ b/arch/sparc/include/asm/vdso/gettimeofday.h @@ -101,6 +101,8 @@ static __always_inline u64 __arch_get_hw_counter(s32 cl= ock_mode, const struct vd "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ "cc", "memory" =20 +#ifdef CONFIG_SPARC64 + static __always_inline long clock_gettime_fallback(clockid_t clock, struct __kernel_timespec *ts) { @@ -113,7 +115,20 @@ long clock_gettime_fallback(clockid_t clock, struct __= kernel_timespec *ts) return o0; } =20 -#ifndef CONFIG_SPARC64 +#else /* !CONFIG_SPARC64 */ + +static __always_inline +long clock_gettime_fallback(clockid_t clock, struct __kernel_timespec *ts) +{ + register long num __asm__("g1") =3D __NR_clock_gettime64; + register long o0 __asm__("o0") =3D clock; + register long o1 __asm__("o1") =3D (long) ts; + + __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), + "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); + return o0; +} + static __always_inline long clock_gettime32_fallback(clockid_t clock, struct old_timespec32 *ts) { @@ -125,7 +140,8 @@ long clock_gettime32_fallback(clockid_t clock, struct o= ld_timespec32 *ts) "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); return o0; } -#endif + +#endif /* CONFIG_SPARC64 */ =20 static __always_inline long gettimeofday_fallback(struct __kernel_old_timeval *tv, struct timezon= e *tz) diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gett= ime.c index 093a7ff4dafce1cf0af5af4c303bef86e159858a..1d9859392e4cfd285349cf9155c= a1fc25d3a7b41 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -48,4 +48,12 @@ int __vdso_clock_gettime(clockid_t clock, struct old_tim= espec32 *ts) int clock_gettime(clockid_t, struct old_timespec32 *) __weak __alias(__vdso_clock_gettime); =20 +int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts) +{ + return __cvdso_clock_gettime(clock, ts); +} + +int clock_gettime64(clockid_t, struct __kernel_timespec *) + __weak __alias(__vdso_clock_gettime64); + #endif diff --git a/arch/sparc/vdso/vdso32/vdso32.lds.S b/arch/sparc/vdso/vdso32/v= dso32.lds.S index 53575ee154c492f9503efdd8f995ac2a035203c7..a14e4f77e6f2222b855df27cc7a= 0d0a4f98bd4ac 100644 --- a/arch/sparc/vdso/vdso32/vdso32.lds.S +++ b/arch/sparc/vdso/vdso32/vdso32.lds.S @@ -17,6 +17,8 @@ VERSION { global: clock_gettime; __vdso_clock_gettime; + clock_gettime64; + __vdso_clock_gettime64; gettimeofday; __vdso_gettimeofday; local: *; --=20 2.51.0 From nobody Fri Dec 19 15:48:17 2025 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 CC4643254A7; Thu, 6 Nov 2025 10:02:39 +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=1762423361; cv=none; b=OK5Pg1qOh0rWLl0wR/c8oz2L3xFD1NpfKvwdmaI5vdm+bQKYSl1FtAdnDLLYOSVHrnFDrT37QrnR2rj+KdktlmGZTBI7NZIWL5MPTsE0/XcoUY7yEpcoTXM8+tEBPp163KqklLttNt/QC5CwRHW4YN/j3MD8ER33L+zU9JgV/W8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762423361; c=relaxed/simple; bh=R2dVhre2T8n2qzoofQAXu+jOBab42AUukdse5kq9VNI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IYBL5OhfdJhtOe7/UAQt3qqIK0gwJZPaMH2ex+p5I16S3dc234wJTHNzoByOhjUqvKrqtdfTJc0ws3eJIRn26wnz+XDTYpsHYqMkLVzD0qeHii166TV8P38Pk1Boc0oXmnDdy1JPzV9wsUfX483gMgAgVN5c6W9vlQE46IUWAWA= 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=ukZ4xA6V; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wdet2324; 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="ukZ4xA6V"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wdet2324" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762423351; 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=Ctw6z2zVCPFpRDjjK/Bor9mxmqzsDUqKVIr3JUMCPTE=; b=ukZ4xA6VMy8Kt0FQwFFNDx6HyFszi48OmTb6Cekc257aWBUoIh9WgBxsG9/zTw+vU9Pdtm +fvMsScYYwWrK2zhQg8UJofVQzw6/PUjMti9i3Duw0pCgYUh0vblcn0ENE/aah4Gk4Z6Gw H2bLt8zmr06JtpY9KYyfH1kYgaQJS1kFRybhmtJHU6WFIG3wlyuYNeaqN7Ce9fBdvJHDlb 88lniXb7W0obwS90lw3cTO5V5FceGY0YN3yoXEdRWfz5Plq5boQmmHs6OmzfdbthhEW33p 5/8Uy1TW+6kKiVxEygAP6EhTO3e9wi/Md7E2FL8Yzy1fwtLpTnwqQNxg+cC8oA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762423351; 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=Ctw6z2zVCPFpRDjjK/Bor9mxmqzsDUqKVIr3JUMCPTE=; b=wdet232463nNOwVZwYlaNoIvfOv/cO2eGPt/hDZAA+phi8f2WLHCMaofKd6ja5fSEFoxe9 mV9EP3mCPOxd6hCw== Date: Thu, 06 Nov 2025 11:02:27 +0100 Subject: [PATCH v5 34/34] clocksource: remove ARCH_CLOCKSOURCE_DATA 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: <20251106-vdso-sparc64-generic-2-v5-34-97ff2b6542f7@linutronix.de> References: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> In-Reply-To: <20251106-vdso-sparc64-generic-2-v5-0-97ff2b6542f7@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz , Shuah Khan , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Russell King , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Shannon Nelson Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-s390@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762423327; l=1786; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=dQYrfrH6p59kOQp8CklF/Vp09pCtZ6J6GVY/7odturY=; b=1Wi9mWGUpw4gouObAIh4SKslvazl7wdxf+u0FsihHL9CxGgJV9Kufo1aP1r6igMIsXWd8O+PB zw5j5PN1Fk0Bx4MhmZvwus8qCRYjKYfcFQLyL1yLLHUC/dfVVt3SccB X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= From: Arnd Bergmann After sparc64, there are no remaining users of ARCH_CLOCKSOURCE_DATA and it can just be removed. Signed-off-by: Arnd Bergmann Acked-by: John Stultz [Thomas: drop sparc64 bits from the patch] Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Tested-by: Mark Brown Tested-by: Srikanth Aithal --- include/linux/clocksource.h | 6 +----- kernel/time/Kconfig | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 65b7c41471c390463770c2da13694e58e83b84ea..12d853b1883265cb47d93e33d83= 70e3957e7e695 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -25,8 +25,7 @@ struct clocksource_base; struct clocksource; struct module; =20 -#if defined(CONFIG_ARCH_CLOCKSOURCE_DATA) || \ - defined(CONFIG_GENERIC_GETTIMEOFDAY) +#if defined(CONFIG_GENERIC_GETTIMEOFDAY) #include #endif =20 @@ -106,9 +105,6 @@ struct clocksource { u64 max_idle_ns; u32 maxadj; u32 uncertainty_margin; -#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA - struct arch_clocksource_data archdata; -#endif u64 max_cycles; u64 max_raw_delta; const char *name; diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig index 7c6a52f7836cef248e0949060b50baa293f446cf..fe33118770978682d0ff6c6e799= 0896f42703b50 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig @@ -9,10 +9,6 @@ config CLOCKSOURCE_WATCHDOG bool =20 -# Architecture has extra clocksource data -config ARCH_CLOCKSOURCE_DATA - bool - # Architecture has extra clocksource init called from registration config ARCH_CLOCKSOURCE_INIT bool --=20 2.51.0