Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7190007ybp; Wed, 16 Oct 2019 05:14:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzWKO6rOJWf4ZR4DnNrxdux0IkO6ONuvoH3CyyBbWTUp1nSUYr1X6gxgyYrGmGJ2sBXad2 X-Received: by 2002:a17:906:7d10:: with SMTP id u16mr40383094ejo.329.1571228086037; Wed, 16 Oct 2019 05:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571228086; cv=none; d=google.com; s=arc-20160816; b=QGNuPinfn/7lec64LqDDBHJ0UiPWPPBTL8Y+GaAoEbjY3cEI394icSpDjs1WpUrPdH 7AcbDJre3SUBKRGzjv57oj/ms+dOWNXMOzOx6d8rh7bd5MZBAu74ql+Vz6XH7iwNgyLa EMvcJYALoF6jOZed8+SN3dnHziANw33ufk0D6uhSszIyM4OalZNfRY57NtYHmVjYj6Mx 3C5u11f8tE4Jd4bhInADlTX4E+54ZUqP2q/t9z819fDHX4/a/uyfSq9UUjncg+2lGS7M jdbq6d//r5800oB9M/zj4d0L+J+3qgV3xl5H6FcDcHd/k7DDbBprLTApg1GX498YZ3S/ fI+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=hlkp3s7n7jgW1z1BY8NbFZQJW+lE/V8ZGenvQuP8OAM=; b=bGxnggEwyMsRsBHQ7VTnVRtTns1+o+qTiccm/BZe5+32jXEXSM1r0O16acWScKoFoS qMzpywaJyr5Gyu2jR5JAsYZ/17oetpIHwVAmJO7vH9E2pIR/pH3o5sbLKFzUPj2Yw3Al OtPCbMPqf8TXMWPD/ZZEOTBGUsyoHoiD3SpZjJpGUZXofb3EtmXbxjJ51d6JJa6rL23t xpgQbJqMgPSsV9LidWpaMOC/I6NKJu8ZB7XcGPXLQL8CAH8xEX8+W5F4ohh1tC6R1hUx /gYF8JQIZX3u8LarclfujD5vK1DgNj/jwrfS+mrmOKF0FhdJ5ahNSpXcIJ9ynRIhuh0p OgGw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fk4si16379568ejb.161.2019.10.16.05.14.22; Wed, 16 Oct 2019 05:14:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389131AbfJPHcM (ORCPT + 99 others); Wed, 16 Oct 2019 03:32:12 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:48478 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389039AbfJPHcM (ORCPT ); Wed, 16 Oct 2019 03:32:12 -0400 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iKdmp-0007Pm-FE; Wed, 16 Oct 2019 09:31:59 +0200 Date: Wed, 16 Oct 2019 09:31:58 +0200 (CEST) From: Thomas Gleixner To: Paolo Bonzini cc: Jianyong Wu , netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, sean.j.christopherson@intel.com, maz@kernel.org, richardcochran@gmail.com, Mark.Rutland@arm.com, will@kernel.org, suzuki.poulose@arm.com, 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 Subject: Re: [PATCH v5 4/6] psci: Add hvc call service for ptp_kvm. In-Reply-To: <9641fbff-cfcd-4854-e0c9-0b97d44193ee@redhat.com> Message-ID: References: <20191015104822.13890-1-jianyong.wu@arm.com> <20191015104822.13890-5-jianyong.wu@arm.com> <9641fbff-cfcd-4854-e0c9-0b97d44193ee@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Oct 2019, Paolo Bonzini wrote: > On 15/10/19 12:48, Jianyong Wu wrote: > > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_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) > > +{ > > + return (struct clocksource *)cs == &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); And then you implement a gazillion of those functions for every arch/subarch which has a similar requirement. Pointless exercise. Having the ID is trivial enough and the storage space is not really a concern. Thanks, tglx