RE: [PATCH v18 7/7] ptp: arm/arm64: Enable ptp_kvm for arm/arm64

2021-03-30 Thread Jianyong Wu
Poulose ; Andre Przywara ; Steven Price ; Lorenzo Pieralisi ; Sudeep Holla Cc: linux-ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; kvm...@lists.cs.columbia.edu; k...@vger.kernel.org; Steve Capper ; Justin He ; Jianyong Wu ; kernel-t...@android.com; Mark Rutland Subject: [PATCH

RE: [PATCH v18 6/7] KVM: arm64: Add support for the KVM PTP service

2021-03-30 Thread Jianyong Wu
...@kernel.org; Suzuki Poulose ; Andre Przywara ; Steven Price ; Lorenzo Pieralisi ; Sudeep Holla Cc: linux-ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; kvm...@lists.cs.columbia.edu; k...@vger.kernel.org; Steve Capper ; Justin He ; Jianyong Wu ; kernel-t...@android.com Subject: [PATCH

RE: [PATCH v16 0/9] Enable ptp_kvm for arm/arm64

2021-02-02 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Tuesday, February 2, 2021 10:15 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; richardcoch...@gmail.com; Mark > Rutl

RE: [PATCH v16 0/9] Enable ptp_kvm for arm/arm64

2021-01-06 Thread Jianyong Wu
Ping... Any comments? Thanks! > -Original Message- > From: Jianyong Wu > Sent: Wednesday, December 9, 2020 2:09 PM > To: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; &g

[PATCH v16 6/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-12-08 Thread Jianyong Wu
ptp_kvm will get this service through SMCC call. The service offers wall time and cycle count of host to guest. The caller must specify whether they want the host cycle count or the difference between host cycle count and cntvoff. Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 59

[PATCH v16 1/9] arm64: Probe for the presence of KVM hypervisor

2020-12-08 Thread Jianyong Wu
tible with KVM. Once this has been established, additional services can be discovered via a feature bitmap. Change from Jianyong Wu: mv kvm_arm_hyp_service_available to common place to let both arm/arm64 touch it. add kvm_init_hyp_services also under arm arch to let arm kvm guest use this service.

[PATCH v16 7/9] ptp: arm/arm64: Enable ptp_kvm for arm/arm64

2020-12-08 Thread Jianyong Wu
-4ns * PHC00 3 377 8 +4ns[ +5ns] +/-4ns The PHC0 is the ptp clock which choose the host clock as its source clock. So we can see that the clock difference between host and guest is in order of ns. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_ar

[PATCH v16 0/9] Enable ptp_kvm for arm/arm64

2020-12-08 Thread Jianyong Wu
arate ptp_kvm code for arm64 into hypervisor part and guest part. (4) add API to expose monotonic clock and counter value. (5) refine code: remove no necessary part and reconsitution. [1] https://patchwork.kernel.org/cover/11373351/ Jianyong Wu (6): ptp: Reorganize ptp_kvm

[PATCH v16 3/9] ptp: Reorganize ptp_kvm module to make it arch-independent.

2020-12-08 Thread Jianyong Wu
Currently, ptp_kvm modules implementation is only for x86 which includes large part of arch-specific code. This patch moves all of this code into a new arch related file in the same directory. Signed-off-by: Jianyong Wu --- drivers/ptp/Makefile| 1 + drivers/ptp

[PATCH v16 5/9] clocksource: Add clocksource id for arm arch counter

2020-12-08 Thread Jianyong Wu
Add clocksource id for arm arch counter to let it be identified easily and elegantly in ptp_kvm implementation for arm. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c | 2 ++ include/linux/clocksource_ids.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[PATCH v16 8/9] doc: add ptp_kvm introduction for arm64 support

2020-12-08 Thread Jianyong Wu
PTP_KVM implementation depends on hypercall using SMCCC. So we introduce a new SMCCC service ID. This doc explains how does the ID define and how does PTP_KVM works on arm/arm64. Signed-off-by: Jianyong Wu --- Documentation/virt/kvm/api.rst | 9 +++ Documentation/virt/kvm/arm

[PATCH v16 9/9] arm64: Add kvm capability check extension for ptp_kvm

2020-12-08 Thread Jianyong Wu
Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 1 + include/uapi/linux/kvm.h | 1 + 2 files

[PATCH v16 4/9] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-12-08 Thread Jianyong Wu
take the snapshot and act accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Jianyong Wu --- include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 11 +++ include/linux/timekeeping.h | 12 +++- kernel/time/clocksource.c | 2 ++ kernel

[PATCH v16 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-12-08 Thread Jianyong Wu
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 27 ++- 1

RE: [PATCH v15 7/9] ptp: arm/arm64: Enable ptp_kvm for arm/arm64

2020-11-24 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Tuesday, November 24, 2020 5:05 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > ric

RE: [PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-11-24 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Tuesday, November 24, 2020 5:07 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > ric

RE: [PATCH v15 7/9] ptp: arm/arm64: Enable ptp_kvm for arm/arm64

2020-11-23 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Monday, November 23, 2020 6:49 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > ric

RE: [PATCH v15 8/9] doc: add ptp_kvm introduction for arm64 support

2020-11-23 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Monday, November 23, 2020 6:58 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > ric

RE: [PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-11-23 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Monday, November 23, 2020 6:44 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > ric

RE: [PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-11-23 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Monday, November 23, 2020 7:59 PM > To: Jianyong Wu > Cc: Justin He ; k...@vger.kernel.org; > netdev@vger.kernel.org; richardcoch...@gmail.com; linux- > ker...@vger.kernel.org; sean.j.christopher...@in

RE: [PATCH v15 0/9] Enable ptp_kvm for arm/arm64

2020-11-23 Thread Jianyong Wu
Hi, Ping ... Any comments? > -Original Message- > From: Jianyong Wu > Sent: Wednesday, November 11, 2020 2:22 PM > To: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; &g

[PATCH v15 7/9] ptp: arm/arm64: Enable ptp_kvm for arm/arm64

2020-11-10 Thread Jianyong Wu
-4ns * PHC00 3 377 8 +4ns[ +5ns] +/-4ns The PHC0 is the ptp clock which choose the host clock as its source clock. So we can see that the clock difference between host and guest is in order of ns. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_ar

[PATCH v15 3/9] ptp: Reorganize ptp_kvm module to make it arch-independent.

2020-11-10 Thread Jianyong Wu
Currently, ptp_kvm modules implementation is only for x86 which includes large part of arch-specific code. This patch moves all of this code into a new arch related file in the same directory. Signed-off-by: Jianyong Wu --- drivers/ptp/Makefile| 1 + drivers/ptp

[PATCH v15 5/9] clocksource: Add clocksource id for arm arch counter

2020-11-10 Thread Jianyong Wu
Add clocksource id for arm arch counter to let it be identified easily and elegantly in ptp_kvm implementation for arm. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c | 2 ++ include/linux/clocksource_ids.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-11-10 Thread Jianyong Wu
ptp_kvm will get this service through SMCC call. The service offers wall time and cycle count of host to guest. The caller must specify whether they want the host cycle count or the difference between host cycle count and cntvoff. Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 61

[PATCH v15 4/9] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-11-10 Thread Jianyong Wu
take the snapshot and act accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Jianyong Wu --- include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 11 +++ include/linux/timekeeping.h | 12 +++- kernel/time/clocksource.c | 2 ++ kernel

[PATCH v15 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-11-10 Thread Jianyong Wu
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 27 ++- 1

[PATCH v15 9/9] arm64: Add kvm capability check extension for ptp_kvm

2020-11-10 Thread Jianyong Wu
Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 1 + include/uapi/linux/kvm.h | 1 + 2 files

[PATCH v15 1/9] arm64: Probe for the presence of KVM hypervisor

2020-11-10 Thread Jianyong Wu
tible with KVM. Once this has been established, additional services can be discovered via a feature bitmap. Change from Jianyong Wu: mv kvm_arm_hyp_service_available to common place to let both arm/arm64 touch it. add kvm_init_hyp_services also under arm arch to let arm kvm guest use this service.

[PATCH v15 8/9] doc: add ptp_kvm introduction for arm64 support

2020-11-10 Thread Jianyong Wu
PTP_KVM implementation depends on hypercall using SMCCC. So we introduce a new SMCCC service ID. This doc explains how does the ID define and how does PTP_KVM works on arm/arm64. Signed-off-by: Jianyong Wu --- Documentation/virt/kvm/api.rst | 9 +++ Documentation/virt/kvm/arm

[PATCH v15 0/9] Enable ptp_kvm for arm/arm64

2020-11-10 Thread Jianyong Wu
part and reconsitution. [1] https://patchwork.kernel.org/cover/11373351/ Jianyong Wu (6): ptp: Reorganize ptp_kvm module to make it arch-independent. clocksource: Add clocksource id for arm arch counter arm64/kvm: Add hypercall service for kvm ptp. ptp: arm/arm64: Enable ptp_kvm for arm/ar

RE: [PATCH v14 08/10] ptp: arm64: Enable ptp_kvm for arm64

2020-09-07 Thread Jianyong Wu
> -Original Message- > From: Marc Zyngier > Sent: Monday, September 7, 2020 5:47 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > richardco

RE: [PATCH v14 08/10] ptp: arm64: Enable ptp_kvm for arm64

2020-09-07 Thread Jianyong Wu
> -Original Message- > From: Marc Zyngier > Sent: Monday, September 7, 2020 4:55 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > richardco

RE: [PATCH v14 08/10] ptp: arm64: Enable ptp_kvm for arm64

2020-09-07 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Saturday, September 5, 2020 7:33 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.

RE: [PATCH v14 08/10] ptp: arm64: Enable ptp_kvm for arm64

2020-09-07 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Saturday, September 5, 2020 7:02 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.

RE: [PATCH v14 07/10] arm64/kvm: Add hypercall service for kvm ptp.

2020-09-07 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Saturday, September 5, 2020 7:04 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.

RE: [PATCH v14 07/10] arm64/kvm: Add hypercall service for kvm ptp.

2020-09-07 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Saturday, September 5, 2020 12:15 AM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.

RE: [PATCH v14 09/10] doc: add ptp_kvm introduction for arm64 support

2020-09-07 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Saturday, September 5, 2020 12:19 AM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.

[PATCH v14 05/10] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-09-04 Thread Jianyong Wu
take the snapshot and act accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Jianyong Wu --- include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 11 +++ include/linux/timekeeping.h | 12 +++- kernel/time/clocksource.c | 2 ++ kernel

[PATCH v14 09/10] doc: add ptp_kvm introduction for arm64 support

2020-09-04 Thread Jianyong Wu
ptp_kvm implementation depends on hypercall using SMCCC. So we introduce a new SMCCC service ID. This doc explain how we define and use this new ID. Signed-off-by: Jianyong Wu --- Documentation/virt/kvm/arm/ptp_kvm.rst | 72 ++ 1 file changed, 72 insertions(+) create

[PATCH v14 08/10] ptp: arm64: Enable ptp_kvm for arm64

2020-09-04 Thread Jianyong Wu
-4ns * PHC00 3 377 8 +4ns[ +5ns] +/-4ns The PHC0 is the ptp clock which choose the host clock as its source clock. So we can see that the clock difference between host and guest is in order of ns. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_ar

[PATCH v14 03/10] smccc: Export smccc conduit get helper.

2020-09-04 Thread Jianyong Wu
Export arm_smccc_1_1_get_conduit then modules can use smccc helper which adopts it. Acked-by: Mark Rutland Signed-off-by: Jianyong Wu --- drivers/firmware/smccc/smccc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c index

[PATCH v14 04/10] ptp: Reorganize ptp_kvm module to make it arch-independent.

2020-09-04 Thread Jianyong Wu
Currently, ptp_kvm modules implementation is only for x86 which includs large part of arch-specific code. This patch move all of those code into new arch related file in the same directory. Signed-off-by: Jianyong Wu --- drivers/ptp/Makefile| 5 ++ drivers/ptp

[PATCH v14 06/10] clocksource: Add clocksource id for arm arch counter

2020-09-04 Thread Jianyong Wu
Add clocksource id for arm arch counter to let it be identified easily and elegantly in ptp_kvm implementation for arm. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c | 2 ++ include/linux/clocksource_ids.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[PATCH v14 10/10] arm64: Add kvm capability check extension for ptp_kvm

2020-09-04 Thread Jianyong Wu
Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 4 include/uapi/linux/kvm.h | 1 + 2

[PATCH v14 07/10] arm64/kvm: Add hypercall service for kvm ptp.

2020-09-04 Thread Jianyong Wu
ptp_kvm will get this service through smccc call. The service offers wall time and counter cycle of host for guest. caller must explicitly determines which cycle of virtual counter or physical counter to return if it needs counter cycle. Signed-off-by: Jianyong Wu --- arch/arm64/kvm/Kconfig

[PATCH v14 02/10] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-09-04 Thread Jianyong Wu
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 29 +++-- 1

[PATCH v14 01/10] arm64: Probe for the presence of KVM hypervisor services during boot

2020-09-04 Thread Jianyong Wu
tible with KVM. Once this has been established, additional services can be discovered via a feature bitmap. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/include/asm/hypervisor.h | 11 + arch/arm64/kernel/setup.c

[PATCH v14 00/10] Enable ptp_kvm for arm64

2020-09-04 Thread Jianyong Wu
separate ptp_kvm code for arm64 into hypervisor part and guest part. (4) add API to expose monotonic clock and counter value. (5) refine code: remove no necessary part and reconsitution. [1] https://patchwork.kernel.org/cover/11373351/ Jianyong Wu (9): arm64: Probe for the pres

RE: [PATCH v13 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-07-27 Thread Jianyong Wu
> -Original Message- > From: Will Deacon > Sent: Monday, July 27, 2020 7:38 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > m...@ke

RE: [PATCH v13 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-07-26 Thread Jianyong Wu
Hi Will, > -Original Message- > From: Jianyong Wu > Sent: Friday, June 19, 2020 9:01 PM > To: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > m...@kernel.org; richardcoch.

RE: [RFC PATCH v13 7/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-06-23 Thread Jianyong Wu
Hi steven, > -Original Message- > From: Steven Price > Sent: Monday, June 22, 2020 5:51 PM > To: Jianyong Wu ; netdev@vger.kernel.org; > yangbo...@nxp.com; john.stu...@linaro.org; t...@linutronix.de; > pbonz...@redhat.com; sean.j.christopher...@intel.com; m...@kernel.

RE: [RFC PATCH v13 7/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-06-21 Thread Jianyong Wu
Hi Steven, > -Original Message- > From: Steven Price > Sent: Friday, June 19, 2020 6:45 PM > To: Jianyong Wu ; netdev@vger.kernel.org; > yangbo...@nxp.com; john.stu...@linaro.org; t...@linutronix.de; > pbonz...@redhat.com; sean.j.christopher...@intel.com; m...@kernel.

RE: [PATCH v13 3/9] smccc: Export smccc conduit get helper.

2020-06-21 Thread Jianyong Wu
Hi Christoph, > -Original Message- > From: Christoph Hellwig > Sent: Friday, June 19, 2020 9:57 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com;

[PATCH v13 3/9] smccc: Export smccc conduit get helper.

2020-06-19 Thread Jianyong Wu
Export arm_smccc_1_1_get_conduit then modules can use smccc helper which adopts it. Acked-by: Mark Rutland Signed-off-by: Jianyong Wu --- drivers/firmware/smccc/smccc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c index

[PATCH v13 1/9] arm64: Probe for the presence of KVM hypervisor services during boot

2020-06-19 Thread Jianyong Wu
tible with KVM. Once this has been established, additional services can be discovered via a feature bitmap. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/include/asm/hypervisor.h | 11 + arch/arm64/kernel/setup.c

[PATCH v13 5/9] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-06-19 Thread Jianyong Wu
take the snapshot and act accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Jianyong Wu --- include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 11 +++ include/linux/timekeeping.h | 12 +++- kernel/time/clocksource.c | 3 +++ kernel

[PATCH v13 4/9] ptp: Reorganize ptp_kvm module to make it arch-independent.

2020-06-19 Thread Jianyong Wu
Currently, ptp_kvm modules implementation is only for x86 which includs large part of arch-specific code. This patch move all of those code into new arch related file in the same directory. Signed-off-by: Jianyong Wu --- drivers/ptp/Makefile| 1 + drivers/ptp/ptp_kvm.h

[PATCH v13 6/9] clocksource: Add clocksource id for arm arch counter

2020-06-19 Thread Jianyong Wu
Add clocksource id for arm arch counter to let it be identified easily and elegantly in ptp_kvm implementation for arm. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c | 2 ++ include/linux/clocksource_ids.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[PATCH v13 9/9] arm64: Add kvm capability check extension for ptp_kvm

2020-06-19 Thread Jianyong Wu
Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 4 include/uapi/linux/kvm.h | 1 + 2

[PATCH v13 7/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-06-19 Thread Jianyong Wu
ptp_kvm will get this service through smccc call. The service offers wall time and counter cycle of host for guest. caller must explicitly determines which cycle of virtual counter or physical counter to return if it needs counter cycle. Signed-off-by: Jianyong Wu --- arch/arm64/kvm/Kconfig

[PATCH v13 8/9] ptp: arm64: Enable ptp_kvm for arm64

2020-06-19 Thread Jianyong Wu
-4ns * PHC00 3 377 8 +4ns[ +5ns] +/-4ns The PHC0 is the ptp clock which choose the host clock as its source clock. So we can see that the clock difference between host and guest is in order of ns. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_ar

[PATCH v13 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-06-19 Thread Jianyong Wu
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 29 +++-- 1

[PATCH v13 0/9] Enable ptp_kvm for arm64

2020-06-19 Thread Jianyong Wu
refine code: remove no necessary part and reconsitution. [1] https://patchwork.kernel.org/cover/11373351/ Jianyong Wu (7): arm/arm64: KVM: Advertise KVM UID to guests via SMCCC smccc: export smccc conduit get helper. ptp: Reorganize ptp_kvm modules to make it arch-independent. clocksource: Add

[RFC PATCH v13 4/9] ptp: Reorganize ptp_kvm module to make it arch-independent.

2020-06-19 Thread Jianyong Wu
Currently, ptp_kvm modules implementation is only for x86 which includs large part of arch-specific code. This patch move all of those code into new arch related file in the same directory. Signed-off-by: Jianyong Wu --- drivers/ptp/Makefile| 1 + drivers/ptp/ptp_kvm.h

[RFC PATCH v13 6/9] clocksource: Add clocksource id for arm arch counter

2020-06-19 Thread Jianyong Wu
Add clocksource id for arm arch counter to let it be identified easily and elegantly in ptp_kvm implementation for arm. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c | 2 ++ include/linux/clocksource_ids.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[RFC PATCH v13 7/9] arm64/kvm: Add hypercall service for kvm ptp.

2020-06-19 Thread Jianyong Wu
ptp_kvm will get this service through smccc call. The service offers wall time and counter cycle of host for guest. caller must explicitly determines which cycle of virtual counter or physical counter to return if it needs counter cycle. Signed-off-by: Jianyong Wu --- arch/arm64/kvm/Kconfig

[RFC PATCH v13 8/9] ptp: arm64: Enable ptp_kvm for arm64

2020-06-19 Thread Jianyong Wu
-4ns * PHC00 3 377 8 +4ns[ +5ns] +/-4ns The PHC0 is the ptp clock which choose the host clock as its source clock. So we can see that the clock difference between host and guest is in order of ns. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_ar

[RFC PATCH v13 9/9] arm64: Add kvm capability check extension for ptp_kvm

2020-06-19 Thread Jianyong Wu
Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- arch/arm64/kvm/arm.c | 4 include/uapi/linux/kvm.h | 1 + 2

[RFC PATCH v13 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-06-19 Thread Jianyong Wu
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/kvm/hypercalls.c | 29 +++-- 1

[RFC PATCH v13 5/9] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-06-19 Thread Jianyong Wu
take the snapshot and act accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Jianyong Wu --- include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 11 +++ include/linux/timekeeping.h | 12 +++- kernel/time/clocksource.c | 3 +++ kernel

[PATCH v13 3/9] smccc: Export smccc conduit get helper.

2020-06-19 Thread Jianyong Wu
Export arm_smccc_1_1_get_conduit then modules can use smccc helper which adopts it. Acked-by: Mark Rutland Signed-off-by: Jianyong Wu --- drivers/firmware/smccc/smccc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/smccc/smccc.c b/drivers/firmware/smccc/smccc.c index

[RFC PATCH v13 0/9] Enable ptp_kvm for arm64

2020-06-19 Thread Jianyong Wu
refine code: remove no necessary part and reconsitution. [1] https://patchwork.kernel.org/cover/11373351/ Jianyong Wu (7): arm/arm64: KVM: Advertise KVM UID to guests via SMCCC smccc: export smccc conduit get helper. ptp: Reorganize ptp_kvm modules to make it arch-independent. clocksource: Add

[RFC PATCH v13 1/9] arm64: Probe for the presence of KVM hypervisor services during boot

2020-06-19 Thread Jianyong Wu
tible with KVM. Once this has been established, additional services can be discovered via a feature bitmap. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/include/asm/hypervisor.h | 11 + arch/arm64/kernel/setup.c

RE: [RFC PATCH v12 05/11] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-05-28 Thread Jianyong Wu
Hi Thomas, > -Original Message- > From: Thomas Gleixner > Sent: Friday, May 29, 2020 12:36 AM > To: Jianyong Wu ; netdev@vger.kernel.org; > yangbo...@nxp.com; john.stu...@linaro.org; pbonz...@redhat.com; > sean.j.christopher...@intel.com; m...@kernel.org; > richardco

RE: [RFC PATCH v12 07/11] psci: Add hypercall service for kvm ptp.

2020-05-26 Thread Jianyong Wu
Hi Steven, > -Original Message- > From: Steven Price > Sent: Tuesday, May 26, 2020 7:02 PM > To: Jianyong Wu ; netdev@vger.kernel.org; > yangbo...@nxp.com; john.stu...@linaro.org; t...@linutronix.de; > pbonz...@redhat.com; sean.j.christopher...@intel.com; m...@kernel.

RE: [RFC PATCH v12 03/11] psci: export smccc conduit get helper.

2020-05-26 Thread Jianyong Wu
Hi Sudeep, > -Original Message- > From: Sudeep Holla > Sent: Tuesday, May 26, 2020 6:10 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com;

RE: [RFC PATCH v12 10/11] arm64: add mechanism to let user choose which counter to return

2020-05-25 Thread Jianyong Wu
Hi Marc, > -Original Message- > From: Marc Zyngier > Sent: Monday, May 25, 2020 5:17 PM > To: Richard Cochran ; Jianyong Wu > > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher

RE: [RFC PATCH v12 10/11] arm64: add mechanism to let user choose which counter to return

2020-05-24 Thread Jianyong Wu
Hi Richard, > -Original Message- > From: Richard Cochran > Sent: Monday, May 25, 2020 2:16 PM > To: Jianyong Wu > Cc: m...@kernel.org; netdev@vger.kernel.org; yangbo...@nxp.com; > john.stu...@linaro.org; t...@linutronix.de; pbonz...@redhat.com; > sean.j.christoph

RE: [RFC PATCH v12 10/11] arm64: add mechanism to let user choose which counter to return

2020-05-24 Thread Jianyong Wu
Hi Richard, > -Original Message- > From: Richard Cochran > Sent: Sunday, May 24, 2020 10:11 AM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; >

RE: [RFC PATCH v12 07/11] psci: Add hypercall service for kvm ptp.

2020-05-24 Thread Jianyong Wu
Hi Steven, > -Original Message- > From: Steven Price > Sent: Friday, May 22, 2020 10:18 PM > To: Jianyong Wu ; netdev@vger.kernel.org; > yangbo...@nxp.com; john.stu...@linaro.org; t...@linutronix.de; > pbonz...@redhat.com; sean.j.christopher...@intel.com; m...@kernel.

RE: [RFC PATCH v12 03/11] psci: export smccc conduit get helper.

2020-05-24 Thread Jianyong Wu
Hi Sudeep, > -Original Message- > From: Sudeep Holla > Sent: Friday, May 22, 2020 9:12 PM > To: Jianyong Wu > Cc: netdev@vger.kernel.org; yangbo...@nxp.com; john.stu...@linaro.org; > t...@linutronix.de; pbonz...@redhat.com; sean.j.christopher...@intel.com; > m...@ke

[RFC PATCH v12 11/11] arm64: Add kvm capability check extension for ptp_kvm

2020-05-22 Thread Jianyong Wu
Let userspace check if there is kvm ptp service in host. Before VMs migrate to another host, VMM may check if this cap is available to determine the next behavior. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- include/uapi/linux/kvm.h | 1 + virt/kvm/arm/arm.c | 1 + 2 files

[RFC PATCH v12 09/11] ptp: extend input argument for getcrosstimestamp API

2020-05-22 Thread Jianyong Wu
sometimes we may need tell getcrosstimestamp call back how to perform itself. Extending input arguments for getcrosstimestamp API to offer more exquisite control for the operation. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c| 2 +- drivers/net/ethernet/intel/e1000e

[RFC PATCH v12 10/11] arm64: add mechanism to let user choose which counter to return

2020-05-22 Thread Jianyong Wu
return by default. Signed-off-by: Jianyong Wu Suggested-by: Marc Zyngier --- drivers/clocksource/arm_arch_timer.c | 13 - drivers/ptp/ptp_chardev.c| 25 + drivers/ptp/ptp_kvm_common.c | 7 --- include/uapi/linux/ptp_clock.h | 4

[RFC PATCH v12 08/11] ptp: arm64: Enable ptp_kvm for arm/arm64

2020-05-22 Thread Jianyong Wu
-4ns * PHC00 3 377 8 +4ns[ +5ns] +/-4ns The PHC0 is the ptp clock which choose the host clock as its source clock. So we can be sure to say that the clock error between host and guest is in order of ns. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_ar

[RFC PATCH v12 03/11] psci: export smccc conduit get helper.

2020-05-22 Thread Jianyong Wu
Export arm_smccc_1_1_get_conduit then modules can use smccc helper which adopts it. Acked-by: Mark Rutland Signed-off-by: Jianyong Wu --- drivers/firmware/psci/psci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index

[RFC PATCH v12 04/11] ptp: Reorganize ptp_kvm modules to make it arch-independent.

2020-05-22 Thread Jianyong Wu
Currently, ptp_kvm modules implementation is only for x86 which includs large part of arch-specific code. This patch move all of those code into new arch related file in the same directory. Signed-off-by: Jianyong Wu --- drivers/ptp/Makefile| 1 + drivers/ptp/ptp_kvm.h

[RFC PATCH v12 07/11] psci: Add hypercall service for kvm ptp.

2020-05-22 Thread Jianyong Wu
ptp_kvm modules will get this service through smccc call. The service offers real time and counter cycle of host for guest. Also let caller determine which cycle of virtual counter or physical counter to return. Signed-off-by: Jianyong Wu --- include/linux/arm-smccc.h | 14 virt

[RFC PATCH v12 05/11] time: Add mechanism to recognize clocksource in time_get_snapshot

2020-05-22 Thread Jianyong Wu
take the snapshot and act accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Jianyong Wu --- include/linux/clocksource.h | 6 ++ include/linux/clocksource_ids.h | 11 +++ include/linux/timekeeping.h | 12 +++- kernel/time/clocksource.c | 3 +++ kernel

[RFC PATCH v12 0/11] Enable ptp_kvm for arm64

2020-05-22 Thread Jianyong Wu
ptp_kvm service is available. (3) separate ptp_kvm code for arm64 into hypervisor part and guest part. (4) add API to expose monotonic clock and counter value. (5) refine code: remove no necessary part and reconsitution. [1] https://patchwork.kernel.org/cover/11373351/ Jian

[RFC PATCH v12 06/11] clocksource: Add clocksource id for arm arch counter

2020-05-22 Thread Jianyong Wu
Add clocksource id for arm arch counter to let it be identified easily and elegantly in ptp_kvm implementation for arm. Signed-off-by: Jianyong Wu --- drivers/clocksource/arm_arch_timer.c | 2 ++ include/linux/clocksource_ids.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers

[RFC PATCH v12 01/11] arm64: Probe for the presence of KVM hypervisor services during boot

2020-05-22 Thread Jianyong Wu
tible with KVM. Once this has been established, additional services can be discovered via a feature bitmap. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- arch/arm64/include/asm/hypervisor.h | 11 + arch/arm64/kernel/setup.c

[RFC PATCH v12 02/11] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC

2020-05-22 Thread Jianyong Wu
From: Will Deacon We can advertise ourselves to guests as KVM and provide a basic features bitmap for discoverability of future hypervisor services. Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Jianyong Wu --- virt/kvm/arm/hypercalls.c | 29 +++-- 1

Re: [RFC PATCH v11 5/9] psci: Add hypercall service for ptp_kvm.

2020-05-02 Thread Jianyong Wu
On 2020/4/30 6:36 PM, Mark Rutland wrote: > On Tue, Apr 28, 2020 at 07:14:52AM +0100, Jianyong Wu wrote: >> On 2020/4/24 6:39 PM, Mark Rutland wrote: >>> On Fri, Apr 24, 2020 at 03:50:22AM +0100, Jianyong Wu wrote: >>>> On 2020/4/21 5:57 PM, Mark Rutland wrote: >&