Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1073430ybe; Thu, 19 Sep 2019 08:14:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx89WgQQemiIkXJQao5yRdv6Vd095YKb/tmPmh0K2Xl6AJyHELaTyPeZ5XMy5cYL8OBBS3F X-Received: by 2002:a50:a0e2:: with SMTP id 89mr16421689edo.118.1568906095867; Thu, 19 Sep 2019 08:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568906095; cv=none; d=google.com; s=arc-20160816; b=eHheWDaRQ78YIStOFLkUnMelGR2ZWXelEq3OOUNMNGKhu1blPYHCFq0un5SYikW4D2 NS5MGMjZcHcBUeuh5bDNcAoavlJcj0dQI3osf9KNwmcZ2D8WsQf8+LXV+8JQCBUtaxCy mlNm3eCkKcyp0hO46/dUCItSuXAJ4bU0IO2xB7VR0DZso4kQeE+QFJm+fPMzSn2hbqEW iC0JSlAppKcq6Iq321ILAVzVG19rfPuCi2xbAHuNX0Mms6xndOeuaSjwQbLiTmU/QuIc 5RV+hs+t4GKRRcHsjz2eCPL7Ga8EUrGRpqHF/cqXD0ffqZKkRAUtcr4qUPHOpk+kVo0T IGwg== 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=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=hKjPnKAocZ9TQSH7o1o7G7R/v0PsIncoASq2+7SWP3kMKmqZ7LdtxSpbaxYni7MLg+ 5Smo+wBYCIRteFpujfO9HpfNjwyo6nnH0Ehgp3UdpGImHlsa/EAdgz/Sqr5npDrbE7xZ 1Vcj8KJ3omp8qeKN7krTrkdS62cD3uq8M6Gxncw8taWTGWKSWp3woZLPQ0A3fPfg+URX m1/sUwYjFWAbPQW2eNVCIxWbCSGipo46KsMptChN7EGougQ9zx7aHtBOzu/OJJ9vW4hu cQGVIZMBhgsjlFR24IXlBXVrclusB2x1IiylPWzHcztPUL670Ihg9POFCTLNIu5lxZv+ nFWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Uoos2eUm; 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 p13si4808084ejr.281.2019.09.19.08.14.31; Thu, 19 Sep 2019 08:14:55 -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=Uoos2eUm; 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 S2390261AbfISMN1 (ORCPT + 99 others); Thu, 19 Sep 2019 08:13:27 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27381 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390227AbfISMNV (ORCPT ); Thu, 19 Sep 2019 08:13:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1568895200; 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=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=Uoos2eUmdiKzuQlXofjnhJ3p1Nwl4lVhuWcraNySJQ9Fpnp7iV8TrTcjMxZgrhJ8FW/iQg qmCr1g3ZwdqZfsKwbbFuIGoPYSZ73Vw1mUsR0mc+m+79Y9uqU76+/hg6BlyRPz+qY1gC8Z IFTWZqCdNGHCbFXvTreHZvd6SyWyY9o= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-o4gALb9vM5GWynNYnhGTnA-1; Thu, 19 Sep 2019 08:13:18 -0400 Received: by mail-wr1-f71.google.com with SMTP id f11so931948wrt.18 for ; Thu, 19 Sep 2019 05:13: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:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=tIBR9SjRrbOiaXpt4GF8rhYATIXWlUPqNjr1NyphPuIQifT5IUAyq+IDy2T1LlReX3 VtHpB/KsCed2v4etC7ikefFwEaNddPIgjxBgGDvJLMZxgGsKJRwp2mTzZOo0V9ahZQLy isIE6ZSlqqPsQ383ccy0XUUEb8W30d8kbwuLm45l72UUu95QeIMPxxUDw5zyZ9iJeCS0 O5nleRFAgurA7GJMNgXJhYUgOxA7h+TUscYaB+ERH47ZwKJQFRx5M3cSXyRNGBv8Jhrd LcvTdnqZ2K3D1avlGbUy/SxOY0oETuQBBCKIuXyNRE6qs09ld8e3AoNUcjgOJVj211JF jN8g== X-Gm-Message-State: APjAAAWIUaWSlG61ARCGr3vIrEpBTmtzy041gJ3gJdwhgGXT5p8znSP/ V1DKoqEeUb67XOCjTFqsv3lJhUX95Yp64t1XmN9+c2CPy4Ymtm5Xt05ftYOxRnTdv4ebdh5Fmwo SHuHsf9CP0xXX7oZphjMKmR/j X-Received: by 2002:a5d:6088:: with SMTP id w8mr6995242wrt.31.1568895197142; Thu, 19 Sep 2019 05:13:17 -0700 (PDT) X-Received: by 2002:a5d:6088:: with SMTP id w8mr6995221wrt.31.1568895196846; Thu, 19 Sep 2019 05:13:16 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c46c:2acb:d8d2:21d8? ([2001:b07:6468:f312:c46c:2acb:d8d2:21d8]) by smtp.gmail.com with ESMTPSA id x6sm7878924wmf.38.2019.09.19.05.13.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2019 05:13:16 -0700 (PDT) Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: Marc Zyngier , "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" , "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 Openpgp: preference=signencrypt Message-ID: <56a5b885-62c8-c4ef-e2f8-e945c0eb700e@redhat.com> Date: Thu, 19 Sep 2019 14:13:13 +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: o4gALb9vM5GWynNYnhGTnA-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 19/09/19 13:39, Marc Zyngier wrote: >> I don't think it's ugly but more important, using tk->tkr_mono.clock is >> incorrect. See how the x86 code hardcodes &kvm_clock, it's the same for >> ARM. > Not really. The guest kernel is free to use any clocksource it wishes. Understood, in fact it's the same on x86. However, for PTP to work, the cycles value returned by the clocksource must match the one returned by the hypercall. So for ARM get_device_system_crosststamp must receive the arch timer clocksource, so that it will return -ENODEV if the active clocksource is anything else. Paolo > In some cases, it is actually desirable (like these broken systems that > cannot use an in-kernel irqchip...). Maybe it is that on x86 the guest > only uses the kvm_clock, but that's a much harder sell on ARM. The fact > that ptp_kvm assumes that the clocksource is fixed doesn't seem correct > in that case.