Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1123384ybp; Wed, 9 Oct 2019 09:07:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwq0PcSEIByOtbwiozyPOhoGO6RFttzAupoKgFVMPfVETcfNPzTrVI0CXafTWib650cTdq9 X-Received: by 2002:a50:f748:: with SMTP id j8mr3658680edn.267.1570637224388; Wed, 09 Oct 2019 09:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570637224; cv=none; d=google.com; s=arc-20160816; b=h/rBSeYAfSar/4N7l8V4et4pl3iIiPzXseGTmQdvQppLR54CHpvdDoFEzIjDNgBiM7 U2nFdjdKGdiE3FsYCWWgYtkjr6fPBAzHihNtgw6HwUe/Vuslw4mFwqdbRHzmplojeofC g0RtLhTvLHi9x2/kcgJLV+4PGuR6NdDOgRQSL0pkiCfSkI2KDL7YMmI3V5SUMNG1cyUD 5zfc8TSjAfI/D4tDS02dqlZUDOqhyNaP5cZUzWzAay8kwtmUvYkbVWMJDBrWTqjyBYs9 0yGUohbJ46arJSfXErvo9zHFW3b+QWNnQiSo/KC+r0HVWPaIZf54qNmqllRLuo2GTHTv 73tA== 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; bh=OcoDswvcpgORUe+MjF3j+myWKBr/y/JxVMKqWxIZdns=; b=o9XKkVhHpPanVXYeGWVn0G9796hi1hQpqeF8xzVUQRw71mHAiCtMbpLHj3v2y26x2x 1vQYNvfp4Y/5G/qBw5EAHmhSAIda1sKhCSSsytZ95EUtAn4R0phBTb4cOLBdUfXkywK8 n0Atzk0ffx0WQkWJGIGGw8UtQc+w4x2bxo3lvR98jmStarF32F2GY41DSpUonXFM/Aah GulbWwUsV4heqGMkazQdEPVaWge7jbBB3d3rIyWpMgESDEb/MeefQGJejBTkn9gYfw5e pbFy1Lv4p91mrLY7JMZBz6RjogMJ2hTF2FI0OTo1XMRRKJRJAmTUF2ImTWBfRgYjznC6 Uu+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PlMwn9qd; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si1503920eju.51.2019.10.09.09.06.38; Wed, 09 Oct 2019 09:07:04 -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=@linaro.org header.s=google header.b=PlMwn9qd; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731631AbfJIQFp (ORCPT + 99 others); Wed, 9 Oct 2019 12:05:45 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55587 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731263AbfJIQFo (ORCPT ); Wed, 9 Oct 2019 12:05:44 -0400 Received: by mail-wm1-f67.google.com with SMTP id a6so3236872wma.5 for ; Wed, 09 Oct 2019 09:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OcoDswvcpgORUe+MjF3j+myWKBr/y/JxVMKqWxIZdns=; b=PlMwn9qd6erojZKwrGuwRQoT3mBFtPJPdxKkIoi+g/d953cHVVQVDyFhTmkAOHq9HS VH6Kz+ynJOta/5jpwjQNaOKkCz8EqFOd8eFpwMkcdLBa/lGr9vFX4ZH9Odb0ZasRfZfg hL4ixrbd5H9Gn9ce4slb2XkurFpkRA99mVhAJRq0EpElm5jcHAq+hLY5NEFSOcYi8T5c XDGKEmdJaOWe6vEv1mdkMetvYaOe5w19Ke0Q6x3RRBcLXohUpsQ+H+tsU7xqCcKjV69C oJPkEMkoDqtuEHAJMbrD0RUQcVb80wtCimLZE2tavU+7cfhJGR2bsMlGyBuIYnXcbGRM T4sw== 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=OcoDswvcpgORUe+MjF3j+myWKBr/y/JxVMKqWxIZdns=; b=PuC5oJfDXRyszVDqfukAvdH9r/FW8D2XEtol9dA/IrIuEnnSVisoN2sVeTZoPcduB9 mHSyC6E/JjSt9W7nSEtfOII3nMDsUm5wiMwo/jHZO/1i86zphoTr9u1JbzhbcovFi9+k aXDrO/X9VenxCK9Izpzv2IMcOqYWzBRxz7v1SEYGS39QJzBHqcfdjbIm/RqAus+1LxMa cg/jLqhLA7iXO9tckqnxZqyARJ61gPK9bRIqaQ6WOM4vslAuCZ0UG8oZrYsgaF8Sc+VC QOIfIKqkO/lKWRTHuYOYMDgJLnI4V8q8C3JR8Xp1JvJla5ALdPuEAvVCXGGKoovxAzUl 4eXw== X-Gm-Message-State: APjAAAVMj9BI5NW9FS2WBSsEqiQLXpN9zIbezQlXF4URKAolbx7YNXJ3 iKHQAimz/m3QtsEvvv7m8Tq9VznacwVjh2yB17aZ5w== X-Received: by 2002:a1c:a8c9:: with SMTP id r192mr3238811wme.152.1570637140793; Wed, 09 Oct 2019 09:05:40 -0700 (PDT) MIME-Version: 1.0 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> <6b8b59b2-a07e-7e33-588c-1da7658e3f1e@redhat.com> In-Reply-To: <6b8b59b2-a07e-7e33-588c-1da7658e3f1e@redhat.com> From: John Stultz Date: Wed, 9 Oct 2019 09:05:29 -0700 Message-ID: Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: Paolo Bonzini Cc: "Jianyong Wu (Arm Technology China)" , Marc Zyngier , "netdev@vger.kernel.org" , "yangbo.lu@nxp.com" , "tglx@linutronix.de" , "sean.j.christopherson@intel.com" , "richardcochran@gmail.com" , Mark Rutland , Will Deacon , Suzuki Poulose , "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" 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 Wed, Oct 9, 2019 at 2:13 AM Paolo Bonzini wrote: > On 09/10/19 10:18, Jianyong Wu (Arm Technology China) wrote: > > > > 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 to 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. I've not really looked at the code closely in awhile, so I'm not sure my suggestions will be too useful. My only instinct is maybe to not include the clocksource pointer in the system_time_snapshot, as I worry that structure will then be abused by the interface users. If you're just wanting to make sure the clocksource is what you're expecting, would instead putting only the clocksource name in the structure suffice? thanks -john