From mboxrd@z Thu Jan 1 00:00:00 1970 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 E724548A2AA; Tue, 7 Jul 2026 21:54:59 +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=1783461306; cv=none; b=bv8ROilw6SdSnbemNRqUqWrueffv7Nyga/5muEHII7JH9ygqo4MR0vmsthI5D2iXfVWMRziXHVJ9+It3iHhe6ghKqboid0m2v/EYYSoJ5TJgRF/wVfVNCyeutYtG4tvkHlaqWiZ2eNjS/oSnvVOMJgz6RcK0k2nE/+a32Nj1ieY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783461306; c=relaxed/simple; bh=miuePuFtTMqbDjEQ6h+LbaubSmaAJY+wVsG67fvECFA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=OrGQxAeFi0JKobGEdeD4yKSugGg1B/YfqMQIxtJmVePtrGnlzr0YG6cpJZpNZA+WC0OL22BUwNgTGNUejFANQso0TG68ol+DO57OtzAg4M7gCEjE3dPsnfP+A9PfEjkGK+lEKX4WJh0dKMFvUb1tRmFTPqT3kPjnn2vnC2VPckc= 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=ZHMsCZsU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Fppa86r3; 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="ZHMsCZsU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Fppa86r3" Date: Tue, 07 Jul 2026 21:54:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783461297; h=from:from:sender:sender:reply-to: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=cfzqRzi5bwFt3BER9SY++AvLWS6w6qpNI6B5eDr/Hug=; b=ZHMsCZsU5NoU0H6fifsDEDTMxBSQpElVeVNXW5TVDRl5uzEDsc6JLl3pdMId6qyNnrH0S+ GHwOZFlXbISajT1OllPWTqFZOQfGTrk6dlFEKNtlnH1EEmnAnLI6hVhOTuxr15ZEucOvcR 19GHkKOfdCjNk81xsqzGHKs+mWs3yu0s60u58LS8RQjVRcB14+0qUBwL4SMjXQol1xyD6N A9P5WLS1jN5K6Hv2TgM/27DV5y3B8Ssv8UY3kCoKFHZGKxbbUkABvlchS7OPlGFJ3ODwNF etPGtPWhRVEy1f6OX+ThWEAFRgALZBLqKPEgCU1z/7OeTcqmY0c6FG072Ux5mw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783461297; h=from:from:sender:sender:reply-to: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=cfzqRzi5bwFt3BER9SY++AvLWS6w6qpNI6B5eDr/Hug=; b=Fppa86r3rrI0eMN+uwWhaoGYpW8EwnuOof9v0AOWOZXgU8vWUTNaSx/ZHgSK2gMSEu46a9 c1u4MLvMQsmlP7Ag== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/vdso] vdso/datastore: Map pages in terms of the faults pgoff Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , Nam Cao , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260630-vdso-mlockall-v4-2-6c93708ce723@linutronix.de> References: <20260630-vdso-mlockall-v4-2-6c93708ce723@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178346129545.744054.9115120529110644248.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/vdso branch of tip: Commit-ID: 7557273419dd618df6d83ed37449b0e5918fd501 Gitweb: https://git.kernel.org/tip/7557273419dd618df6d83ed37449b0e5918= fd501 Author: Thomas Wei=C3=9Fschuh AuthorDate: Tue, 30 Jun 2026 09:31:56 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 07 Jul 2026 23:52:52 +02:00 vdso/datastore: Map pages in terms of the faults pgoff To support mlockall() on the datapages the VMA can have no holes where inner pages return VM_FAULT_SIGBUS. An upcoming change will avoid these holes by mapping a zeroed pages into these holes. That logic will be simpler when the mapping logic is based on vmf->pgoff instead of the vdso_k_ symbols. Switch to the equivalent vmf->pgoff logic. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Gleixner Tested-by: Nam Cao Link: https://patch.msgid.link/20260630-vdso-mlockall-v4-2-6c93708ce723@linut= ronix.de --- lib/vdso/datastore.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/vdso/datastore.c b/lib/vdso/datastore.c index 7f78a32..e01db96 100644 --- a/lib/vdso/datastore.c +++ b/lib/vdso/datastore.c @@ -29,10 +29,11 @@ struct vdso_arch_data *vdso_k_arch_data __ro_after_init = =3D (void *)&vdso_initdata[VDSO_ARCH_PAGES_START * PAGE_SIZE]; #endif /* CONFIG_ARCH_HAS_VDSO_ARCH_DATA */ =20 +static struct page *vdso_data_pages __ro_after_init; + void __init vdso_setup_data_pages(void) { unsigned int order =3D get_order(VDSO_NR_PAGES * PAGE_SIZE); - struct page *vdso_data_pages; =20 /* * Allocate the data pages dynamically. SPARC does not support mapping @@ -67,13 +68,13 @@ static vm_fault_t vvar_fault(const struct vm_special_mapp= ing *sm, { struct page *page, *timens_page; =20 + page =3D vdso_data_pages + vmf->pgoff; timens_page =3D find_timens_vvar_page(vma); =20 switch (vmf->pgoff) { case VDSO_TIME_PAGE_OFFSET: if (!IS_ENABLED(CONFIG_GENERIC_GETTIMEOFDAY)) return VM_FAULT_SIGBUS; - page =3D virt_to_page(vdso_k_time_data); if (timens_page) { /* * Fault in VVAR page too, since it will be accessed @@ -99,17 +100,15 @@ static vm_fault_t vvar_fault(const struct vm_special_map= ping *sm, */ if (!IS_ENABLED(CONFIG_TIME_NS) || !timens_page) return VM_FAULT_SIGBUS; - page =3D virt_to_page(vdso_k_time_data); + page =3D vdso_data_pages + VDSO_TIME_PAGE_OFFSET; break; case VDSO_RNG_PAGE_OFFSET: if (!IS_ENABLED(CONFIG_VDSO_GETRANDOM)) return VM_FAULT_SIGBUS; - page =3D virt_to_page(vdso_k_rng_data); break; case VDSO_ARCH_PAGES_START ... VDSO_ARCH_PAGES_END: if (!IS_ENABLED(CONFIG_ARCH_HAS_VDSO_ARCH_DATA)) return VM_FAULT_SIGBUS; - page =3D virt_to_page(vdso_k_arch_data) + vmf->pgoff - VDSO_ARCH_PAGES_STA= RT; break; default: return VM_FAULT_SIGBUS;