RE: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread zhukeqian
Hi, Cheers for these discussion. :) I am on vacation, and will come back at 2.18. Thanks, Keqian On 21-02-07 18:40:36, Keqian Zhu wrote: > Hi Yi, > > On 2021/2/7 17:56, Yi Sun wrote: > > Hi, > > > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > > > [...] > > > >> +static void

Re: [PATCH 4/7] vfio: iommu_type1: Fix missing dirty page when promote pinned_scope

2020-12-15 Thread zhukeqian
Hi Alex, On 2020/12/15 8:04, Alex Williamson wrote: > On Thu, 10 Dec 2020 15:34:22 +0800 > Keqian Zhu wrote: > >> When we pin or detach a group which is not dirty tracking capable, >> we will try to promote pinned_scope of vfio_iommu. >> >> If we succeed to do so, vfio only report pinned_scope

Re: [PATCH 1/7] vfio: iommu_type1: Clear added dirty bit when unwind pin

2020-12-10 Thread zhukeqian
On 2020/12/11 3:16, Alex Williamson wrote: > On Thu, 10 Dec 2020 15:34:19 +0800 > Keqian Zhu wrote: > >> Currently we do not clear added dirty bit of bitmap when unwind >> pin, so if pin failed at halfway, we set unnecessary dirty bit >> in bitmap. Clearing added dirty bit when unwind pin,

Re: [PATCH v2 1/2] clocksource: arm_arch_timer: Use stable count reader in erratum sne

2020-12-03 Thread zhukeqian
Hi Marc, On 2020/12/3 22:58, Marc Zyngier wrote: > On 2020-08-18 04:28, Keqian Zhu wrote: >> In commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use >> arch_timer_read_counter >> to access stable counters"), we separate stable and normal count reader to >> omit >> unnecessary overhead on

Re: [PATCH v2 2/2] clocksource: arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI

2020-12-03 Thread zhukeqian
Hi Marc, On 2020/12/3 22:57, Marc Zyngier wrote: > On 2020-08-18 04:28, Keqian Zhu wrote: >> ARM virtual counter supports event stream, it can only trigger an event >> when the trigger bit (the value of CNTKCTL_EL1.EVNTI) of CNTVCT_EL0 changes, >> so the actual period of event stream is

Re: [PATCH v2 1/2] KVM: arm64: Some fixes of PV-time interface document

2020-12-03 Thread zhukeqian
On 2020/12/3 23:04, Marc Zyngier wrote: > On 2020-08-17 12:07, Keqian Zhu wrote: >> Rename PV_FEATURES to PV_TIME_FEATURES. >> >> Signed-off-by: Keqian Zhu >> Reviewed-by: Andrew Jones >> Reviewed-by: Steven Price >> --- >> Documentation/virt/kvm/arm/pvtime.rst | 6 +++--- >> 1 file

Re: [PATCH v2 0/2] clocksource: arm_arch_timer: Some fixes

2020-12-03 Thread zhukeqian
Hi Marc, Found that this bugfix series is not applied for now. Does it need some modification? Wish you can pick it up :-) Thanks, Keqian On 2020/8/18 11:28, Keqian Zhu wrote: > change log: > > v2: > - Do not revert commit 0ea415390cd3, fix it instead. > - Correct the tags of second patch. >

Re: [PATCH v2 0/2] KVM: arm64: Some fixes and code adjustments for pvtime ST

2020-12-03 Thread zhukeqian
Hi Marc, Found that this series is not applied for now. Does it need some modification? Wish you can pick it up :-) Thanks, Keqian On 2020/8/17 19:07, Keqian Zhu wrote: > During picking up pvtime LPT support for arm64, I do some trivial fixes for > pvtime ST. > > change log: > > v2: > - Add

Re: [RFC PATCH 0/5] KVM: arm64: Add pvtime LPT support

2020-09-06 Thread zhukeqian
Hi Marc and Steven, On 2020/9/2 18:09, Steven Price wrote: > Hi Marc, > > Sorry for the slow response, I've been on holiday. > > On 22/08/2020 11:31, Marc Zyngier wrote: >> Hi Steven, >> >> On Wed, 19 Aug 2020 09:54:40 +0100, >> Steven Price wrote: >>> >>> On 18/08/2020 15:41, Marc Zyngier

Re: [RFC PATCH 0/5] KVM: arm64: Add pvtime LPT support

2020-08-20 Thread zhukeqian
On 2020/8/19 16:54, Steven Price wrote: > On 18/08/2020 15:41, Marc Zyngier wrote: >> On 2020-08-17 09:41, Keqian Zhu wrote: >>> Hi all, >>> >>> This patch series picks up the LPT pvtime feature originally developed >>> by Steven Price: https://patchwork.kernel.org/cover/10726499/ >>> >>>

