Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp668398ybp; Wed, 9 Oct 2019 02:16:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQucOHLPthZ2qxA7I1210tbcbSxCwFWDOk0WgUfBlHpSO4WkvjdSkXa9ya4mG+UcrthTBY X-Received: by 2002:a17:906:b7d0:: with SMTP id fy16mr1770247ejb.207.1570612610011; Wed, 09 Oct 2019 02:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570612609; cv=none; d=google.com; s=arc-20160816; b=PEP0P4LPeNwZ2dRKHDFYZHo3VbPMFYId2/5CWO2rVWuBhuB1yNJ2JjveczmLmfNS1u Imzg7bXCMbtwV3H2V74UUzp4v7RuJGvRLjtHn/PKkgPTI5Gx4Al+SiTmHhRpkrCDowSx g4rqT7nnOts8IXCzP3VR2H8NNPktnFtB+JE930fWBCnp8lETKIzPiALTvBh55d6y6CdK oY21QUD/8GTczRcJePiPE+alTzg1XmqbWLZlkG2X6ww8G6Ver+xv80kivLZBgAPKvDy5 5EmXokMCci5/evSf5pKARjlNOfnmIhUMwI+x1ou8ibFwr+2MsNvinHOOo5EglkCh4ZrL gJZQ== 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=cZvwRNK0EK2nVjw8oRG2qh7gftxLlqc06mSiL5eetn4=; b=ytgrKQuZK18Sd3ymg5dZ37iEeIVpu0cOUQWs4C6RpH5aFi+URZB7j8QWI6Wa5bU8fR 3IsLq6ZaxIpEywnVmFX4SzO/Zv5hj+g7GQ6posZUV+RdfIXpKA9xCiHdALtFaTT+MNzw cXvpf1uuGH32GgiEUq2iPsNdjpNiKDijP7bdEHh92QvYIUYppDz0h14/no7ZEafdi58/ xfUZjtBEAydVjjN3KwISgF9+7xR9XsreuaqIlIgepWwaCVwa34NXZq/kO6HeqCZjkb1S tUQTlahYT3G5M0DPJDXFUsXRfp1o7x56uKaa2IicbkicxJTIkhvA0mvd/dyzNJy+TYI+ f1Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QI/ialJN"; 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 i10si786472ejz.394.2019.10.09.02.16.26; Wed, 09 Oct 2019 02:16:49 -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="QI/ialJN"; 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 S1730595AbfJIJNk (ORCPT + 99 others); Wed, 9 Oct 2019 05:13:40 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:50935 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730579AbfJIJNk (ORCPT ); Wed, 9 Oct 2019 05:13:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1570612418; 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=cZvwRNK0EK2nVjw8oRG2qh7gftxLlqc06mSiL5eetn4=; b=QI/ialJNeAhazVCnlfbxJy1tX0U0fhYfKrvlm0fQlzaYW6mPMJlseivGXi9fVDSOtkHTN/ hbRMR4QFwNJnN9TpegPKbfmaX6/1Tw/g4/KwtLczIc3kkUBkUHfeQYWI55Ttk+BcaLEvo3 qWc98XwEkefijzOJCwCYbm0hlXRNmNw= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-gn01pkWMO2GLKaumcRs8bA-1; Wed, 09 Oct 2019 05:13:29 -0400 Received: by mail-wr1-f69.google.com with SMTP id c17so795621wro.18 for ; Wed, 09 Oct 2019 02:13:29 -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=Kg2KEa3btbJJz7gSq4olohGQOCWfoKGhQXiDkLfxFuQ=; b=DwYy2NQtN/D6TvfSbVO4hPRUImiJLsoxe/eI3R8bY4hSry+C28GSNocu8/MpUAfZjX /+Lwi5AaCmSPRx+Oq/eZK6oBiBMaUd0BLlM2eTEV5QUajjYDKS0y4JZXUi56VYNIf0ko yhUwduHdQRAg7rU4K5i3ftcqSFoO5halIld7CZAcF+uuX4v53LcrmrhP6JPYsQkkMMY+ eT8vpQKcZVt59haDILSmPxOx72ERlGt7pmRqq1z+UiV+2Q6j0vG0ZMKuUy7Tri6mRPe7 0m4/k+aN91LodndnEfkXeY2QEnnXcn1tjimxk3hO2tuXFbtrEodjE4ZxfvMLHu9L51wA Ihhg== X-Gm-Message-State: APjAAAUO9JKnyaeviSBFyIokqcd+aV9jzvN7S08gzxr+io418GeODmue PosyjkZAag0coTcIBmMjXkE+MyAE2cz/WZCqSWML1ag61SUanXIDZIr5CgKkJRfe3aFuSbzBmd7 t+M2z1Vd5f6fSznIQGvSs5ZIw X-Received: by 2002:a7b:c94f:: with SMTP id i15mr1874124wml.31.1570612408501; Wed, 09 Oct 2019 02:13:28 -0700 (PDT) X-Received: by 2002:a7b:c94f:: with SMTP id i15mr1874100wml.31.1570612408241; Wed, 09 Oct 2019 02:13:28 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id z22sm1311808wmf.2.2019.10.09.02.13.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Oct 2019 02:13:27 -0700 (PDT) Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: "Jianyong Wu (Arm Technology China)" , Marc Zyngier , "netdev@vger.kernel.org" , "yangbo.lu@nxp.com" , "john.stultz@linaro.org" , "tglx@linutronix.de" , "sean.j.christopherson@intel.com" , "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> <56a5b885-62c8-c4ef-e2f8-e945c0eb700e@redhat.com> <1cc145ca-1af2-d46f-d530-0ae434005f0b@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <6b8b59b2-a07e-7e33-588c-1da7658e3f1e@redhat.com> Date: Wed, 9 Oct 2019 11:13:25 +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: gn01pkWMO2GLKaumcRs8bA-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 09/10/19 10:18, Jianyong Wu (Arm Technology China) wrote: > Hi Paolo, >=20 >> -----Original Message----- >> From: Paolo Bonzini >> Sent: Wednesday, October 9, 2019 2:36 PM >> To: Jianyong Wu (Arm Technology China) ; Marc >> Zyngier ; netdev@vger.kernel.org; yangbo.lu@nxp.com; >> john.stultz@linaro.org; tglx@linutronix.de; sean.j.christopherson@intel.= com; >> 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 >> Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. >> >> On 09/10/19 07:21, Jianyong Wu (Arm Technology China) wrote: >>> As ptp_kvm clock has fixed to arm arch system counter in patch set v4, >>> we need check if the current clocksource is system counter when return >>> clock cycle in host, so a helper needed to return the current >>> clocksource. Could I add this helper in next patch set? >> >> You don't need a helper. You need to return the ARM arch counter >> clocksource in the struct system_counterval_t that you return. >> get_device_system_crosststamp will then check that the clocksource >> matches the active one. > > We must ensure both of the host and guest using the same clocksource. > get_device_system_crosststamp will check the clocksource of guest and we = also need check > the clocksource in host, and struct type can't be transferred from host t= o guest using arm hypercall. > now we lack of a mechanism to check the current clocksource. I think this= will be useful if we add one. Got it---yes, I think adding a struct clocksource to struct system_time_snapshot would make sense. Then the hypercall can just use ktime_get_snapshot and fail if the clocksource is not the ARM arch counter. John (Stultz), does that sound good to you? The context is that Jianyong would like to add a hypercall that returns a (cycles, nanoseconds) pair to the guest. On x86 we're relying on the vclock_mode field that is already there for the vDSO, but being able to just use ktime_get_snapshot would be much nicer. Paolo