Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3658659imm; Mon, 18 Jun 2018 01:43:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLD2IokixQOOPhtxH/DW+d1ZdlaAnTk7B0mQs/emLg6KVM5wlNzfPkgCF2VeMH3OoMzoNKx X-Received: by 2002:a63:6ac5:: with SMTP id f188-v6mr10080661pgc.195.1529311428993; Mon, 18 Jun 2018 01:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529311428; cv=none; d=google.com; s=arc-20160816; b=UI2lv65ewWTm74zkvRinUIBX/FbdbQGPwyWLJCDo+/0Za99vqXpd4cngBLlqKTRLdx KYykyeb6YZe1Bg3EKTJqooi8HckyU/Om7evh18Q0gPMKPEQO0xcj/yrnHIeBToD2PPsv QwZdzY8oEdDkw/joTduCCTEuBqvbjVpBWjUUxFeJL/GZDrzOZYEvVomXsdYw4Sy7bzSu Ua6yBensPrEhEeJqRFLm5tGLLwvtS3dQ1JFmgdzPobuUInIUR5uMoooPyjcqELIubfl2 aQwrV8QrOGpKPYcVyytEmVV7EkSnrmwxb+SJWLpdGAGjdAHvCO1n9yZ2/9D+S1qgmITs q6oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=6xzvdQYgdNWHHjI8T37oud0RsOEOFaDbifXIxHBrg7w=; b=TZID2Ac7H+3HAVvh4zYWWisV5HLXwrkqWuhJvATb/YoPO7MBpDbU/gWZoebvgIcxtq Eo3wjCQXvQeHYk4EJnNJiXod/yj8KaZhc4tIK7Axm9uHudWMNT+jh7rt6B5j/4Y3V1nv 8BB1VdxYkshDHpUkhaTfKdHR8LOUJN+XSoJkJ3KTiHAvZWul+O6uB9vlyyuRIJb5EIS3 T3c801HSuBSY6RrhMS5UOVUtuAK7/5NJrwoO5VlpW7vzlK5HhQ4gG45cD0ULXpZhl/jJ 224wNGGsXblqNQoLvNo7m3+HcYOSV+x063oEq1PI6BQ0vNQh8NkYS4/wzTB+oFTraPBf 3S+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uhVFWarO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4-v6si11703861pgc.550.2018.06.18.01.43.35; Mon, 18 Jun 2018 01:43:48 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uhVFWarO; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030448AbeFRImq (ORCPT + 99 others); Mon, 18 Jun 2018 04:42:46 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:38164 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030381AbeFRImm (ORCPT ); Mon, 18 Jun 2018 04:42:42 -0400 Received: by mail-vk0-f67.google.com with SMTP id b77-v6so9032332vkb.5 for ; Mon, 18 Jun 2018 01:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6xzvdQYgdNWHHjI8T37oud0RsOEOFaDbifXIxHBrg7w=; b=uhVFWarOoOAz+iINtowHerOcXH2f/upfezFEmEh1/a9J7WvmYgNwGRXbQqwv/mzF+I wCJy4hqBc9goeiM0xUEWSMOQMt0fPxtv+DeeTIknRj11UyF9Wm0MgqOJvtNYBnO0XmlG fEqoGwvAyK1yk3CorZ+TQLMFxHzcg3sI6bvIVVqZPn9puYSMlE7CFg52Y9ucwkMrhoEk c11bbpz3L5KK0a/Kjij2qNBPICtzYnwyRN0BTCkZIIyqr9mG0MzeuXBgQysHbVQEh6ws xcTnuNur190VlxhVVXSQvjnAFrBX7S7Y78ISPL3+2TYuHK3sMPTQddKDl2s8juD1z7eJ NMCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6xzvdQYgdNWHHjI8T37oud0RsOEOFaDbifXIxHBrg7w=; b=gXxFGC2ij1ZIvxEH4ArppneHXMu1XiQeHLmVwSTPJHOGpstgIOKiNGhjY5l3f1M6Or 6X5exNuFKFsFtUJOUlffKtDsI4Un3HSgfyjG1zY5Bn9Mk1jodgqnKmFtbMhMFOrLKQpA jl3F4rC1AY+opKUmYRVdhihDuZXJsWkW4zq3W7BFsGy2heEPMstLiRRYMOtZiOgMP1SC zvgxmcvV0vrcUAUheOl/yUl1+fBzsIIJ8ImqAJ5B2GSOiCsyBFo5Wpt8UxRGxYP+3S3P tcjo75X4jUsU7WrC1DoVrAtc0Z7CtLuaFb2J4BNdaBH+na7ZwCCHt2+nb1e3gPWnsO/C CDeQ== X-Gm-Message-State: APt69E0o5MMd9MQ2BCQUSg1vi7Ee+eKl745u+EcbI/7gH8u27jYjw+7W I/KdZBExns0uKU4jXFZL8Ymfj2xb+p+sYfYJ9Lw= X-Received: by 2002:a1f:8e0f:: with SMTP id q15-v6mr6953686vkd.161.1529311361997; Mon, 18 Jun 2018 01:42:41 -0700 (PDT) MIME-Version: 1.0 References: <20180615174204.30581-1-pasha.tatashin@oracle.com> <20180615174204.30581-4-pasha.tatashin@oracle.com> In-Reply-To: <20180615174204.30581-4-pasha.tatashin@oracle.com> From: Andy Shevchenko Date: Mon, 18 Jun 2018 11:42:30 +0300 Message-ID: Subject: Re: [PATCH v10 3/7] x86/time: read_boot_clock64() implementation To: pasha.tatashin@oracle.com Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 15, 2018 at 8:48 PM Pavel Tatashin wrote: > > read_boot_clock64() returns time of when system was started. Now, that > early boot clock is going to be available on x86 it is possible to > implement x86 specific version of read_boot_clock64() that takes advantage > of this new feature. > +void __init read_boot_clock64(struct timespec64 *now, struct timespec64 *ts) > +{ > + u64 ns_boot = sched_clock_cpu(smp_processor_id()); > + bool valid_clock; > + u64 ns_now; > + > + ns_now = timespec64_to_ns(now); > + valid_clock = ns_boot && timespec64_valid_strict(now) && > + (ns_now > ns_boot); > + > + if (!valid_clock) > + *ts = (struct timespec64){0, 0}; > + else > + *ts = ns_to_timespec64(ns_now - ns_boot); > +} -- With Best Regards, Andy Shevchenko