lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 15 Nov 2019 08:24:32 +0000
From:   "Jianyong Wu (Arm Technology China)" <Jianyong.Wu@....com>
To:     Thomas Gleixner <tglx@...utronix.de>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "yangbo.lu@....com" <yangbo.lu@....com>,
        "john.stultz@...aro.org" <john.stultz@...aro.org>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
        "maz@...nel.org" <maz@...nel.org>,
        "richardcochran@...il.com" <richardcochran@...il.com>,
        Mark Rutland <Mark.Rutland@....com>,
        "will@...nel.org" <will@...nel.org>,
        Suzuki Poulose <Suzuki.Poulose@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        Steve Capper <Steve.Capper@....com>,
        "Kaly Xin (Arm Technology China)" <Kaly.Xin@....com>,
        "Justin He (Arm Technology China)" <Justin.He@....com>,
        nd <nd@....com>
Subject: RE: [RFC PATCH v7 4/7] time: Add mechanism to recognize clocksource
 in time_get_snapshot

Hi tglx,

> -----Original Message-----
> From: Thomas Gleixner <tglx@...utronix.de>
> Sent: Thursday, November 14, 2019 10:19 PM
> To: Jianyong Wu (Arm Technology China) <Jianyong.Wu@....com>
> Cc: netdev@...r.kernel.org; yangbo.lu@....com; john.stultz@...aro.org;
> pbonzini@...hat.com; sean.j.christopherson@...el.com; maz@...nel.org;
> richardcochran@...il.com; Mark Rutland <Mark.Rutland@....com>;
> will@...nel.org; Suzuki Poulose <Suzuki.Poulose@....com>; linux-
> kernel@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> kvmarm@...ts.cs.columbia.edu; kvm@...r.kernel.org; Steve Capper
> <Steve.Capper@....com>; Kaly Xin (Arm Technology China)
> <Kaly.Xin@....com>; Justin He (Arm Technology China)
> <Justin.He@....com>; nd <nd@....com>
> Subject: Re: [RFC PATCH v7 4/7] time: Add mechanism to recognize
> clocksource in time_get_snapshot
> 
> On Thu, 14 Nov 2019, Jianyong Wu wrote:
> > From: Thomas Gleixner <tglx@...utronix.de> In some scenario like
> > return device time to ptp_kvm guest, we need identify the current
> > clocksource outside core time code.
> > A mechanism added to recognize the current clocksource by export
> > clocksource id in time_get_snapshot.
> 
> Can you please replace that with the following:
> 
>  System time snapshots are not conveying information about the current
> clocksource which was used, but callers like the PTP KVM guest
> implementation have the requirement to evaluate the clocksource type to
> select the appropriate mechanism.
> 
>  Introduce a clocksource id field in struct clocksource which is by default  set
> to CSID_GENERIC (0). Clocksource implementations can set that field to  a
> value which allows to identify the clocksource.
> 
>  Store the clocksource id of the current clocksource in the
> system_time_snapshot so callers can evaluate which clocksource was used
> to  take the snapshot and act accordingly.
> 

Ok, really better.

> > diff --git a/include/linux/clocksource_ids.h
> > b/include/linux/clocksource_ids.h new file mode 100644 index
> > 000000000000..93bec8426c44
> > --- /dev/null
> > +++ b/include/linux/clocksource_ids.h
> > @@ -0,0 +1,13 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef
> > +_LINUX_CLOCKSOURCE_IDS_H #define _LINUX_CLOCKSOURCE_IDS_H
> > +
> > +/* Enum to give clocksources a unique identifier */ enum
> > +clocksource_ids {
> > +	CSID_GENERIC		= 0,
> > +	CSID_ARM_ARCH_COUNTER,
> 
> This should only add the infrastructure with just CSID_GENERIC in place.
> 
> The ARM_ARCH variant needs to come in a seperate patch which adds the
> enum and uses it in the corresponding driver. Seperate means a patch doing
> only that and nothing else, i.e. not hidden in some other patch which actually
> makes use of it.
> 

Yeah, this patch should be arch independent and "CSID_ARM_ARCH_COUNTER" should be in an
Separate patch.

Thanks
Jianyong

Thanks
> Thanks,
> 
> 	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