Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7337784ybp; Wed, 16 Oct 2019 07:21:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqylN2IDDzqIyGiP49aFiwgHB1bVcfxhnyZbYSpBq66Bj/ADzEErvz2D8llx5DbcvlC8DhuM X-Received: by 2002:a17:907:4090:: with SMTP id nt24mr3539496ejb.122.1571235700494; Wed, 16 Oct 2019 07:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571235700; cv=none; d=google.com; s=arc-20160816; b=OfDWRzbkLqzXqfT9vdGODC9f63ZWUq7U8Y7iqCsavj61fgtLGHLEpSzLcireNGes3d V3SBc9GHl2YWSg5dPwBSxE4QCY2sI4ei/DLNml5e3xk1doW2grDVASf9kmagJAcVsPm7 8CchoZ72qvn8BBA65NtEQ5T/5DuN3TOtv89ECBjD32LxLgwoFFoDDQCtvnjgUdGhJHh0 uyDSLahLu8PCHbvUnDeBXQhvfpeAvWkcK6qzvmRz7hDperVQdR1QQMk82N3bypp0VdsO VCdnizxQqdMXjS3H/7iBvk3FAVCBROmpBllhaiMKnLFqePSYMGAe7FFadJDuw5du5GWr IlCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=rqmx7qt2VNEmlwrnpVElBMDFuNrBIxYdY7wB8ZGMSH0=; b=tPxep+tX+GtUYzIlLm2YPIEcq20JkUT5zyfEbB/P840Wyg1jmyUUpt9xao4S6Xi9GW xUt7rEgCVjPrWfRWHC6Qcm/ocQC2xkdc/0fGcXLJLrns9OidP1WdGkihiTQ8uPw2LSyc uzYPn9jfdCxqYZOJ6WQ3M5tdRgOCNRKsg9uIZj3GoyXjWFM5mSvQXxXTsxXoDsBX5etC gV0mk06FwbNFZS7UtBfJf67j/EcCIUsuI/tFMwu3uxRt3BMrdfmGOVgJVGdeJwvlVnOC RyuwKS30dFoCIQDqQbmVa/+c35pezB+YJsaZjRwIu8Afv9qYMD+pSfmVawQ3r/m6lssv yFvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bq16si15615404ejb.221.2019.10.16.07.21.17; Wed, 16 Oct 2019 07:21:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392394AbfJPKXt (ORCPT + 99 others); Wed, 16 Oct 2019 06:23:49 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:49609 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbfJPKXt (ORCPT ); Wed, 16 Oct 2019 06:23:49 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iKgSw-0002ga-0Y; Wed, 16 Oct 2019 12:23:38 +0200 Date: Wed, 16 Oct 2019 12:23:37 +0200 (CEST) From: Thomas Gleixner To: "Jianyong Wu (Arm Technology China)" cc: Paolo Bonzini , "netdev@vger.kernel.org" , "yangbo.lu@nxp.com" , "john.stultz@linaro.org" , "sean.j.christopherson@intel.com" , "maz@kernel.org" , "richardcochran@gmail.com" , Mark Rutland , "will@kernel.org" , Suzuki Poulose , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , Steve Capper , "Kaly Xin (Arm Technology China)" , "Justin He (Arm Technology China)" , nd Subject: RE: [PATCH v5 3/6] timekeeping: Add clocksource to system_time_snapshot In-Reply-To: Message-ID: References: <20191015104822.13890-1-jianyong.wu@arm.com> <20191015104822.13890-4-jianyong.wu@arm.com> <9274d21c-2c43-2e0d-f086-6aaba3863603@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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