linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Jianyong Wu (Arm Technology China)" <Jianyong.Wu@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"yangbo.lu@nxp.com" <yangbo.lu@nxp.com>,
	"john.stultz@linaro.org" <john.stultz@linaro.org>,
	"sean.j.christopherson@intel.com"
	<sean.j.christopherson@intel.com>,
	"maz@kernel.org" <maz@kernel.org>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"will@kernel.org" <will@kernel.org>,
	Suzuki Poulose <Suzuki.Poulose@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Steve Capper <Steve.Capper@arm.com>,
	"Kaly Xin (Arm Technology China)" <Kaly.Xin@arm.com>,
	"Justin He (Arm Technology China)" <Justin.He@arm.com>,
	nd <nd@arm.com>
Subject: RE: [PATCH v5 3/6] timekeeping: Add clocksource to system_time_snapshot
Date: Wed, 16 Oct 2019 12:23:37 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1910161218020.2046@nanos.tec.linutronix.de> (raw)
In-Reply-To: <HE1PR0801MB1676EC775B7BFA5FC7E4F9D5F4920@HE1PR0801MB1676.eurprd08.prod.outlook.com>

Jianyong,

On Wed, 16 Oct 2019, Jianyong Wu (Arm Technology China) wrote:

Please fix your mail client not to copy the full headers into the reply.

> > On Wed, 16 Oct 2019, Paolo Bonzini wrote:
> > > On 15/10/19 22:13, Thomas Gleixner wrote:
> > That's a completely different beast, really.
> > 
> > The clocksource pointer is handed in by the caller and the core code validates
> > if the clocksource is the same as the current system clocksource and not the
> > other way round.
> > 
> > So there is no need for getting that pointer from the core code because the
> > caller knows already which clocksource needs to be active to make.the whole
> > cross device timestamp correlation work. And in that case it's the callers
> > responsibility to ensure that the pointer is valid which is the case for the
> > current use cases.
> > 
> I thinks there is something misunderstanding of my patch. See patch 4/6,
> the reason why I add clocksource is that I want to check if the current
> clocksouce is arm_arch_counter in virt/kvm/arm/psci.c and nothing to do
> with get_device_system_crosststamp.

There is no misunderstanding at all. Your patch is broken in several ways
as I explained in detail.

> So I really need a mechanism to do that check.
> 
> Thanks
> Jianyong

So just by chance I scrolled further down and found more replies from
you. Please trim the reply properly and add your 'Thanks Jianyong' to the
end of the mail.
 
> > From your other reply:
> > 
> > > Why add a global id?  ARM can add it to archdata similar to how x86
> > > has vclock_mode.  But I still think the right thing to do is to
> > > include the full system_counterval_t in the result of
> > > ktime_get_snapshot.  (More in a second, feel free to reply to the other
> > email only).
> > 
> > No, the clocksource pointer is not going to be exposed as there is no
> > guarantee that it will be still around after the call returns.
> > 
> > It's not even guaranteed to be correct when the store happens in Wu's patch
> > simply because the store is done outside of the seqcount protected region.
> 
> Yeah, all of the elements in system_time_snapshot should be captured in
> consistency. So I think the consistency will be guaranteed if the store
> ops added in the seqcount region.

Again. While it is consistent in terms of storage, it's still wrong to
expose a pointer to something which has no life time guarantee. Even if
your use case is just to compare the pointer it's a bad idea to do that
especially without any comment about the pointer validity at all.

Thanks,

	tglx

  reply	other threads:[~2019-10-16 10:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 10:48 [RFC PATCH v5 0/6] Enable ptp_kvm for arm64 Jianyong Wu
2019-10-15 10:48 ` [PATCH v5 1/6] psci: Export psci_ops.conduit symbol as modules will use it Jianyong Wu
2019-10-15 17:24   ` Mark Rutland
2019-10-16  3:54     ` Jianyong Wu (Arm Technology China)
2019-10-15 10:48 ` [PATCH v5 2/6] ptp: Reorganize ptp_kvm modules to make it arch-independent Jianyong Wu
2019-10-16  7:10   ` Paolo Bonzini
2019-10-16 10:04     ` Jianyong Wu (Arm Technology China)
2019-10-15 10:48 ` [PATCH v5 3/6] timekeeping: Add clocksource to system_time_snapshot Jianyong Wu
2019-10-15 16:37   ` Paolo Bonzini
2019-10-15 20:13     ` Thomas Gleixner
2019-10-15 22:36       ` Paolo Bonzini
2019-10-16  7:28         ` Thomas Gleixner
2019-10-16  9:48           ` Jianyong Wu (Arm Technology China)
2019-10-16 10:23             ` Thomas Gleixner [this message]
2019-10-15 20:12   ` Thomas Gleixner
2019-10-15 22:35     ` Paolo Bonzini
2019-10-16 10:01     ` Jianyong Wu (Arm Technology China)
2019-10-16 10:26       ` Thomas Gleixner
2019-10-15 10:48 ` [PATCH v5 4/6] psci: Add hvc call service for ptp_kvm Jianyong Wu
2019-10-16  7:24   ` Paolo Bonzini
2019-10-16  7:31     ` Thomas Gleixner
2019-10-16  7:42       ` Paolo Bonzini
2019-10-16 10:20     ` Jianyong Wu (Arm Technology China)
2019-10-15 10:48 ` [PATCH v5 5/6] ptp: arm64: Enable ptp_kvm for arm64 Jianyong Wu
2019-10-15 16:39   ` Paolo Bonzini
2019-10-16  3:52     ` Jianyong Wu (Arm Technology China)
2019-10-16  7:10       ` Paolo Bonzini
2019-10-16  7:13         ` Paolo Bonzini
2019-10-16 10:11           ` Jianyong Wu (Arm Technology China)
2019-10-15 10:48 ` [PATCH v5 6/6] kvm: arm64: Add capability check extension for ptp_kvm Jianyong Wu

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=alpine.DEB.2.21.1910161218020.2046@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=Jianyong.Wu@arm.com \
    --cc=Justin.He@arm.com \
    --cc=Kaly.Xin@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Steve.Capper@arm.com \
    --cc=Suzuki.Poulose@arm.com \
    --cc=john.stultz@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=nd@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=will@kernel.org \
    --cc=yangbo.lu@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).