Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7185489ybp; Wed, 16 Oct 2019 05:10:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1lNpmZ8S4IVSUDXO+bYtgG5aGl2Cf5Ch89BX5+dqfQc4fIMFB9y+eRYrykzlNoI3uDRH0 X-Received: by 2002:a50:b901:: with SMTP id m1mr39144215ede.203.1571227855361; Wed, 16 Oct 2019 05:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571227855; cv=none; d=google.com; s=arc-20160816; b=J/2Yf+D3l7cmgb0LX2LYhE6Hbqq733+ggF5wWCKIqPbt4Nu2pxALTXi7HTZBWEJ30l ZlTYCIkQdw83qOVgjldwWilJ4LCVY7zfT6VRNRd4OLSNrJSkma03W+o691xTOAmuIN6v /1Zwg6X3Ld03CPmJG9zj9QckfPAUJhDWdbm6py8AhgmZByOqZw2EtrBKHrL0jqBob3E6 q4UKQuH434i5gEq/aqTuLO0qrb2S6RiQ5Z98tVcrGfwsxo3C0f5iGMfM5MVEHe5G7sOb 5+08S5cBXUTh3j+YhatJyNkEryTpD55CHwSgIp/gAik40PRwiI1O1zlUgtoQ6/sjP0Fw OMEg== 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=S5d0V9S8ommJVGUrWAIephbxJ0dHyW1i5xgUqQkwiWw=; b=dc+SLcOg5qxRpgc9Tn+48c/y0d3MLT8vO9mtZF3Ou+RApFrUDUHEWfmoKEJLe33f94 rRZuiFhQFckQynEYohRZYPw/M+wff4SXj7ID39s3GdtrRcOqMYvtOYZaUwqOGBe1H/F3 Hi+Ay1UsqKKQ91ueZ9kKMaC4GoHpcvv56iPoV8fS+hhvWLYFaWYfXITbwI+Xrwwhl/Lv 2PzSYBvLSnqp1DFSoJDrqQ+xGe9eyrMQdnLDl47lqfjm8EHpGdoTeoNkUVk0a8z4bleq QkR1gGu5hkLtPNNXvVNZO+llaRUWAcpkTWOKfa/oBCyd2oJqnyK8pszDfMU3eUt//vLm nxWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ObKkU029; 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 r19si15263653eji.376.2019.10.16.05.10.32; Wed, 16 Oct 2019 05:10: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=ObKkU029; 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 S1728873AbfJPHZE (ORCPT + 99 others); Wed, 16 Oct 2019 03:25:04 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:59174 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726719AbfJPHZD (ORCPT ); Wed, 16 Oct 2019 03:25:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571210702; 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=S5d0V9S8ommJVGUrWAIephbxJ0dHyW1i5xgUqQkwiWw=; b=ObKkU029A3p3gcJHGZO7LILvF3UvVjX0lyObVvFRyVrbkn1YS90mfOTRhzasYefXfbbgoL 2jpBvZidJGeDsv6BJLDbGMktZevpfjXi7aI0T1K+SuKVtJ/KOgVr0/62XHnAu/Ka17ojY4 PSWXH/tJxLBE9ftzttqoCLCxmCb+UOM= 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-121-8Q_jLAJNNSClGvZXJr3zhw-1; Wed, 16 Oct 2019 03:25:00 -0400 Received: by mail-wr1-f69.google.com with SMTP id 7so6047147wrl.2 for ; Wed, 16 Oct 2019 00:25:00 -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=7pVDKMRb0iY8vtAwjOLtISUgtFuBYzCTEpSdAuatOfE=; b=FR2Js9yhZYL9jzr1pULFdBOutnFMbNs4rpmf6Q44PWhaXyrdY6UqarlUvLuluyB1ta JdnfxMiFn1GQXfD2m4CwSOvlbW/soeUUwGcUc6cEuajJXC8sldFILDnaeyzIsotCI+S1 i4hne9ODfarBtk8S5TqAJZCZW3fzAh9TJ76X2cUtnMq6DDosMM68mqyOwd094lgmNTe9 jnLQtVPjdQ4yumaZ80wHIfzEjzOP5yo9s59FlhUfdUW/mYhQ9j4kA5pVU86GwJp+aEFv /cvtlrHd8VZ/IwC7aF/poVAERNaejk3uFZtLDyzfh7mBZVrLYFCJeiCdJiFxZPCLePL2 LKTQ== X-Gm-Message-State: APjAAAVR6+VSpnpPBVwOLKyUfzwD9kTD9ugh0puONRgeFBppmIKfB+ZI TsvN5wzyUMrrxkWNadv2nCPivVshJh4FDnueb74l7YxdEFzpdeayufXy7prF7dm8DtBdscajCzN yiXnZT4/NV4vkjL6ZBQVOFxbn X-Received: by 2002:a1c:2d4d:: with SMTP id t74mr1925355wmt.108.1571210699186; Wed, 16 Oct 2019 00:24:59 -0700 (PDT) X-Received: by 2002:a1c:2d4d:: with SMTP id t74mr1925322wmt.108.1571210698895; Wed, 16 Oct 2019 00:24:58 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:ddc7:c53c:581a:7f3e? ([2001:b07:6468:f312:ddc7:c53c:581a:7f3e]) by smtp.gmail.com with ESMTPSA id f20sm1474636wmb.6.2019.10.16.00.24.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Oct 2019 00:24:58 -0700 (PDT) Subject: Re: [PATCH v5 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@kernel.org, suzuki.poulose@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, nd@arm.com References: <20191015104822.13890-1-jianyong.wu@arm.com> <20191015104822.13890-5-jianyong.wu@arm.com> From: Paolo Bonzini Message-ID: <9641fbff-cfcd-4854-e0c9-0b97d44193ee@redhat.com> Date: Wed, 16 Oct 2019 09:24:54 +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: <20191015104822.13890-5-jianyong.wu@arm.com> Content-Language: en-US X-MC-Unique: 8Q_jLAJNNSClGvZXJr3zhw-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 15/10/19 12:48, Jianyong Wu wrote: > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/a= rm_arch_timer.c > index 07e57a49d1e8..3597f1f27b10 100644 > --- a/drivers/clocksource/arm_arch_timer.c > +++ b/drivers/clocksource/arm_arch_timer.c > @@ -1634,3 +1634,8 @@ static int __init arch_timer_acpi_init(struct acpi_= table_header *table) > } > TIMER_ACPI_DECLARE(arch_timer, ACPI_SIG_GTDT, arch_timer_acpi_init); > #endif > + > +bool is_arm_arch_counter(void *cs) > +{ > +=09return (struct clocksource *)cs =3D=3D &clocksource_counter; > +} As Thomas pointed out, any reason to have a void * here? However, since he didn't like modifying the struct, here is an alternative idea: 1) add a "struct clocksource*" argument to ktime_get_snapshot 2) return -ENODEV if the argument is not NULL and is not the current clocksource 3) move the implementation of the hypercall to drivers/clocksource/arm_arch_timer.c, so that it can call ktime_get_snapshot(&systime_snapshot, &clocksource_counter); Paolo