Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6384764ybe; Wed, 18 Sep 2019 02:34:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqze70Y1rMtJjX/31jHXYe9nrhjU0tW5UpnwPG3ab01xy4Rrc9lboBVCd4rCTe/JI9EU2uC+ X-Received: by 2002:aa7:c80e:: with SMTP id a14mr9149103edt.205.1568799271422; Wed, 18 Sep 2019 02:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568799271; cv=none; d=google.com; s=arc-20160816; b=KxvIk4StpoPf5mWRMKQniLjrgjbJ8CjrE61MOpYKTGEqzj4DyHYk25KOO8IMYuXrsg UYwlG23v30DRAyK3NJldlGLf/wQiLXZHeVw2SJ8+8exQNfiwpxYq6N3drVifjRsf2Z9G yCVkBBy4k2j7c4hyFP1zdNzIamZO64P9vH/nSx1HEygl/EgBr2AIX/Uccj9X3O6mMvsX 5HiEoDnA6SZhHLzOg0Ny6j98x5D6QKe8cN3wlBorLmCkb41dzR6xY4NWFEHKXhTJlCtQ skfKj+RKQrmERXLwZIBOOamDvc6lFdFxZ00BJoRUCiaFpry/5dycw2G3xYzdrfFE98t3 LGOw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject:dkim-signature; bh=sCvYaicCVH8OrDZlwsa8ICj82oK2Vn0GFjH/m8a0EOU=; b=1CZDh4kXS/xfc8TE8Ru3XW9s4ETOYTJvSfkaYhbPm0yr3wUSS4LlXVmIR+isy/Qubl CPcKF80vu/4TBohn9k5RW5E1efHVskMpy10l+Dky+n9/3uW1PluE1+TQ7GDBvXUJVnCP Wf3KSaIpBmk2nPGOkdp2pmHevImQg+zBgio88C6etXr7ucD2XB5DchGDekRCa8/KWO2r S7qXX2HMdOb5RFQI2Eo0pTu4+X18AChet1L6E9KoB3O5uMykf5w12cvMOa7ZZcGV83Fj mDhwwSKnartIwg/mTnoRkPyQ1WjuMXwnMqDT2FqZp08iPtzxvbiTfSHj04bRTjVHwDVW 8YXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MOzjZd6g; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si2815385edp.247.2019.09.18.02.34.08; Wed, 18 Sep 2019 02:34:31 -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=@redhat.com header.s=mimecast20190719 header.b=MOzjZd6g; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730248AbfIRIZn (ORCPT + 99 others); Wed, 18 Sep 2019 04:25:43 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:49618 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726131AbfIRIZm (ORCPT ); Wed, 18 Sep 2019 04:25:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1568795141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:openpgp; bh=sCvYaicCVH8OrDZlwsa8ICj82oK2Vn0GFjH/m8a0EOU=; b=MOzjZd6gVZGoeY1WWVJIKKivJSxdWUFjYfmmLqFQ14rgDQPNlrF6KFqFIiS1bIHesotMCr gG+PGQatrc99YHb9Wqg3PVq9Z0HEFvcat2C6T+nD3xhxTFQ1SWR4lXgHfgccQF73XjHfh/ B02GEbuRbMohxpZc5uO77G6QkrzVygw= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-108-vKroey6jNyqzEOugVbCelA-1; Wed, 18 Sep 2019 04:25:40 -0400 Received: by mail-wm1-f71.google.com with SMTP id g82so544774wmg.9 for ; Wed, 18 Sep 2019 01:25:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+0NSTxt+2cOn/cB86g2+fMxuM9WiNm6PL9JuEvNIK5M=; b=q54aa+E08NYZ8+2XUlMp6ATBrFg1HfmSnOw7oZlf35tw3Fk5IcCHyWSr/F9vQBpT02 /vjepgLNDtJmjcuU88rJyOgiBvy5Krqy27DB4xIH4jFlEcM3UG09K6qH3tFl9qW7ViX/ 4v5Qsdty7Aqv3JY0MoIDIt0VBYMtL3XNXFfFS/VPxdzFzO3u7m/aajnLMzSzpiWSW8e8 +ILr3t/iO0uk9tUgRo8EGvlVoRVkWa8oBCtNN4wXFnhiy0dxXTxvu14j4dIF7h7W/RyI LFNTE1ZnBOpbCs/XdYeGCkQgORuPLVTNqzrlCuQ9MyZpE3OBJ06RSMQXyYIQolTrgA4Z 7AlA== X-Gm-Message-State: APjAAAXaiyoSLORMUdpdOy6GDD50WbxLGd+KOO2InEjjVWbgHNHmseTK 9v6nA+1ZWWUvsXF39GL0ftPM6K+ZJBcNSU9dRuyc+IXnkktjJDLNOkuEEpgi2fNzV08wdtZxdPW oSu90yZEcG3C0IHg4FU8vqXYO X-Received: by 2002:a5d:4983:: with SMTP id r3mr1910632wrq.194.1568795139045; Wed, 18 Sep 2019 01:25:39 -0700 (PDT) X-Received: by 2002:a5d:4983:: with SMTP id r3mr1910612wrq.194.1568795138815; Wed, 18 Sep 2019 01:25:38 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s12sm8726472wra.82.2019.09.18.01.25.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Sep 2019 01:25:38 -0700 (PDT) Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: Jianyong Wu , netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, sean.j.christopherson@intel.com, maz@kernel.org, richardcochran@gmail.com, Mark.Rutland@arm.com, Will.Deacon@arm.com, suzuki.poulose@arm.com Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, nd@arm.com, linux-arm-kernel@lists.infradead.org References: <20190918080716.64242-1-jianyong.wu@arm.com> <20190918080716.64242-5-jianyong.wu@arm.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <83ed7fac-277f-a31e-af37-8ec134f39d26@redhat.com> Date: Wed, 18 Sep 2019 10:25:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190918080716.64242-5-jianyong.wu@arm.com> Content-Language: en-US X-MC-Unique: vKroey6jNyqzEOugVbCelA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/09/19 10:07, Jianyong Wu wrote: > +=09case ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID: > +=09=09getnstimeofday(ts); This is not Y2038-safe. Please use ktime_get_real_ts64 instead, and split the 64-bit seconds value between val[0] and val[1]. However, it seems to me that the new function is not needed and you can just use ktime_get_snapshot. You'll get the time in systime_snapshot->real and the cycles value in systime_snapshot->cycles. > +=09=09get_current_counterval(&sc); > +=09=09val[0] =3D ts->tv_sec; > +=09=09val[1] =3D ts->tv_nsec; > +=09=09val[2] =3D sc.cycles; > +=09=09val[3] =3D 0; > +=09=09break; This should return a guest-cycles value. If the cycles values always the same between the host and the guest on ARM, then okay. If not, you have to apply whatever offset exists. Thanks, Paolo