All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hilber <peter.hilber@opensynergy.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	kvmarm@lists.linux.dev
Cc: Peter Hilber <peter.hilber@opensynergy.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
	John Stultz <jstultz@google.com>,
	netdev@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	x86@kernel.org, Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Sean Christopherson <seanjc@google.com>
Subject: [RFC PATCH 0/4] treewide: Use clocksource id for get_device_system_crosststamp()
Date: Fri, 18 Aug 2023 03:12:51 +0200	[thread overview]
Message-ID: <20230818011256.211078-1-peter.hilber@opensynergy.com> (raw)

This patch series changes struct system_counterval_t to identify the
clocksource through enum clocksource_ids, rather than through struct
clocksource *. The net effect of the patch series is that
get_device_system_crosststamp() callers can supply clocksource ids instead
of clocksource pointers, which can be problematic to get hold of.

For this, modify some code which is relevant to
get_device_system_crosststamp(), in timekeeping, ptp/kvm, x86/kvm, and
x86/tsc.

The series does the following: First, introduce clocksource ids for x86 TSC
and kvm-clock. Then, refactor the x86 TSC a tiny bit to keep changes in the
last, "treewide" patch to a minimum. In the treewide patch, replace
system_counterval_t.cs by .cs_id.

This series should not alter any behavior. Out of the existing
get_device_system_crosststamp() users, only ptp_kvm has been tested (on
x86-64 and arm64). This series is a prerequisite for the virtio_rtc driver
(RFC v2 to be posted). Through this series, virtio_rtc can work without
modifying arm_arch_timer.


Peter Hilber (4):
  x86/tsc: Add clocksource ids for TSC and early TSC
  x86/kvm: Add clocksource id for kvm-clock
  x86/tsc: Use bool, not pointer, for ART availability
  treewide: Use clocksource id for struct system_counterval_t

 arch/x86/kernel/kvmclock.c      |  2 ++
 arch/x86/kernel/tsc.c           | 23 +++++++++++++++--------
 drivers/ptp/ptp_kvm_common.c    |  3 ++-
 include/linux/clocksource_ids.h |  3 +++
 include/linux/timekeeping.h     |  4 ++--
 kernel/time/timekeeping.c       |  3 ++-
 6 files changed, 26 insertions(+), 12 deletions(-)


base-commit: 47762f08697484cf0c2f2904b8c52375ed26c8cb
-- 
2.39.2


             reply	other threads:[~2023-08-18  1:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  1:12 Peter Hilber [this message]
2023-08-18  1:12 ` [RFC PATCH 1/4] x86/tsc: Add clocksource ids for TSC and early TSC Peter Hilber
2023-08-18  1:12 ` [RFC PATCH 2/4] x86/kvm: Add clocksource id for kvm-clock Peter Hilber
2023-08-18  1:12 ` [RFC PATCH 3/4] x86/tsc: Use bool, not pointer, for ART availability Peter Hilber
2023-08-18  1:12 ` [RFC PATCH 4/4] treewide: Use clocksource id for struct system_counterval_t Peter Hilber
2023-09-15 13:30   ` Thomas Gleixner
2023-09-15 14:29     ` Peter Hilber
2023-08-25  4:18 ` [RFC PATCH 0/4] treewide: Use clocksource id for get_device_system_crosststamp() John Stultz
2023-09-13  9:10   ` Peter Hilber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230818011256.211078-1-peter.hilber@opensynergy.com \
    --to=peter.hilber@opensynergy.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jstultz@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sboyd@kernel.org \
    --cc=seanjc@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.