RE: [PATCH v5 4/6] psci: Add hvc call service for ptp_kvm.

From
Jianyong Wu (Arm Technology China) <hidden>
Date
2019-10-16 10:20:40
Also in
kvm, kvmarm, linux-arm-kernel, lkml
Reply to
Paolo Bonzini, 2019-10-16
Hi Paolo,
-----Original Message-----
From: Paolo Bonzini <pbonzini@redhat.com>
Sent: Wednesday, October 16, 2019 3:25 PM
To: Jianyong Wu (Arm Technology China) <redacted>;
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 [off-list ref];
will@kernel.org; Suzuki Poulose [off-list ref]
Cc: <redacted>; <redacted>;
kvmarm@lists.cs.columbia.edu; kvm@vger.kernel.org; Steve Capper
[off-list ref]; Kaly Xin (Arm Technology China)
[off-list ref]; Justin He (Arm Technology China)
[off-list ref]; nd [off-list ref]
Subject: Re: [PATCH v5 4/6] psci: Add hvc call service for ptp_kvm.

On 15/10/19 12:48, Jianyong Wu wrote:
quoted
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?
Need fix.

Thanks
Jianyong 
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
  
Thread (30 messages) 30 messages, 4 authors, last reply 2019-10-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help