Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1741009ybn; Thu, 26 Sep 2019 01:16:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxH2BOk0ONnSnt46FRG6I4w7sCyTroyPevHftuEevm6ArKYgbIrkYMwSVQU5xWefYhYQLJN X-Received: by 2002:aa7:d4c5:: with SMTP id t5mr2214839edr.154.1569485793929; Thu, 26 Sep 2019 01:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569485793; cv=none; d=google.com; s=arc-20160816; b=XcsjhvwnaWXSWqqSHtCd+cIQati0YcxS6QpBMlSWa+HgoXgOFs/2E2bt+rd10TfI0V tQHUkgLymWe8SPBCA+hjovam9WBd9FEjWBkt7lK1/8fMhE30VBBPHx+sGJg2jbgiv79C F/0Fz95uQNjKGVUnk7e2tupoGFPlVlKfBSLsoSGKMQxXgT7Cp+f6Hp9fYcH420t1dnLv l84+2B/QjGCxHU+Pd4+AbtLYseZp9c8VsV46yuVSen6HAjXVc8URJLwhzlNuv2x4/3de hozmvJ6OFcBWhJaTM/vuOV2gtnt3suovLEGnqRCkDvORIJQDGtMt/+8O2yuUPFtOEHkR mB8A== 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:from:references:cc:to:subject:dkim-signature; bh=L4qybsnzerq1m1MESjNMamZC3PQ0Zg5C9AXa25MzaeU=; b=GB3NNiQIl8Hjf3kzO7xqgVmdv3kh6Lhqtabp83VGDq621bBkxcYgU5Yn6XKOnGICt/ jrd4g79zDJ2Vw6PNZ6hSpWf2zhUc027gr9qoPd3N+0RstqxijcBXEkjU7OPIAElnoVY7 s6ifyGNS7lEVDsVkvgEkdGntmfDU0z959HffOaXdFwDW/6GkJv9VAXX6nb00ss9ESZj9 ctinFpOBRhT1kLotLUWOQtVXZu2EfgIgSvbrQ5Z7n9kDIHO1QfzeTBIcoNiYhQfbI4R3 x63LAvx/bBSRnAPQTeqD4N+OQynPHEvBsrBpO9JYHWG6QWyZt5ajTy07NTb0MbVQlPVJ dNUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DyqGlg0H; 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 w22si617024eja.115.2019.09.26.01.16.10; Thu, 26 Sep 2019 01:16:33 -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=DyqGlg0H; 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 S2441326AbfIXOUZ (ORCPT + 99 others); Tue, 24 Sep 2019 10:20:25 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:46069 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2436567AbfIXOUV (ORCPT ); Tue, 24 Sep 2019 10:20:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1569334819; 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; bh=L4qybsnzerq1m1MESjNMamZC3PQ0Zg5C9AXa25MzaeU=; b=DyqGlg0HsbDGgR9DEYIEf8cr8hlg1OrTikl1oIBAXk51IvoEv3wx4K4LhgVOjhxK7Gvtvq EQWP+v3TnWLWi/JZDJMzoJ/zrzofqUiiFQmEN7rH8RjLRPi9ys/xOkcPfuxWwX6hFtpX0R zA3sdi4QZrIifB+Bjfd7lpL1jKeHqQg= 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-100-_LSnWbLNPIS8V25WpZ178w-1; Tue, 24 Sep 2019 10:20:18 -0400 Received: by mail-wm1-f71.google.com with SMTP id j125so88715wmj.6 for ; Tue, 24 Sep 2019 07:20:18 -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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sEyk6USuWuluG4dEpZivpllBkGUrYY+s2EB287d40EY=; b=s+6DSE+J5pot499c0fKDI6TIOsTIkns+vjtg7cJYQhpASwj7VzNnkO4BnE04Fz2ldg 4fX8tHnebHJ7O81bFTnEmHfrSs6aXLib7UNwTOf+8iwk/T/AbY8+wpUNuGx68F0Yb2BL 9R3d3LRHG4yIEikXPWkvyEaNioW+aGUsMdGGi+b7KcuykbvZSRnNHevxfQ/NL2zsAfAW 2sk23vbYWVMbu+vLUfSJ04BYAD2axMCirUhiTZGDp3NyAECgX+AAVKwz0c2iaLzktJ4w 7q2n3gko2FAE5WJvDfqFtd9LIdYqhWv/X5+zi4ihig+uxBgit+RLCQzETB5l+2yxEaMP QyNA== X-Gm-Message-State: APjAAAWG4gzr43f4YEMeEdvRp/JbLF8XKcvwRFV46wQFVvHYTf8TyAOJ YIXYI0QPyF3qjKgXu51qlRGMpusP0f2dZTbRJCByq8Egyto2eg5RsAyJiNxaYfWKhUlxatQgpwB c4LNWSCLRAti88kMmULXuERas X-Received: by 2002:a5d:69c7:: with SMTP id s7mr2469151wrw.295.1569334817104; Tue, 24 Sep 2019 07:20:17 -0700 (PDT) X-Received: by 2002:a5d:69c7:: with SMTP id s7mr2469108wrw.295.1569334816822; Tue, 24 Sep 2019 07:20:16 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:9520:22e6:6416:5c36? ([2001:b07:6468:f312:9520:22e6:6416:5c36]) by smtp.gmail.com with ESMTPSA id h125sm183749wmf.31.2019.09.24.07.20.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2019 07:20:15 -0700 (PDT) Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: "Jianyong Wu (Arm Technology China)" , "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 , Will Deacon , Suzuki Poulose Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Steve Capper , "Kaly Xin (Arm Technology China)" , "Justin He (Arm Technology China)" , nd , "linux-arm-kernel@lists.infradead.org" References: <20190918080716.64242-1-jianyong.wu@arm.com> <20190918080716.64242-5-jianyong.wu@arm.com> <83ed7fac-277f-a31e-af37-8ec134f39d26@redhat.com> <629538ea-13fb-e666-8df6-8ad23f114755@redhat.com> From: Paolo Bonzini Message-ID: <06264d8a-b9c0-5f19-db2c-6190976a2a05@redhat.com> Date: Tue, 24 Sep 2019 16:20:14 +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: Content-Language: en-US X-MC-Unique: _LSnWbLNPIS8V25WpZ178w-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 23/09/19 06:57, Jianyong Wu (Arm Technology China) wrote: >> On 19/09/19 11:46, Jianyong Wu (Arm Technology China) wrote: >>>> On 18/09/19 11:57, Jianyong Wu (Arm Technology China) wrote: >>>>> Paolo Bonzini wrote: >>>>>> 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]. >>> >>> Val[] should be long not u32 I think, so in arm64 I can avoid that >>> Y2038_safe, but also need rewrite for arm32. >> >> I don't think there's anything inherently wrong with u32 val[], and as y= ou >> notice it lets you reuse code between arm and arm64. It's up to you and >> Marc to decide. >> > To compatible 32-bit, Integrates second value and nanosecond value as a n= anosecond value then split it into val[0] and val[1] and split cycle value = into val[2] and val[3], > In this way, time will overflow at Y2262. > WDYT? So if I understand correctly you'd multiply by 10^9 (or better shift by 30) the nanoseconds. That works, but why not provide 5 output registers? Alternatively, take an address as input and write there. Finally, on x86 we added an argument for the CLOCK_* that is being read (currently only CLOCK_REALTIME, but having room for extensibility in the API is always nice). Paolo