From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10D2FC02198 for ; Fri, 14 Feb 2025 11:34:59 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4YvVMk2Rm2z30Tk; Fri, 14 Feb 2025 22:34:58 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1739532898; cv=none; b=IWO6GFpV+toeIm8zr7qXQHRj1wW/NNHKr2F3pgiYcmB70fHo0CiBqVkyAvV/MTojvEPOegX0XugQg+8TyoIDf5Evvkz1k4WKAVDj1fvF6ZkzYoqSSBeP//JuyjCyVaB3H8WIJahMMRj9NILCiC0biku+WeXql1fF3uXIJ2d6NGwZzfSDTi2T7Z0jNhVzw8be9Mmt168y3VbBb4a6oUoBGkT7wW/yt6rX1LpdODDcjSPzZfWEvrIUI7530SqRRzGjkvGxIlNyRGS9dytzhSdexh7zan4xWsWKI2NpNOVBTyAzDoMZDmrYT6HdZRWKgRBHKcLyEX1MgUtf/hTD6mM2DQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1739532898; c=relaxed/relaxed; bh=WWdSDqLPiHMtkC3qRBjEr7KgW5xesCDv6jmHPBIB4Zc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ETy1frWBhi05+cmgf5jfF8lklX56QWFTRQ5G4L1Snp3/uk4ySPM/TRADKH2I6klbbSQtrarHA0EcEbDVVfp1Ky+UTLOkjY+2JaehC8ANY+g4eSMnwHIHC7gZliQOxTa+WZJRELn5Gs2ThKzP3emjMZPBI4ejA+UctOXObrTnI0xzga4TwOn1K6F1iqLasTQDLn57iRuyAd4HW5z3mB4groWjJLlep7aQ/vn/riI5hEpevtKmmfxUcFRSJaDH0Yju4sVRE5HKaais7PkMuXqR5uUNkP3NJoFsVftjZ5bvauZHv2rrlYhIcfC3En4AZ7tHBb/QQzPdFR0p1siyGawSWg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=0VNtTEYh; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=WFnwPIfj; dkim-atps=neutral; spf=pass (client-ip=193.142.43.55; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=lists.ozlabs.org) smtp.mailfrom=linutronix.de Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=0VNtTEYh; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=WFnwPIfj; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linutronix.de (client-ip=193.142.43.55; helo=galois.linutronix.de; envelope-from=tglx@linutronix.de; receiver=lists.ozlabs.org) Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4YvVMj3XMBz30Gq for ; Fri, 14 Feb 2025 22:34:57 +1100 (AEDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1739532886; 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=WWdSDqLPiHMtkC3qRBjEr7KgW5xesCDv6jmHPBIB4Zc=; b=0VNtTEYhNZqymGENVsUmuk+rnlFfX7RSGT3Ho51Jzxq38FSlmeIElqqU148QkLgRvvbxMF oARriYR4RFpth96NjMkBo5hNBkelucCuzn5JwatniL1M08uy4SKjyhCAdV/qdQ/eba99LI XiEfVSgYOnLLjTtprHlvawcrkXxeqR+m8TpQcRwp+J+sEstFenL0586F5ak1q3mLy7LV6n qnrektVapcPsyxUDFZn8atapF68IW+EhNarZoqS+FgcZ3nF1GslRp9zthgkNswbWYfqivE 2J78e9sNA7ZDPletmeb/HsB02wyQreu92A/Zp2E3TtpGj+8SwnWuzKOp2Uz71Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1739532886; 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=WWdSDqLPiHMtkC3qRBjEr7KgW5xesCDv6jmHPBIB4Zc=; b=WFnwPIfjvhMmBrrfQwvQ/cPdgZnaXQkJD4fxKY5hU7USn1NEKaf7iB28bu/zo8sPSUnwBx KGOlqDpRoCYGNWAw== To: David Woodhouse , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= , "James E.J. Bottomley" , Helge Deller , Andy Lutomirski , Vincenzo Frascino , Anna-Maria Behnsen , Frederic Weisbecker , Andrew Morton , Catalin Marinas , Will Deacon , Theodore Ts'o , "Jason A. Donenfeld" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Huacai Chen , WANG Xuerui , Russell King , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Bogendoerfer , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Arnd Bergmann , Guo Ren Cc: linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, loongarch@lists.linux.dev, linux-s390@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arch@vger.kernel.org, Nam Cao , linux-csky@vger.kernel.org, "Ridoux, Julien" , "Luu, Ryan" , kvm Subject: Re: [PATCH v3 00/18] vDSO: Introduce generic data storage In-Reply-To: References: <20250204-vdso-store-rng-v3-0-13a4669dfc8c@linutronix.de> Date: Fri, 14 Feb 2025 12:34:44 +0100 Message-ID: <87ed00kbe3.ffs@tglx> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable David! On Thu, Feb 06 2025 at 09:31, David Woodhouse wrote: > Thanks for working on this. Is there a plan to expose the time data > directly to userspace in a form which is usable *other* than by > function calls which get the value of the clock at a given moment? > > For populating the vmclock device=C2=B9 we need to know the actual > relationship between the hardware counter (TSC, arch timer, etc.) and > real time in order to propagate that to the guest. > > I see two options for doing this: > > 1. Via userspace, exposing the vdso time data (and a notification when > it changes?) and letting the userspace VMM populate the vmclock. > This is complex for x86 because of TSC scaling; in fact userspace > doesn't currently know the precise scaling from host to guest TSC > so we'd have to be able to extract that from KVM. Exposing the raw data is not going to happen as we would create an ABI preventing any modifications to the internals. VDSO data is considered a fully internal (think kernel) representation and the accessor functions create an ABI around it. So if at all you can add a accessor function which exposes data to user space so that the internal data representation can still be modified as necessary. > 2. In kernel, asking KVM to populate the vmclock structure much like > it does other pvclocks shared with the guest. KVM/x86 already uses > pvclock_gtod_register_notifier() to hook changes; should we expand > on that? The problem with that notifier is that it seems to be > called far more frequently than I'd expect. It's called once per tick to expose the continous updates to the conversion factors and related internal data. Thanks, tglx