Re: [PATCH 2/2] clocksource: arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI

2020-08-17 Thread zhukeqian
Hi Marc, On 2020/8/17 20:56, Marc Zyngier wrote: > On 2020-08-17 13:24, Keqian Zhu wrote: >> ARM virtual counter supports event stream, it can only trigger an event >> when the trigger bit (the value of CNTKCTL_EL1.EVNTI) of CNTVCT_EL0 changes, >> so the actual period of event stream is

Re: [PATCH 1/2] clocksource: arm_arch_timer: Simplify and fix count reader code logic

2020-08-17 Thread zhukeqian
Hi Marc, On 2020/8/17 20:52, Marc Zyngier wrote: > On 2020-08-17 13:24, Keqian Zhu wrote: >> In commit 0ea415390cd3 (clocksource/arm_arch_timer: Use >> arch_timer_read_counter >> to access stable counters), we separate stable and normal count reader. >> Actually >> the stable reader can

Re: [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type

2020-08-17 Thread zhukeqian
Hi Steven, On 2020/8/17 17:49, Steven Price wrote: > On 17/08/2020 09:43, zhukeqian wrote: >> Hi Marc, >> [...] >>> >>> It is pretty unfortunate that PV time has turned into such a train wreck, >>> but that's what we have now, and it has to stay

Re: [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document

2020-08-17 Thread zhukeqian
Hi Andrew, On 2020/8/17 16:47, Andrew Jones wrote: > On Mon, Aug 17, 2020 at 11:37:27AM +0800, Keqian Zhu wrote: >> Rename PV_FEATURES tp PV_TIME_FEATURES >> >> Signed-off-by: Keqian Zhu >> --- >> Documentation/virt/kvm/arm/pvtime.rst | 6 +++--- >> 1 file changed, 3 insertions(+), 3

Re: [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type

2020-08-17 Thread zhukeqian
Hi Marc, On 2020/8/17 15:39, Marc Zyngier wrote: > On 2020-08-17 04:37, Keqian Zhu wrote: >> ARM64 PV-time ST is configured by userspace through vCPU attribute, >> and KVM_DEV_TYPE_ARM_PV_TIME is unused. >> >> Signed-off-by: Keqian Zhu >> --- >> include/uapi/linux/kvm.h | 2 -- >>

Re: [PATCH 0/9] arm64: Stolen time support

2020-07-28 Thread zhukeqian
Hi Steven, On 2020/7/27 18:48, Steven Price wrote: > On 21/07/2020 04:26, zhukeqian wrote: >> Hi Steven, > > Hi Keqian, > >> On 2019/8/2 22:50, Steven Price wrote: >>> This series add support for paravirtualized time for arm64 guests and >>> KVM

Re: [RESEND PATCH] drivers: arm arch timer: Correct fault programming of CNTKCTL_EL1.EVNTI

2020-07-28 Thread zhukeqian
Hi Marc, On 2020/7/28 18:16, Marc Zyngier wrote: > On 2020-07-17 10:21, Keqian Zhu wrote: >> ARM virtual counter supports event stream. It can only trigger an event >> when the trigger bit of CNTVCT_EL0 changes from 0 to 1 (or from 1 to 0), >> so the actual period of event stream is 2 ^

Re: [PATCH v2 0/8] KVM: arm64: Support HW dirty log based on DBM

2020-07-28 Thread zhukeqian
Hi Marc, On 2020/7/28 15:52, Marc Zyngier wrote: > On 2020-07-28 03:11, zhukeqian wrote: >> Hi Marc, > > [...] > >>> But you are still reading the leaf entries of the PTs, hence defeating >>> any sort of prefetch that the CPU could do for you. And my claim is

Re: [RESEND PATCH] drivers: arm arch timer: Correct fault programming of CNTKCTL_EL1.EVNTI

2020-07-28 Thread zhukeqian
Friendly ping. Is this an effective bugfix? On 2020/7/17 17:21, Keqian Zhu wrote: > ARM virtual counter supports event stream. It can only trigger an event > when the trigger bit of CNTVCT_EL0 changes from 0 to 1 (or from 1 to 0), > so the actual period of event stream is 2 ^ (cntkctl_evnti + 1).

Re: [PATCH v2 0/8] KVM: arm64: Support HW dirty log based on DBM

2020-07-27 Thread zhukeqian
Hi Marc, On 2020/7/13 22:53, Marc Zyngier wrote: > Hi Keqian, > > On Mon, 13 Jul 2020 03:47:25 +0100, > zhukeqian wrote: >> >> Hi Marc, >> >> Sorry for the delay reply. >> >> On 2020/7/6 15:54, Marc Zyngier wrote: >>> Hi Keqian, >

Re: [PATCH 0/9] arm64: Stolen time support

2020-07-20 Thread zhukeqian
Hi Steven, On 2019/8/2 22:50, Steven Price wrote: > This series add support for paravirtualized time for arm64 guests and > KVM hosts following the specification in Arm's document DEN 0057A: > > https://developer.arm.com/docs/den0057/a > > It implements support for stolen time, allowing the

Re: [Question] About scaling factor of Enhanced Counter Virtualization

2020-07-14 Thread zhukeqian
On 2020/7/14 20:23, Marc Zyngier wrote: > On 2020-07-14 13:15, zhukeqian wrote: >> Hi Marc, >> >> On 2020/7/14 19:34, Marc Zyngier wrote: >>> Hi Keqian, >>> >>> On 2020-07-14 03:20, zhukeqian wrote: >>>> Hi all, >>>> >

Re: [Question] About scaling factor of Enhanced Counter Virtualization

2020-07-14 Thread zhukeqian
Hi Marc, On 2020/7/14 19:34, Marc Zyngier wrote: > Hi Keqian, > > On 2020-07-14 03:20, zhukeqian wrote: >> Hi all, >> >> We are studying Enhanced Counter Virtualization (introduced by ARMv8.6 >> extension), and here is a question >> raised by Biaoxi

[Question] About scaling factor of Enhanced Counter Virtualization

2020-07-13 Thread zhukeqian
Hi all, We are studying Enhanced Counter Virtualization (introduced by ARMv8.6 extension), and here is a question raised by Biaoxiang Ye : Described in the ARMv8.6 Extension Specification: Note: the scaling factor CNTSCALE is designed as a 2.62 bit fixed point number, so permitting a scaling

Re: [PATCH v2 0/8] KVM: arm64: Support HW dirty log based on DBM

2020-07-12 Thread zhukeqian
Hi Marc, Sorry for the delay reply. On 2020/7/6 15:54, Marc Zyngier wrote: > Hi Keqian, > > On 2020-07-06 02:28, zhukeqian wrote: >> Hi Catalin and Marc, >> >> On 2020/7/2 21:55, Keqian Zhu wrote: >>> This patch series add support for dirty log based on HW D

Re: [PATCH v2 0/8] KVM: arm64: Support HW dirty log based on DBM

2020-07-05 Thread zhukeqian
Hi Catalin and Marc, On 2020/7/2 21:55, Keqian Zhu wrote: > This patch series add support for dirty log based on HW DBM. > > It works well under some migration test cases, including VM with 4K > pages or 2M THP. I checked the SHA256 hash digest of all memory and > they keep same for source VM

Re: [PATCH v2 6/8] KVM: arm64: Add KVM_CAP_ARM_HW_DIRTY_LOG capability

2020-07-05 Thread zhukeqian
Hi, On 2020/7/2 21:55, Keqian Zhu wrote: > For that using arm64 DBM to log dirty pages has the side effect > of long time dirty log sync, we should give userspace opportunity > to enable or disable this feature, to realize some policy. > > This feature is disabled by default. > > Signed-off-by:

Re: [PATCH 03/12] KVM: arm64: Report hardware dirty status of stage2 PTE if coverred

2020-07-02 Thread zhukeqian
Hi Steven, On 2020/7/1 19:28, Steven Price wrote: > Hi, > > On 16/06/2020 10:35, Keqian Zhu wrote: >> kvm_set_pte is called to replace a target PTE with a desired one. >> We always do this without changing the desired one, but if dirty >> status set by hardware is coverred, let caller know it.

Re: [PATCH 00/12] KVM: arm64: Support stage2 hardware DBM

2020-06-17 Thread zhukeqian
Hi, On 2020/6/16 17:35, Keqian Zhu wrote: > This patch series add support for stage2 hardware DBM, and it is only > used for dirty log for now. > > It works well under some migration test cases, including VM with 4K > pages or 2M THP. I checked the SHA256 hash digest of all memory and > they

Re: [PATCH RFC] KVM: arm64: Sidestep stage2_unmap_vm() on vcpu reset when S2FWB is supported

2020-06-01 Thread zhukeqian
Hi Marc, On 2020/5/31 0:31, Marc Zyngier wrote: > Hi Alex, > > On 2020-05-30 11:46, Alexandru Elisei wrote: >> Hi, > > [...] > diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 48d0ec44ad77..e6378162cdef 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c

Re: [RFC PATCH 2/7] KVM: arm64: Set DBM bit of PTEs if hw DBM enabled

2020-05-27 Thread zhukeqian
Hi Catalin, On 2020/5/26 19:49, Catalin Marinas wrote: > On Mon, May 25, 2020 at 07:24:01PM +0800, Keqian Zhu wrote: >> diff --git a/arch/arm64/include/asm/pgtable-prot.h >> b/arch/arm64/include/asm/pgtable-prot.h >> index 1305e28225fc..f9910ba2afd8 100644 >> ---

Re: [RFC PATCH 0/7] kvm: arm64: Support stage2 hardware DBM

2020-05-25 Thread zhukeqian
Hi Marc, On 2020/5/25 23:44, Marc Zyngier wrote: > On 2020-05-25 12:23, Keqian Zhu wrote: >> This patch series add support for stage2 hardware DBM, and it is only >> used for dirty log for now. >> >> It works well under some migration test cases, including VM with 4K >> pages or 2M THP. I checked

Re: [Question] Hardware management of stage2 page dirty state

2020-05-14 Thread zhukeqian
Hi Catalin, On 2020/5/15 0:14, Catalin Marinas wrote: > Hi Keqian, > > On Thu, May 14, 2020 at 05:16:52PM +0800, zhukeqian wrote: >> I have some questions after deep reading your patch >> https://patchwork.kernel.org/patch/8824261/ which enables hardware updates >> of

[Question] Hardware management of stage2 page dirty state

2020-05-14 Thread zhukeqian
Hi Catalin, I have some questions after deep reading your patch https://patchwork.kernel.org/patch/8824261/ which enables hardware updates of the Access Flag for Stage 2 page tables. I notice that at the bottom of commit message, you said the following words: "After some digging through the KVM

Re: [PATCH v2] KVM/arm64: Support enabling dirty log gradually in small chunks

2020-04-17 Thread zhukeqian
Hi Marc, On 2020/4/16 23:08, Marc Zyngier wrote: > On Mon, 13 Apr 2020 20:20:23 +0800 > Keqian Zhu wrote: > >> There is already support of enabling dirty log graually in small chunks > > gradually > >> for x86 in commit 3c9bd4006bfc ("KVM: x86: enable dirty log gradually in >> small chunks").

Re: [PATCH v2] KVM/arm64: Support enabling dirty log gradually in small chunks

2020-04-17 Thread zhukeqian
Hi Paolo, On 2020/4/16 23:55, Paolo Bonzini wrote: > On 16/04/20 17:09, Marc Zyngier wrote: >> On Wed, 15 Apr 2020 18:13:56 +0200 >> Paolo Bonzini wrote: >> >>> On 13/04/20 14:20, Keqian Zhu wrote: There is already support of enabling dirty log graually in small chunks for x86 in

Re: [PATCH v2] KVM/arm64: Support enabling dirty log gradually in small chunks

2020-04-15 Thread zhukeqian
Hi Marc, In RFC patch, I still write protect huge pages when DIRTY_LOG_INITIALLY_ALL_SET is enabled by userspace. I find that both huge pages and normal pages can be write protected during log clear. So this formal patch is pretty simple now. Thanks, Keqian On 2020/4/13 20:20, Keqian Zhu wrote:

Re: [RFC] KVM: arm64: support enabling dirty log graually in small chunks

2020-03-11 Thread zhukeqian
Hi Jay, On 2020/3/11 15:34, Zhoujian (jay) wrote: > > >> -Original Message----- >> From: zhukeqian >> Sent: Wednesday, March 11, 2020 3:20 PM >> To: Marc Zyngier >> Cc: kvmarm@lists.cs.columbia.edu; k...@vger.kernel.org; >> linux-ker...@vger.kernel

Re: [RFC] KVM: arm64: support enabling dirty log graually in small chunks

2020-03-11 Thread zhukeqian
Hi Marc, On 2020/3/10 21:16, Marc Zyngier wrote: > On 2020-03-10 08:26, zhukeqian wrote: >> Hi Marc, >> >> On 2020/3/9 19:45, Marc Zyngier wrote: >>> Kegian, > > [...] > >>> Is there a userspace counterpart to it? >>> >> As this KVM

Re: [RFC] KVM: arm64: support enabling dirty log graually in small chunks

2020-03-10 Thread zhukeqian
Hi Marc, On 2020/3/9 19:45, Marc Zyngier wrote: > Kegian, > > In the future, please Cc me on your KVM/arm64 patches, as well as > all the reviewers mentioned in the MAINTAINERS file. > > On 2020-03-09 08:57, Keqian Zhu wrote: >> There is already support of enabling dirty log graually > >