Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3557757imm; Mon, 25 Jun 2018 00:09:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ4qVaqbOUfXxYhPWh7BcjjniQi0ZKOZOITmTWq1Bstf9eaVuq7zpcdWkWa6d24Z3x6c9zi X-Received: by 2002:a17:902:8601:: with SMTP id f1-v6mr10121276plo.196.1529910547720; Mon, 25 Jun 2018 00:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529910547; cv=none; d=google.com; s=arc-20160816; b=r9hZnffUSADxCOKmDqRZjY2D//sz9ET+rlPbSU6c0nTeJqrx0NnaYqO2Vxy2imFcVE icTJB7MMlkrB/jsqCuuSeZbIaFlrs3UzXkGMn2klZVWjtLp99Or9wxoZt9A4EC1OfnEq spbHWTCoOZBwDb1SwjiaRHpG8cr45v03J1Us6og7fSIRgi0TQiqq/Jsh2+vzHPYXoIbY LA08eSh7/5uXjkEDLja2vnKgiMuXB80mDU349uCwV7XI0uM3ObsgOjfmpD9KjaTf81dR ZX6d1LSvQft7uAn29wXnND9FbUmTwifIdvMn7nCbQ/TiKTUC3m0T9UNXpP3qhdJT+KCL EZ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :mime-version:references:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=BTQfCMjhr4Fnd/H4fkaCtFRABP6GGPZ7vmWDeju6w8Y=; b=j/lDwBRurKdploAXshy1fBQTajUGLLPtCYqKdg8mVVTCHt65ZoXvYQ2Znkvr/veZT3 yBQHB88jybUIIR1+U4iql/Wm+F+F0XWWskdujGQ/TdY94d+stXg/fJ6E0E6sZ5GOOK1D Ht+vDulfI8Kt65EEJvES4011Q0wMhniYNwwd4uuxQZgtHEB6s6jUPh32kYTJvjUiXEFR 8xvL0d/iHeXmKtkD41XQLEvg9E/ntSqRI5hlr9iZ+femKtkEn+gt3KOOl3RDJtgldy5+ DmY3JfJIpHKnIRwQkq2mgA7ES398mTX4GYW4yf0bW+mZiTjLIa1SJoo02kfxWrCHcfC3 FPzA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si3651442pgi.456.2018.06.25.00.08.53; Mon, 25 Jun 2018 00:09:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752156AbeFYHH4 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Jun 2018 03:07:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56534 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751238AbeFYHHy (ORCPT ); Mon, 25 Jun 2018 03:07:54 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5P74KQA075700 for ; Mon, 25 Jun 2018 03:07:54 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jtr6ky7w4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Jun 2018 03:07:53 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 25 Jun 2018 08:07:52 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 25 Jun 2018 08:07:46 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5P77j9829163570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Jun 2018 07:07:45 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5324A5204E; Mon, 25 Jun 2018 08:07:41 +0100 (BST) Received: from mschwideX1 (unknown [9.152.212.155]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id D49E65205A; Mon, 25 Jun 2018 08:07:40 +0100 (BST) Date: Mon, 25 Jun 2018 09:07:41 +0200 From: Martin Schwidefsky To: Pavel Tatashin Cc: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, 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, linux-s390@vger.kernel.org Subject: Re: [PATCH v12 05/11] s390/time: add read_persistent_wall_and_boot_offset() In-Reply-To: <20180621212518.19914-6-pasha.tatashin@oracle.com> References: <20180621212518.19914-1-pasha.tatashin@oracle.com> <20180621212518.19914-6-pasha.tatashin@oracle.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18062507-0008-0000-0000-0000024B6BF2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062507-0009-0000-0000-000021B1D528 Message-Id: <20180625090741.776c8914@mschwideX1> Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 8BIT X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-25_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806250084 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 21 Jun 2018 17:25:12 -0400 Pavel Tatashin wrote: > read_persistent_wall_and_boot_offset() will replace read_boot_clock64() > because on some architectures it is more convenient to read both sources > as one may depend on the other. For s390, implementation is the same > as read_boot_clock64() but also calling and returning value of > read_persistent_clock64() > > Signed-off-by: Pavel Tatashin > --- > arch/s390/kernel/time.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c > index cf561160ea88..d1f5447d5687 100644 > --- a/arch/s390/kernel/time.c > +++ b/arch/s390/kernel/time.c > @@ -221,6 +221,24 @@ void read_persistent_clock64(struct timespec64 *ts) > ext_to_timespec64(clk, ts); > } > > +void __init read_persistent_wall_and_boot_offset(struct timespec64 *wall_time, > + struct timespec64 *boot_offset) > +{ > + unsigned char clk[STORE_CLOCK_EXT_SIZE]; > + struct timespec64 boot_time; > + __u64 delta; > + > + delta = initial_leap_seconds + TOD_UNIX_EPOCH; > + memcpy(clk, tod_clock_base, STORE_CLOCK_EXT_SIZE); > + *(__u64 *)&clk[1] -= delta; > + if (*(__u64 *)&clk[1] > delta) > + clk[0]--; > + ext_to_timespec64(clk, &boot_time); > + > + read_persistent_clock64(wall_time); > + *boot_offset = timespec64_sub(*wall_time, boot_time); > +} > + > void read_boot_clock64(struct timespec64 *ts) > { > unsigned char clk[STORE_CLOCK_EXT_SIZE]; From a s390 standpoint this looks reasonable. Reviewed-by: Martin Schwidefsky -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.