From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0469D175A79; Tue, 2 Jun 2026 21:33:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780435991; cv=none; b=LS8Ekhtdu+0GiKSL1QmT5jY4Vf/jtaDc38OodEfdiIAHXna968Z+PgM3/q8oNQHnhTnSDlFYkWzw4jAJ4TulIFHvHjWYXRtNidPJ0B82/KNkOfmOAWEsBWfrnWaNIWzLmM65eFKpSWRt6urdtq/OBa9ZkjkE4YsUg7vermtrjLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780435991; c=relaxed/simple; bh=rjmOVwjQeQBiLaQlxZ274XV9FIA1bzvyI9YY8XSJRLM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bjrldMzVZU4OerHEcfT2xenf8pkI+/YoERXTZlXB/FYAr4GjXUSvvmBX26gGfW2EpJSGzRQCObeJ8bj+LJswAwhQz40qmpwzHRUOdjdulc4q8j2WjnuGgJMDTDZrV5TcF+5wfJN/+4eZRTJent2mT5hkOs0pQI3EHF/nPmVBc2w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V9SFy076; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V9SFy076" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18EA21F00893; Tue, 2 Jun 2026 21:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780435990; bh=jdudOJL+raYR/P30MGb9StMfBGEfajIKmHJbLO4Ebr8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=V9SFy076bGKjitzQm68Krm+0Rj2oH6tD8ejVPMJ5I/uiNj2eELLvem5TBfWJhWS4Y TNxkpj0r0EocaKdfV56ca0uDZSuziD13GMeufrm1EkQYXl0dCfsFY9YyiesUFWhGHl UOin2nIqMxPo5V8Rma6DTTuqNFut73Fbsj1WZ4Fu1ANDORSyKssdikJ5woI/BNsu9l v2mM4MTf9qRrePcAHv2EQ+vCuYaejc3jfUE4bEVGTXMm0pKZaSeNx64p/NZBkyjPI+ qEcYTk0FOzw47y+XX7bp2LjYzzjiZ7m6ac/+kx2hpwt6249m/LIFyHVdITnIiP7Fe8 7BqzG0nolC9Cg== Date: Tue, 2 Jun 2026 14:33:08 -0700 From: Oliver Upton To: Andreas Grapentin Cc: Steffen Eiden , kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Alexander Gordeev , Arnd Bergmann , Catalin Marinas , Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Friedrich Welter , Gautam Gala , Hariharan Mari , Heiko Carstens , Hendrik Brueckner , Ilya Leoshkevich , Janosch Frank , Joey Gouly , Marc Zyngier , Nico Boehr , Nina Schoetterl-Glausch , Paolo Bonzini , Suzuki K Poulose , Sven Schnelle , Ulrich Weigand , Vasily Gorbik , Will Deacon , Zenghui Yu Subject: Re: [PATCH v1 15/26] s390: Add functions to query arm guest time Message-ID: References: <20260529155601.2927240-1-seiden@linux.ibm.com> <20260529155601.2927240-16-seiden@linux.ibm.com> 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=us-ascii Content-Disposition: inline In-Reply-To: Hi Andreas, On Tue, Jun 02, 2026 at 03:25:13PM +0200, Andreas Grapentin wrote: > On Jun 01 26, Oliver Upton wrote: > > > Add functions to convert between ARM guest time (LSB0) and s390 host > > > time (MSB0) using new ptff function codes. > > > > > > Co-developed-by: Nico Boehr > > > Signed-off-by: Nico Boehr > > > Signed-off-by: Steffen Eiden > > > --- > > > arch/s390/include/asm/timex.h | 49 +++++++++++++++++++++++++++++++++++ > > > arch/s390/kernel/time.c | 1 + > > > arch/s390/kvm/arm64/arm.c | 9 ++++++- > > > 3 files changed, 58 insertions(+), 1 deletion(-) > > > > > > diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h > > > index 49447b40f038..9ec22a28bbda 100644 > > > --- a/arch/s390/include/asm/timex.h > > > +++ b/arch/s390/include/asm/timex.h > > > @@ -99,6 +99,8 @@ extern unsigned char ptff_function_mask[16]; > > > #define PTFF_QSI 0x02 /* query steering information */ > > > #define PTFF_QPT 0x03 /* query physical clock */ > > > #define PTFF_QUI 0x04 /* query UTC information */ > > > +#define PTFF_QAGTO 0x10 /* query arm guest time offset */ > > > +#define PTFF_QAGPT 0x11 /* query arm guest physical time offset */ > > > > Are these analogous to CNTVOFF_EL2 and CNTPOFF_EL2? > > They are somewhat related -- we don't have the EL2 counter offset > registers, but we still need to virtualize the guest counters, so > instead we have to maintain the guest counter offset separately. > > However, to determine the correct guest counter offset, we are using > these new PTFF function codes to translate between the s390 and arm64 > architected counter domains. Thanks for clarifying, I was trying to figure out how these functions apply to the virtual and "physical" views of the counter inside the VM. -- Best, Oliver