From nobody Sat Oct 4 14:35:16 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 601C22FC89B; Fri, 15 Aug 2025 10:41:52 +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=1755254513; cv=none; b=lE0r/wQ3peJZfjoV2jvNVp+SAqhBtNevAFh7I3l7SSVFvd3wZlgKgjSmR1B0xziq9LlB5+/5VKzQqqC5QcC8nKGWEE3ldwclU83m6rDFYztYVaJzRLpko/eSbEbuuoveUrKm4feEfUjQeLidx3I/Aol/uE8zaiODV5BFbqnmOx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254513; c=relaxed/simple; bh=A2YNc0MwCxtVL2QJwYK0jWBU1Qh+09MjIWJv0XFIwVo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nQErn+oOfC2kFW7wbYb6ejfm9rKDtBHIcKznGWZ7C58e23lMQqQX3Lu8XOLAunsX8Zs5mWJ+MqsZzaFB0d4uzmx7mPjRqHNLs88hYVyHZJ9H/DVlZdz21Ft3qJJ+Me6+92U6esIr0JNI3qcY2akFYyms7ICBeDr5nEsqZbXaMZs= 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=O0azHQVU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=r0edVs2z; 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="O0azHQVU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="r0edVs2z" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254510; 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=b0YJNOPK2tBNibBCGd9a6FHp1U2Oqwk6iytj2eWY/Z0=; b=O0azHQVU4f19/k7WeAShnuI7UnoXqsaf7til2fgLY+2Sxp5Y7+C9fV6LiygSyljY5O5Msc P/iKYTM9BPNpCbDFzqvcQxMYwOeC+pQ5OeDQzWcSfR/BwacMbeH65Au3OJReQ3rpNuJiOR k/OXC1+tGPccHpetuyuNbV8xLqoH491hVSGWRSQBibB2u5tKxxjrnjZ0T5KrqVWUMfig8p WqRUFAGbagvv+9dHm3+OX89ZG/dsW7Ftcs4dRKHUP83zAuGnotM6AgPWVjM1Zh3L70tx1r GcGoVIS+AJCt0o/tUZZB0qfiShGjSRwRKn8IzhnFF+ZFYHmnXU0Z/W+TlaKpMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254510; 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=b0YJNOPK2tBNibBCGd9a6FHp1U2Oqwk6iytj2eWY/Z0=; b=r0edVs2zZco8AojgjqQIXAkU7br7PVvWenA8fanz37dA7LgV1EKwdpixResbMivjllZYuc ES8CEs6wIGCiccCw== Date: Fri, 15 Aug 2025 12:41:10 +0200 Subject: [PATCH v2 01/13] vdso: Add struct __kernel_old_timeval forward declaration to gettime.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: <20250815-vdso-sparc64-generic-2-v2-1-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=817; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=A2YNc0MwCxtVL2QJwYK0jWBU1Qh+09MjIWJv0XFIwVo=; b=NF6YMeWQmMaXIT9VB3H1Pb19dFOriba9vBsbVZkstMQoGXFy3pEojc0BJM4TBeQ3k7q8VQlST Dy/MGtkr/0rAXMo5IR44WlA+ulyGL/FsA0m9SRb7m/PiGPhjfDaJWvM X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The prototype of __vdso_gettimeofday() uses this struct. However gettime.h's own includes do not provide a definition for it. Add a forward declaration, similar to other used structs. Fixes: 42874e4eb35b ("arch: vdso: consolidate gettime prototypes") Signed-off-by: Thomas Wei=C3=9Fschuh --- include/vdso/gettime.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/vdso/gettime.h b/include/vdso/gettime.h index c50d152e7b3e0670ea87cb51452c0a03b98403a0..9ac161866653a01c2a54702cb72= fe5bda488ee2c 100644 --- a/include/vdso/gettime.h +++ b/include/vdso/gettime.h @@ -5,6 +5,7 @@ #include =20 struct __kernel_timespec; +struct __kernel_old_timeval; struct timezone; =20 #if !defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64) --=20 2.50.1 From nobody Sat Oct 4 14:35:16 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 6014C2F90EA; Fri, 15 Aug 2025 10:41:52 +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=1755254513; cv=none; b=Goz4ZSm7YH+XYP82MufuVj1kP9Tol2fHRn4zesZpbJ8+MxtUsaQrGXYzcI7XgC8U6a69D55OTm3+TXm6+OpxHQTeHkpZgQEPKWm/Z2jVbwUz/e1OfepQn+zUalSXhV6gMzx5byTcmsZlfcwqsq5JRyP7bF1Rgyz+7Q+p8TLbOLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254513; c=relaxed/simple; bh=e8hdBfEAunWm5z5dBSxtAkNh8u9HgO3NtR7zDMo0nrE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iS4eOF24YdDDFsOHIgAn9DmGa94Rd83fYFkhd5m4e86eCzRUBD98J5oEpp+/s2dkQKBeHwFk2OR+gHak/8UOdzHerCLMcTybXCV8Ddz7bOWkR6gg8IRf/VH7cR8gIvEi9th6tiwnyVVIj4yVwKh1B4LV5b/CB1JCwvmM9TRtk80= 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=wb/6x4b3; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=StYWTHkc; 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="wb/6x4b3"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="StYWTHkc" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254510; 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=Q3UBXYrZSrikLXywyNQh7Nv7j5x2sJSuJodc6YeKRNI=; b=wb/6x4b3nzgTLDOYyHe575s//uHl6ZCxoOWCoBByEagipw/luAG2fvxip3PU5QWOp+8gHE 3zD8LVnjN55ljS8BRpKE9J4/S9g6bW3Uw+SiVXlu6U2olcTzIC+TKaRhYE5I9FoUnHMP0+ FWVh1O1CT4gsEBvvy65/Zw1F4zLkkBJbhZRMzaVOKQ/c4GtYgULXNX5FIPCReCs8nj09n5 BedT8VGIhK9+ApGSYyiSiMDu21497aon7JOJjiduZaW6DHB0vKShEA7SW2rPKzxnTB58MX 5NfXo392IkmowmNJfeyB7ol0enq64JLbtL8nGgMMQB9j0NotK4rYaG/A/xbECA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254510; 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=Q3UBXYrZSrikLXywyNQh7Nv7j5x2sJSuJodc6YeKRNI=; b=StYWTHkc7ZVbdCXFhGeSCi1P2EwaG9HJq5kviZ/TCKq5GveD/BgUtlnA/z6GlLsnl0Sjdm xBcuGt5YI+GPieDQ== Date: Fri, 15 Aug 2025 12:41:11 +0200 Subject: [PATCH v2 02/13] 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: <20250815-vdso-sparc64-generic-2-v2-2-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Arnd Bergmann X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=1408; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=e8hdBfEAunWm5z5dBSxtAkNh8u9HgO3NtR7zDMo0nrE=; b=6IGnznFkiTgziruG9hnkb52voPuyHP9xEqD7GDkolS8EhQtSDg+EYM1Xd1/VLG5n5h5Ehejbv EcLYXlnDR11BzJkQzAjFi+5C3Qggbup89kqpCsIHE6gsdTLygv5GbgC 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 --- 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 683b2d40822447849d1b4a8e3f85d35dcf9d727e..400529acd1c10e7f05fdb6c3305= 93acc3c06b6f0 100644 --- a/arch/sparc/vdso/Makefile +++ b/arch/sparc/vdso/Makefile @@ -104,4 +104,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.50.1 From nobody Sat Oct 4 14:35:16 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 E5F4B2FD1B7; Fri, 15 Aug 2025 10:41:52 +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=1755254514; cv=none; b=AAPQNAlOJcn1IxakuH7WVY9X9VZFaqrkmUrwkZhyug2yU6DWxrb2TbjUSzWaZYZtpR6ZE9IaaOO6gtt7XLYT2Tfq50Cp9V50uODWkKM+JY8ZuUPCGH5NvIebax+udblvr0rvkudaiRLBnDintvPeadHsB0tUM/ACK/pEhfJFp5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254514; c=relaxed/simple; bh=/d7Kjsadf0MQRlQ8rFqan/QHEDoMwt3EGw/m83TdkFo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BaDl9LnjHkziwbtp+DVUW/KsDoxMpcMsSOXFR0rWdkNNF9/68ZSLuefBl03EOZZtinaKnmrAXbEg+mcDVCrD0TZv2J8jn5kHfbtdQNeGgB/ZQTPMEEUGB+pzotJZI/oyjIBW9mCS58RV0Y+uQSNkYeVinbsxUQurzIUbsTMIOMM= 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=MRS5uzyA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HBZme7Gz; 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="MRS5uzyA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HBZme7Gz" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254511; 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=qnPjxZaxoUQoAn4OPvNzydHs4g6dzmGoN+Wts/M/WYo=; b=MRS5uzyALOzzbgqIhr/NW+nmRjpJu+QOVsGga4UsRDsYzq+7wKoSN5wMrZBmYsyN4AUex6 dXY7Qx8GpaD/h3c0tv7ZWcdBjsuIkpRik2IQluiTnLQ/RmD7pc60u6NNO5eqRq81beUSQb fFbIrVWhCQaTA0B3ou8Cc4Of4EjDU+jiSB3CojIkH/J1b4fstgRXehDbanAmwu17yVRPdu L+THH6HpQO9lIOB874/AspJYWqCPv1mnLSYShwUQAbYuiQjt4brgDg0YL82Ew4Gd075+Bw KF4ayeZWZ0a7/klEVPupKXcayftkNoDJAgd/Myt3rL+EZfZZVupxM8jXMYchkw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254511; 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=qnPjxZaxoUQoAn4OPvNzydHs4g6dzmGoN+Wts/M/WYo=; b=HBZme7GzSr4gGDyuWHkNNihJTMQ2ovo2bBJA20daPHSiH4TmEVrVlnVPy97p6AbZq0/OUP fyqHaf26Btks9MBA== Date: Fri, 15 Aug 2025 12:41:12 +0200 Subject: [PATCH v2 03/13] 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: <20250815-vdso-sparc64-generic-2-v2-3-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=2564; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=/d7Kjsadf0MQRlQ8rFqan/QHEDoMwt3EGw/m83TdkFo=; b=aAJMYxAJOCSnDVjOGCL6ij9n9oPUK4D1ASxHPS9A822Lh6c08x9F5LBNwkSBxxqw8O0WPfWjb 2S/GchAi9iuDa52mcVhfjGqR1iu0Ot4hJtThRuSSG44XDOIrDp6FJow 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 --- 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.50.1 From nobody Sat Oct 4 14:35:16 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 81C7E2FDC34; Fri, 15 Aug 2025 10:41:53 +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=1755254515; cv=none; b=TNpaok6pxsKdvlqEU9QTnvkjB+XxS9aQ5V0tuKe+5AQZnZTYd9FLcwziUMh3j6xY0Nw94z6Um6tFec+i04cbvUhojrKwHOje+nCNQCMZLRQrjKtJtpM1LNJIig6c9+p2VN6X5Ka2WMVK5HafHrx/ykgmkN76fcLJ6IqgvTefBxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254515; c=relaxed/simple; bh=0/g2GsyjS8KJIMqWUa/EP+pQi3Fle5PXvW2vOi9eawQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gFhoGbRDYfY5DVPDkDoMUsKf/s55PWvKLPqftfext+yv9iu6MMSz4f/nzXlCyk0vzPuiY6BL7WBGqn/qxJLPv9pWeKI1qt7SFV3YARq+EagNniPL9BWym3IiDlhklBoyO6KUeF03KKopj1JWu7w7NAjei40+HEvdSiIX2//lX6E= 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=CRHVX62T; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/SP0A1RH; 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="CRHVX62T"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/SP0A1RH" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254511; 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=XU1YN5GY1NF9dXOEw6O1SSJX5jgdbpTOc/qjXs3cbg4=; b=CRHVX62Tsdqkcl31rrjNJRTZztqvk1EjVDLeAlPVK/0CU8AJjh0mi7qhWuW3HI8bmuErqR SSWzZTCzisCQXKzv/GlnAZ0NE8uqk055nO2rJeibnqpif32ta1ctNHzF0wIBAxyQbIUAZs lrYF22Wdn4VZBgNJIsy2rt1THWl53ydH7DSEkbl6TgB7tN9dtpOg4fuGHIxIJEaAiBNoH6 Q4t7Pm5svU+P/cvmBFyxNqCswSBBjzE0QOZgMGnFH3HzkBM9l7bv03f5QvsrmhBbDnRwDm 7oxYnRURdcMjlKg3cNXO7C29YJT/DH9MA5tEE7IBMhxmaxuJL44a1ZRvR2WLuQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254511; 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=XU1YN5GY1NF9dXOEw6O1SSJX5jgdbpTOc/qjXs3cbg4=; b=/SP0A1RHF/FV7SOLLzdWZ/y937QRn8r+//oIae3cCnDqasmFTS9oW14asrPyCP2vOOc7PJ v5w7ZlgiNvedjpAA== Date: Fri, 15 Aug 2025 12:41:13 +0200 Subject: [PATCH v2 04/13] 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: <20250815-vdso-sparc64-generic-2-v2-4-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=11901; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=0/g2GsyjS8KJIMqWUa/EP+pQi3Fle5PXvW2vOi9eawQ=; b=TmPxQRla263hs1pXiP2pRUeMTloNUXslVyVngghGLJCJUi9xxocZk7096I/zGKichH5fcJw+u c2Sa9hyvgacARRFsd8j65iyLMdHElGmkKUg2ovAWLXcDcoxti6MfroU 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 --- 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.50.1 From nobody Sat Oct 4 14:35:16 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 007232FFDEE; Fri, 15 Aug 2025 10:41:54 +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=1755254516; cv=none; b=MFANout0GlL/5RgyUKKA+lSxBxoWLOO+Tu1wOi03wSgBkFQMxApLdNjM9eK8wu6RYfp2n5bhAR9HNl2I3z3Z/5z9oon+geSyoohsSamwc9a3CW3/CftuyMypwjeAgD3ZNlAEY7IjplOGuNSSbL9sNKkzj4vzeR6tW4HI4+GMdsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254516; c=relaxed/simple; bh=R/7SMLtTSxU0UP8uzpc/nkJcNW/8iGVGPfNl4DUu1jk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YmsnrCn4JsrjGmI4Zr1sqCD5q/Fe6T8dL5gdOGoLiB0Y5kbx5NV/+XddrM+B2pgAN/lAJzQ0N9qG84XQQWUuSb8jv444+f5oJLPal1z39z0hRfXB29Kvnu7xSOjamXHl/hjmSGp1QulhrzR3WVDj32TAUIEhOz+/HXM+h6K/gmg= 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=Nr5gCix5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=otHDJYCe; 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="Nr5gCix5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="otHDJYCe" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254512; 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=kXXuQmbtNbMKcOdr1/KY+a9hk0uNHdp+yrfWZDSG9tQ=; b=Nr5gCix5eJAmIYM2yDDpntHDrqppNqfb4OJPorRwplpcgQsh6rZ6kz9Gp13ynSfEPHBPi6 jtjKTukJ+h4n8mEItZLaZN7BBOmL6gjaJRH7DU7Gkx3WzM3wmCzlIfuiAzVhLvK3sMf5M6 7DwLaOAPK3GujMlwZcvIYOtbRjYeoMikM0i6b8zZCtKongfep//zr09IUX0DDbgH4mQnwH D5Ez6a70jIB8LRr6J2lxiKhZyWkIweZlmykfOSrxNXUK4tFtuq2+xlC11xV9ezTT7MuSfi 1m1Nl+GI1Qwb+08L5mBJfE/msdAzufr36IqDo/AjB1RwYb9344Yn7N6DGYFVGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254512; 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=kXXuQmbtNbMKcOdr1/KY+a9hk0uNHdp+yrfWZDSG9tQ=; b=otHDJYCesVM8PRYn/RDKHDQJityJD4Mdn4sgmpMuXWRato1w/UH37hIns2PLG07E/Lxu9p JOiWRCY3sGx0mYAg== Date: Fri, 15 Aug 2025 12:41:14 +0200 Subject: [PATCH v2 05/13] 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: <20250815-vdso-sparc64-generic-2-v2-5-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=5708; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=R/7SMLtTSxU0UP8uzpc/nkJcNW/8iGVGPfNl4DUu1jk=; b=iVlVLj3MetXU+/m1F2Y9HWwJXjnwu+9vsRh8IWAIJCRTgj7MMnx+diTLeivBkZP8lI1HL+vHM n83XydxbyUdCPBUA9mzBTRsswl5nTWolcnHpfDVXAUwMLPl5hqQWUrm 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 --- 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.50.1 From nobody Sat Oct 4 14:35:16 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 006B52FFDEC; Fri, 15 Aug 2025 10:41:54 +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=1755254516; cv=none; b=fH/KPp6L5fEKa1Wh/bJ8M05GI6QNE+33QYTtMkF58XAluUuDyYs9b/fcSKlDc5th8itEW1TSj7r/Fc4EE038cjGkbKR3GGJ3hmNzKBDzrzCMgOw3ZtttF3/nlFftTU6jn0qxJ90f/y60H231bKaaCKChTDA5ez90JKIh1VuCrGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254516; c=relaxed/simple; bh=SZBVHPxxjM9+KjJ+9Qjge02eG8TvIiKu/c5n9Bjy1do=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TQeRl22VlMVSsUlhL8r1BEIHn0+w+7BHD20982vllk5LSQ03jr2tThUUeJKR7Rw6Z2xwmHyRxW2RdOrvP7dKTeH3JCxjTZeTBRjprmJAbJ06GZ0LurrhqwMlTuc3JqCkO6fdgDHa/7K9EcCrEkKmMlcEqZARNA4/NaaBFGVUwRk= 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=XqXAhCV8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Lt3QLVCO; 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="XqXAhCV8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Lt3QLVCO" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254512; 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=x1Bu5riyrzFaVUf5zCmCHUgPZraZdNC+xDdGbUHNnCs=; b=XqXAhCV8ZMeK1xUWYP7MgKC6hF0sZGIT2qPQGwqN1pv/pcoAs/D6zAxSbldMvPKQhSJX7s OliCaqQEAY0zRQgPPFf4ieZz+LHy0nlqLEd4riQMFeMCvd133t7tD++ivlvFA8EiRdyfoE MbumwraHWhWAN6DjYNYtTgd/CoJ1dpiJnlah8+d0fZo9RDtVAF+a5jqD1LCdJ0TKU64ASX JIE8V39Qo2fCezrw6wB2Rq0Qm/pQKAyXN5YbCigxOgqaJb6hjMHhyTSAFQnuNx9eIsCxAf CIxnBDk2ZXqSOV/EVhNXkY8wTfP6+XrXgWAgsfx7PgdenOrUHTGerg0X8dpLuQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254512; 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=x1Bu5riyrzFaVUf5zCmCHUgPZraZdNC+xDdGbUHNnCs=; b=Lt3QLVCOHfhW70Uv2saPtndEFHHQqqH7CItoygjiZ6XDEBxflYCPGNfIZIFAang32o7N9f W4g+upgoWXyFaWDQ== Date: Fri, 15 Aug 2025 12:41:15 +0200 Subject: [PATCH v2 06/13] 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: <20250815-vdso-sparc64-generic-2-v2-6-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=5693; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=SZBVHPxxjM9+KjJ+9Qjge02eG8TvIiKu/c5n9Bjy1do=; b=+sbXSDb2Vs6BRIi8dE4gtY1nE5VyWHZyXC5SIKMX9MQXdjj9CmttH21CulfoTnEOizB+zyX+R b70XWxuZD18CsENQJ71it/i72gSYnd1CXS8wa65e2Q0lqAn15YWFYbN 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 --- 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.50.1 From nobody Sat Oct 4 14:35:16 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 7F7673002A5; Fri, 15 Aug 2025 10:41:55 +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=1755254517; cv=none; b=mj/E8XLEIuZ+fM7pzIk3DU2DWiYr2J6Nx/tXNROd4xOVzvnfcA4EQr5DEda00vkeuEo3r4Q7bNV8vscfdXacpKdbJn9TVjW/H7r5QHffq42lTFMF8GieZ+q8TqX2pThNHR/Xk9cJIL9iTjAE69XM/Ikp5PCZLv4xFJX0JK+jkiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254517; c=relaxed/simple; bh=SJRaOguhTl/Tk5XbsGGzu50TtmtYidsEXowjFzTGB/o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=syZSxxS1BdwwVlrYGQ5klldDmQD0dAFtTlkQXi0fgZVqhca6CN7c147+U+JIjKvYz6QZ8oS2j0+CFlr3yaPpLOY66Xt/wO7Yx3KyTXFlhmdWCWXcA2JNbWL69jms4PDtMM2Y7X1uSLmoakhlhkqyk7ro0p2SJ42owDckVsiqk9k= 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=WGuydQO8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ijcCssBe; 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="WGuydQO8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ijcCssBe" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254513; 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=XEoztOX42ZPvrRbI5LNX79Yd84LWhBUqfG54KTkC4Qo=; b=WGuydQO8WVMd28MwRGcOrycehqTfwI2l21GBtoJhvzZJRktKbPEpqNU3IklsPDbYdGOUt/ 5Iwm+1IDJUA5QOBVRbCokyV1OqZwZI/Ok6EpU3gpaIRuOo2iURZRY0yqr/YGMAaOK/9ROu yo8m+vmULoapZM5/2aqICo01Su8vBnFlt0Wz9rWhmifweKH8LgyJ6P6q684mAyOl3u+A5E iI5lq5TL0tPXNgxWC4v2tzbF5DmB4FyI2Em9+vwpJpu71oAOykpNkBVtTVfdK2ncRLFNnk wHM9el7pidDf7PgpRQL2Q5nNrtJbd5nXGa2sjYbVG84YkmtERRuyHBDZGgfWMQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254513; 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=XEoztOX42ZPvrRbI5LNX79Yd84LWhBUqfG54KTkC4Qo=; b=ijcCssBeGbrCfA2++LsHFH9crCdGORv6SQqZsL/qV6OfnkMtd86GDcbpBWXdPsq0F1UQkk 15SipwgYQ7aY52Cg== Date: Fri, 15 Aug 2025 12:41:16 +0200 Subject: [PATCH v2 07/13] 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: <20250815-vdso-sparc64-generic-2-v2-7-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=4619; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=SJRaOguhTl/Tk5XbsGGzu50TtmtYidsEXowjFzTGB/o=; b=pPDKyV+wOXXRexlKU9+bFxSZgq+GcJUqIVX9hqOIUKnYT/vG228rwVvPwW8yJ96o0WfB38vRy eV59Q+PyniYDO44OL3UTz0RoycRZi3tuy6Fph99Ru/DXniIZLIhVDwg 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 --- 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 0a0d5c3d184c751d232a00e73357c0e345695a94..3de65ad6d78592013b1d1158a58= 497f3821d003c 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.50.1 From nobody Sat Oct 4 14:35:16 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 7F7DB3002AF; Fri, 15 Aug 2025 10:41:55 +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=1755254518; cv=none; b=PUNt69QoU4/R8/qgGwIc8SJp27xk9aextgHjqY2K48o4juoVzkUckNnDiqYAfZRhx+3hbJIL46MSRxgj7BIh8SXb1EALw99g/LToamWSmJn9iIxy5xSiJzA/AjU2p0jvX1NbTtltqWom2ZDWJnuO3R43Fl6cVWFvLGiJBbWx2BU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254518; c=relaxed/simple; bh=KlVrxNmFqYVVcAkMgQZecymVNTdfEyg1FvbkFGIvCp8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WqLoQ8tvdOjLbOswwfIIgXH5AiMT4hbMIVKkWea+ItursMBwLlU+9Qu8LV8ROnrXd9OIbimY7fmjrbxDjwsNEzOZhTWEbmut80uG26heqAuBokOTvj4n3NEBJ2BnTLfQYJjdr0C8gH/1Lod20JHBWQyHR75OKBxkD+dapssVuRU= 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=aSVIe8aa; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0CriP7U6; 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="aSVIe8aa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0CriP7U6" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254513; 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=z57T32T/8fGqI7fsfJtiiPZLToHhT6uUZUCpqjneMWk=; b=aSVIe8aaaoBVNNjLKWeJHmHLU6Zo3wSXzEc74YSICfgJ6ZkaeDndkyuWDfEzWUM43vYp/Q chr0Pmhp9l807UNpKOUg8ZWkOrwtNZFtbc9IRTP/4jx55VWaWS8ZHRctqtSwDTVePlGXWX ulRgiK/h3AD5OKUhT4zECj+21t5ng9Tg97TigRu1jz9PCTBpoim7YmDf2mb1IywQTCaRrO JuOLDmZ8YwOgwfWSrXYM2ZRITfeeY1cTkRJx8DlNVxTiYVbujV76icx667MlzsV5cfauQ9 4N11R1a8fXh5WMkPk8Uq4FaH/CvcjqSbXl07ih9k6X/ri8Di8+RbztD9gcTPeQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254513; 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=z57T32T/8fGqI7fsfJtiiPZLToHhT6uUZUCpqjneMWk=; b=0CriP7U67xz38Sz6td2n5eMldFiuJbRmAdZEnVJBYiUqj0sICKcSeuyyEURfn2kb16wBH4 r5QAFLjSoJFSKnBQ== Date: Fri, 15 Aug 2025 12:41:17 +0200 Subject: [PATCH v2 08/13] 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: <20250815-vdso-sparc64-generic-2-v2-8-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=24608; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=KlVrxNmFqYVVcAkMgQZecymVNTdfEyg1FvbkFGIvCp8=; b=fWsJJcBs5RjglCyHEKHbe7Qu7rRvMXXMj/DgVKzYg4NdOt7mL2EsNaUPwrxoHK1LvRo8+c2uc T+tra+Bc6G5AdKxJLvNpii+aT3K5Vgz/sJQFBn2sbIn7aRS5ItUA/sE 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 --- arch/sparc/Kconfig | 4 +- 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, 119 insertions(+), 375 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 7b595092cbfb65bf196fdae7039be38f7d201a7a..065bd30d321dbb089df79696dae= 63e97f781cb87 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 @@ -110,6 +109,9 @@ config SPARC64 select HAVE_SETUP_PER_CPU_AREA select NEED_PER_CPU_EMBED_FIRST_CHUNK select NEED_PER_CPU_PAGE_FIRST_CHUNK + select HAVE_GENERIC_VDSO + select GENERIC_GETTIMEOFDAY + select GENERIC_VDSO_DATA_STORE =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 36f2727e1445d0ea6e1c1a9ed716e04338a0c9a6..7a063cd4b6d3600e8e77efad5d6= 9ac1d9fad2f75 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile @@ -43,7 +43,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 400529acd1c10e7f05fdb6c330593acc3c06b6f0..38c5b4550a0943e6960d9fadfa6= 336dfb96072a2 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 @@ -102,6 +105,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.50.1 From nobody Sat Oct 4 14:35:16 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 0092C3002DA; Fri, 15 Aug 2025 10:41:55 +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=1755254517; cv=none; b=IGpGzYFsBzcnHArJPuwgtjz7HKxsRndOOJsqT4dl7zSRIG91LSNyeNH7WfBjIqGAkP7FiLAowfE7IoCnJPWMtgZc+ebybvKUKwsJUzUPvyeFA9yw9fyqyVbhkfp000JvMptofIjaT/P3AnQZ0jQfO/vGnSE5ZPMusbCLr6vA60k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254517; c=relaxed/simple; bh=fxgNwbguzm19mxOl+d1yMzx0FAgO/SMJ+Tt1yKD0hgU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sHTwFjCTHdUK+OM6qBCAPj4jHmgLup4L26CuSYAmNabSgBoZLgsieWAZ+x1ssU0XyEKWkntbY51zPB5Ukg3tGS/em84y1O/SG+sf+s2yEZLHe/u9AnLihraQm2iNG7p6lNi8HOXM7eqasPEXhi1aWNvlvPImaZweDBLpnqYTxdQ= 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=pKbG/KPV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=MmIT1xov; 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="pKbG/KPV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MmIT1xov" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254514; 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=G7Fn8+v2ScBzJFYv6AzzkLmPfAu+RY8HxbLfk2DOx3Y=; b=pKbG/KPV4AcW6a4MHsxtxnNGo9s8AGwrJmeAEc9Y10Md+v4M/CqzVMHZqbBedGsDsTMSk9 qgy7OO08iG+/164uyIvY2SawYhoxW3wXdBvnJtcmm7y/ZkTyIrX5251RmfQ6aaRzqVL//j knkvOri+hRuJh1+NvnlrMinno8l98B5UsemfEQl0djtSL+Y7Lj3mktPXHwXvCub/3+e/bU pYTAGIi2/codoU2uKraofLNKhuNdsJz9smirs546bMLcqA6Ew1xjliJtC5mHoZnZ7k+MVc KDKIORxozI1+7GMpqGf0G/qVVeh/2+376/SyUFWxSGFz8bVlwXZaT/OtW0NQlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254514; 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=G7Fn8+v2ScBzJFYv6AzzkLmPfAu+RY8HxbLfk2DOx3Y=; b=MmIT1xovdGZgu6/SYnBuI4EhM6ozIshd3NnNwg2gTI7eLpO+Rq9tLvW2BpPCLL6iPYkYVa 7tggsKc6AqC+4yBQ== Date: Fri, 15 Aug 2025 12:41:18 +0200 Subject: [PATCH v2 09/13] 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: <20250815-vdso-sparc64-generic-2-v2-9-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=1958; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=fxgNwbguzm19mxOl+d1yMzx0FAgO/SMJ+Tt1yKD0hgU=; b=Qr98k0yOx1r9l0av8wZs8vCGw2a873vDWjVuiZmYNGk/0sT6xQpDZXxiA3n2lyRUJiAX2JJU2 ey+ReVrjCeIBnt8XHvJgxHwm+2DxkNFl3oVNTrA2o8Ezczi+7w9SWQ9 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 --- 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.50.1 From nobody Sat Oct 4 14:35:16 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 940063009EE; Fri, 15 Aug 2025 10:41:56 +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=1755254518; cv=none; b=Uumv8Uq+YQ1CF3yeBQWV83PnOakjW2R1zD7T5ks48NOZkbKOzxFsjWaSHo9nv1r3ytdNBgwfzS4otaotGI9vBt3ippyUzBsjNEp3fR1Bcp+lsuxYEo7ChR+uwpJHfHRo+qQPNa60B2iOPb+fGhUt278cv73dZcyA3qfo0JvdiiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254518; c=relaxed/simple; bh=AINOaxBuP5Ch3/2w2tbR7UDCA6saGXXKtrrH821ccA0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dL/tXvYwq7YA+yzGuWmmflM5TKaOnMvVJAPyi76B/E/bbULnss0BsiwqnCakfe0XFoco6L658dsy03SsA6SaQeAZA7OCGH+enLQQQO7Dp66ND3cBk5yEL6sOfXurkFMHC5weHtn78huZZ4bwzP401ww/o/Nn9a2Y/zmCx7EwtEc= 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=d5UBW8a7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qFzyUqXz; 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="d5UBW8a7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qFzyUqXz" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254515; 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=p3StxZg3wmTP4B25eUsgepw4UWcf1hLlH7xU6a+2F/k=; b=d5UBW8a7wShWkX6durmn/CuIHyYbNfdxCyh+IqFYQB+6pETdxCUmEgNxnjfHxAA4VtZb+b IXnzpiU8EZevoALiEYifymveigUG2k6vWe6cnu58txR35Hp2gocnBLACmvoDEVg2HxYvvr 6kXvnXMkxLAv7h4FxIuGTn+PWSkPNoxqgHwPDrdNh7M8kd2x6eMUNO4FGn8YdsrLG6cZnr IeNL56DthZhlKrW0Iw37u0GNhSF/g/BxbkrSpQbd5k/Symuq9KGr+ZQFcLr+zWolpPhcDo 0hTaUdBTpDBP+NTKtSJr1XndXiw1/Vi86nx9VH4oPg5Lz25xkUsJR5+BvbmCYQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254515; 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=p3StxZg3wmTP4B25eUsgepw4UWcf1hLlH7xU6a+2F/k=; b=qFzyUqXzZb5Olxw5BtauIwwp7UKx69nM/guirCNmvlw1mqQRxdjerFrdEG+Ouod5yGtc4z HoZUHzuRFsGdpcDg== Date: Fri, 15 Aug 2025 12:41:19 +0200 Subject: [PATCH v2 10/13] 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: <20250815-vdso-sparc64-generic-2-v2-10-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=3432; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=AINOaxBuP5Ch3/2w2tbR7UDCA6saGXXKtrrH821ccA0=; b=2Pmj9kFveft4Z3odgxK2smbl+8Tb5fJ19ALPpH5ZfwdYSXe8Noq57SbhdhIvUW67qfBnfpTai 3ZEsTekkvC2B1V1ovUAk/l/c2Tu7nxN2lpRalORyMeZ2ZYPgyyT6ESu 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 --- 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.50.1 From nobody Sat Oct 4 14:35:16 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 52580301023; Fri, 15 Aug 2025 10:41:57 +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=1755254519; cv=none; b=CDFPMMTyrb7JIX+b2azy82Jkw0aqS3xigu3SH02WFoqIyZTNOZ5bqRK3H9EdViBssiO7rCV/XHVg2K+EzLJliq2kArLgAXw7QDyqbaiqKkdEYLNV2O6qAvwjKJZg4Arv/CDgUFAe3zs5RRnBTj/FYfhwyEg2U0olpk2gcwIFDYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254519; c=relaxed/simple; bh=Y6M/Dc0FZBj80nG5zGFZobavKx7lhX9RB9UpQJ8f6Io=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jg0xsjtUYZlgcDbR/ITNRjCZt7Jd3C/oOOyr70yYX0pTOvWoGjfsKmBbHwv8w/5Rb+kyBwXSc0LDfcOzOu1yqBHLdW0VjIHl6tDwEAQvNgQ9TiHP1Lg/YZ0MHBu/03gzQw75irwIk19sQpwlo5Ju8y56oSwPYoTD36P28hGBDlY= 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=AG6/qdUe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TDPNY6w5; 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="AG6/qdUe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TDPNY6w5" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254515; 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=LXeyczDo9DH2kvMYh8pqbFFU0887oaxfqSrotCzP+To=; b=AG6/qdUeHbPRpiOhJhB3pF9+uCGdlLxTp3o3gRwGo9e6cdhKRcRWLx+ugL6Y54SjUDOkef tethOxGWSWgZjF2JDTCLCeMb31TLzs8c+/npbWrtLl6BqNASnHv2aXVJjBDCCsHxRYujn5 HOisFsuO5OVRR0XWJvW586ntzX9VnVeq/cL4/fUXAIZLOTLoJuU4ECYxz6vWqd7nXWsb9d JTi3wxM+3H7RighHPBa7pj0mqKiVy6FLPF9GrZvws4+jLYOTWOQ0UdIMaAVh0cHnKzMG/c qpIhJhSLNW4f4PSIq8ttDQldQzYlDGeTmvZz5EoyaCFgva/OZJhu3zFnAG+GoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254515; 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=LXeyczDo9DH2kvMYh8pqbFFU0887oaxfqSrotCzP+To=; b=TDPNY6w5eBaxwA7pMzjYMYY+pgxTihW9WBv+aEIN+kXLqJKLtLM+omxvJ+qbEFGpdx8Wc3 Mw/b2jcccJboqxCg== Date: Fri, 15 Aug 2025 12:41:20 +0200 Subject: [PATCH v2 11/13] 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: <20250815-vdso-sparc64-generic-2-v2-11-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=1520; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Y6M/Dc0FZBj80nG5zGFZobavKx7lhX9RB9UpQJ8f6Io=; b=h00SjD4sg252eVHb0naX+rH8K0ZoJ5Hnrzd8a7b/c3Sgj9c5w56Ar5mp1S1uxTPopdN/e5XWv r4Y8s+r7HjWBCu3it90USdykoKyag1YCSb8BHYdk8tkYrb6dT+IL1Y/ 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 --- arch/sparc/vdso/vclock_gettime.c | 8 ++++++++ arch/sparc/vdso/vdso32/vdso32.lds.S | 2 ++ 2 files changed, 10 insertions(+) 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.50.1 From nobody Sat Oct 4 14:35:16 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 69A5B301031; Fri, 15 Aug 2025 10:41:57 +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=1755254519; cv=none; b=clh20uSxMZVIfp/ozsys2tiL6jTK4Nvy4e3O67IhGvntffZ4DUQuun9J3Cw8J06Gp9624crPBnDndYVhfSx6058M1xcsXYToxq2tggsPtsSiLiTYb5ALdQP38yvPRUjW9ZllsKlSwi7YjEuwoCiN0b7GjVuX4Xyv4U1vgOb3GKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254519; c=relaxed/simple; bh=Ngyyb+Tb2Eq2g4xCY2ap8PjPAMUoe2Wil/Ab9l88uDQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FEk0Ajsz/V81NsCgK76gs1g7dza3dJx6zJTABHtCWgrHgpygOZPz3Y7xQxsjY1Ae2JSgJJBuNx8hgHjWT4cHkvJ20pWKzjHyTPGeOae7i3lPTmqRyXQagVX6hP1KaIrfzCRAPMHHESUR0TO40BqMmptcIN56UAlSl577ajPqsOs= 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=srwTCiqh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NdXnOEW9; 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="srwTCiqh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NdXnOEW9" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254516; 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=MDoH1wg/PXmaaRjwmjbwG1Ox0g1S4AGQYYgSu/bm36Q=; b=srwTCiqhy2js5exRe7LeLCcdYss9U3z6/DyxiVfmvLmIe2Pz8heXuFeWGqFuW0jkSIPQ4+ gaduylLBJmTzTsvembDuVrEhwWgr34jGzcTnqzgS8pViBD41Rx6/9EaIYwLc2wmlECBUFd z34f+qAtDo8sEcyn7uJ8L95J4NuiEji5RXrc/8rvmN/yDjgXpb1WQHggmsdef+rWgggFY0 /KWuLtBdwW1MxLeCxlCoeLis03tFnD09281lRNUIOcqr0/XCQY3769FbnM3ottuFSDFtn2 7q6LHx6V18lVuhi+uZ0Z97LK+JITTAhqxX9f89jxVjj1Cgj3XH+Ac/POSh0VvA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254516; 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=MDoH1wg/PXmaaRjwmjbwG1Ox0g1S4AGQYYgSu/bm36Q=; b=NdXnOEW9mLnXJNdBQnJZkohhilbLDwmWs4xZ0asWmsCn4iAmVQWvZpn0WE2MYLffBup6TJ NjCMxE7vGnCachBw== Date: Fri, 15 Aug 2025 12:41:21 +0200 Subject: [PATCH v2 12/13] sparc64: vdso: Implement clock_getres() 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: <20250815-vdso-sparc64-generic-2-v2-12-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=4460; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Ngyyb+Tb2Eq2g4xCY2ap8PjPAMUoe2Wil/Ab9l88uDQ=; b=HdfQWWGnq8Yziooivb0IMMoSlqXmE7pUHH9zen2Q6AjqygKPsqZn0JMjJOjAoyw0CvnMqzmAk BxV3bi9ouSBBcpPLGgCUc80y013FtfoxX9Zj6dEUAVsAuIqdb5um3WR X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Add a vDSO fastpath for clock_getres(). Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/sparc/include/asm/vdso/gettimeofday.h | 42 ++++++++++++++++++++++++++= +++- arch/sparc/vdso/vclock_gettime.c | 16 ++++++++++++ arch/sparc/vdso/vdso.lds.S | 2 ++ arch/sparc/vdso/vdso32/vdso32.lds.S | 2 ++ 4 files changed, 61 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/vdso/gettimeofday.h b/arch/sparc/includ= e/asm/vdso/gettimeofday.h index a35875fba45470ba961a7df3ae52bc17d2a4a4a0..ccd2bda0a0c42ec826eb0464b7a= 41f98b4cea993 100644 --- a/arch/sparc/include/asm/vdso/gettimeofday.h +++ b/arch/sparc/include/asm/vdso/gettimeofday.h @@ -16,6 +16,8 @@ =20 #include =20 +#define VDSO_HAS_CLOCK_GETRES 1 + #ifdef CONFIG_SPARC64 static __always_inline u64 vread_tick(void) { @@ -125,7 +127,45 @@ long clock_gettime32_fallback(clockid_t clock, struct = old_timespec32 *ts) "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); return o0; } -#endif + +static __always_inline +long clock_getres_fallback(clockid_t clock, struct __kernel_timespec *ts) +{ + register long num __asm__("g1") =3D __NR_clock_getres_time64; + 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_getres32_fallback(clockid_t clock, struct old_timespec32 *ts) +{ + register long num __asm__("g1") =3D __NR_clock_getres; + 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; +} +#else /* !CONFIG_SPARC64 */ + +static __always_inline +long clock_getres_fallback(clockid_t clock, struct __kernel_timespec *ts) +{ + register long num __asm__("g1") =3D __NR_clock_getres; + 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; +} + +#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 1d9859392e4cfd285349cf9155ca1fc25d3a7b41..3cadf94e6cee5392586755e97f6= 29092d4bcab1e 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -38,6 +38,14 @@ int __vdso_clock_gettime(clockid_t clock, struct __kerne= l_timespec *ts) int clock_gettime(clockid_t, struct __kernel_timespec *) __weak __alias(__vdso_clock_gettime); =20 +int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res) +{ + return __cvdso_clock_getres(clock, res); +} + +int clock_getres(clockid_t, struct __kernel_timespec *) + __weak __alias(__vdso_clock_getres); + #else =20 int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts) @@ -56,4 +64,12 @@ int __vdso_clock_gettime64(clockid_t clock, struct __ker= nel_timespec *ts) int clock_gettime64(clockid_t, struct __kernel_timespec *) __weak __alias(__vdso_clock_gettime64); =20 +int __vdso_clock_getres(clockid_t clock, struct old_timespec32 *res) +{ + return __cvdso_clock_getres_time32(clock, res); +} + +int clock_getres(clockid_t, struct old_timespec32 *) + __weak __alias(__vdso_clock_getres); + #endif diff --git a/arch/sparc/vdso/vdso.lds.S b/arch/sparc/vdso/vdso.lds.S index f3caa29a331c58175b67ea60d7ac15cd467fe5ff..67c64a3adfa94f61356ce11081d= f442c18d6d8d5 100644 --- a/arch/sparc/vdso/vdso.lds.S +++ b/arch/sparc/vdso/vdso.lds.S @@ -20,6 +20,8 @@ VERSION { __vdso_clock_gettime; gettimeofday; __vdso_gettimeofday; + clock_getres; + __vdso_clock_getres; local: *; }; } diff --git a/arch/sparc/vdso/vdso32/vdso32.lds.S b/arch/sparc/vdso/vdso32/v= dso32.lds.S index a14e4f77e6f2222b855df27cc7a0d0a4f98bd4ac..d09b1893ee1411f450df935335e= 6fe8d8c8b2632 100644 --- a/arch/sparc/vdso/vdso32/vdso32.lds.S +++ b/arch/sparc/vdso/vdso32/vdso32.lds.S @@ -21,6 +21,8 @@ VERSION { __vdso_clock_gettime64; gettimeofday; __vdso_gettimeofday; + clock_getres; + __vdso_clock_getres; local: *; }; } --=20 2.50.1 From nobody Sat Oct 4 14:35:16 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 0C39D301477; Fri, 15 Aug 2025 10:41:58 +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=1755254519; cv=none; b=qAyijpcRkP9Dul3HQ6oS5lP5xC57e1grLGUeW6nwwcJ+IqR2zPu/FCGo7UixzBYoerNumTPKJ2vbpq7yYXcY48ZO2Ut1VAnhLehimeH/T9bcHNuHgEp24XGwbodcp0jmNrBFhygJD39lTvyKljSfGHDFRT0GJ4vPMk19fsKbfZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755254519; c=relaxed/simple; bh=iHrvFGNV5NlPwOHT9CAH917OiIs5mQw1vNrE9YUQ/ok=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UNxPKNh0ZU3hzBjTDWr+RkhSld/247WqvzxZlNeDZvFzYVxZp+STnJmLxB0YYV3JrHnosmamPBBmSdUK9e3xR60ZQ6Lu/awBxQTZnqSIqTVGVMrI072P6p6Tr5zmyusVFplI4DvP4RRvbzdz+cHx3+7LDrYsfPMRO3hzu7nFhHE= 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=jCHRahLW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9YY/99n0; 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="jCHRahLW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9YY/99n0" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1755254516; 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=9yFTisLxg3YqCYd6Iv5ovY8EeuzCRvAqVAjys88/tuc=; b=jCHRahLWCtRFepyca5LqX2O3SUrqu/tQbJxN/NdNXEslRAvVcpIsszrvn3U76QLqnQj96e gwJvhwzMOTluDd1m8nd3aytqEWLIXB1+0SWO7Wnzpg5xlHCNntrXRIfr1V2NhqDRCxrPIW QZrOpf8WnaDtteKH5Wb2d2wGfc2iYeaoqvk/CYcNZIyDQybz687dIWlgbDmRQ07fB0SAKp hUHDuEl/XEe7x/+QD7r5yF4vZ1d7hQDwAg6K7sanFTJb5b8Y9KEJIMhW5Dbf24h1CcRzkC GJDKUKG+BPczVT4I/XapSETs3bYLtGLy6oh/Kj11xRvMqPSbOhUHb8xkTJgtcw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1755254516; 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=9yFTisLxg3YqCYd6Iv5ovY8EeuzCRvAqVAjys88/tuc=; b=9YY/99n0W6sNmpwc3TeddgOLiuaG4OvcuDx4nMKmgaUYhC9TZn2czdKyiuoUPAcFTf4eX0 yduHt695gCO24UDg== Date: Fri, 15 Aug 2025 12:41:22 +0200 Subject: [PATCH v2 13/13] 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: <20250815-vdso-sparc64-generic-2-v2-13-b5ff80672347@linutronix.de> References: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> In-Reply-To: <20250815-vdso-sparc64-generic-2-v2-0-b5ff80672347@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Arnd Bergmann , "David S. Miller" , Andreas Larsson , Nagarathnam Muthusamy , Nick Alcock , John Stultz , Stephen Boyd , John Paul Adrian Glaubitz Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1755254507; l=1684; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=aSf9Jd5/ve0wXQ2JEfqCZQGKHbjrs6wOtqje+1SHbKU=; b=E1tDHEJDznZ0Dv1wdoHRpvGZUUSSSujH8rW9k/M1oxXMvWz/iNs45xZTzIQzr6j3OGe/9Ayru STXG3w4JLGSAyR4zhRNHuYHzf75v2f/kyOfTjtJ2yr1RBZwTRrKky3z 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 --- 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.50.1