Re: disabling halt polling broken? (was Re: [PATCH 00/14] KVM: Halt-polling fixes, cleanups and a new stat)

2022-11-17 Thread wangyanan (Y)
On 2022/11/17 1:19, David Matlack wrote: On Tue, Nov 15, 2022 at 11:28:56AM +0800, wangyanan (Y) wrote: Hi Sean, Paolo, I recently also notice the behavior change of param halt_poll_ns. Now it loses the ability to: 1) dynamically disable halt polling for all the running VMs by `echo 0

Re: disabling halt polling broken? (was Re: [PATCH 00/14] KVM: Halt-polling fixes, cleanups and a new stat)

2022-11-14 Thread wangyanan (Y)
Hi Sean, Paolo, I recently also notice the behavior change of param halt_poll_ns. Now it loses the ability to: 1) dynamically disable halt polling for all the running VMs by `echo 0 > /sys` 2) dynamically adjust the halt polling interval for all the running VMs by `echo * > /sys` While in our ca

Re: [PATCH v7 3/4] KVM: arm64: Tweak parameters of guest cache maintenance functions

2021-06-18 Thread wangyanan (Y)
On 2021/6/18 19:30, Marc Zyngier wrote: On Thu, 17 Jun 2021 11:58:23 +0100, Yanan Wang wrote: Adjust the parameter "kvm_pfn_t pfn" of __clean_dcache_guest_page and __invalidate_icache_guest_page to "void *va", which paves the way for converting these two guest CMO functions into callbacks in

Re: [PATCH v7 1/4] KVM: arm64: Introduce two cache maintenance callbacks

2021-06-17 Thread wangyanan (Y)
On 2021/6/17 22:20, Marc Zyngier wrote: On Thu, 17 Jun 2021 13:38:37 +0100, Will Deacon wrote: On Thu, Jun 17, 2021 at 06:58:21PM +0800, Yanan Wang wrote: To prepare for performing CMOs for guest stage-2 in the fault handlers in pgtable.c, here introduce two cache maintenance callbacks in s

Re: [PATCH v6 1/4] KVM: arm64: Introduce cache maintenance callbacks for guest stage-2

2021-06-17 Thread wangyanan (Y)
Hi Marc, On 2021/6/17 16:44, Marc Zyngier wrote: On Thu, 17 Jun 2021 09:22:51 +0100, "wangyanan (Y)" wrote: On 2021/6/17 16:03, Marc Zyngier wrote: On Thu, 17 Jun 2021 07:48:29 +0100, "wangyanan (Y)" wrote: Hi Marc, On 2021/6/16 21:21, Marc Zyngier wrote: Hi Yanan,

Re: [PATCH v6 1/4] KVM: arm64: Introduce cache maintenance callbacks for guest stage-2

2021-06-17 Thread wangyanan (Y)
On 2021/6/17 16:03, Marc Zyngier wrote: On Thu, 17 Jun 2021 07:48:29 +0100, "wangyanan (Y)" wrote: Hi Marc, On 2021/6/16 21:21, Marc Zyngier wrote: Hi Yanan, On Wed, 16 Jun 2021 10:51:57 +0100, Yanan Wang wrote: To prepare for performing guest CMOs in the fault handlers in

Re: [PATCH v6 1/4] KVM: arm64: Introduce cache maintenance callbacks for guest stage-2

2021-06-16 Thread wangyanan (Y)
Hi Marc, On 2021/6/16 21:21, Marc Zyngier wrote: Hi Yanan, On Wed, 16 Jun 2021 10:51:57 +0100, Yanan Wang wrote: To prepare for performing guest CMOs in the fault handlers in pgtable.c, introduce two cache maintenance callbacks in struct kvm_pgtable_mm_ops. The new callbacks are specific for

Re: [PATCH] KVM: arm64: Fix inconsistency from function comment of __unmap_stage2_range

2021-06-15 Thread wangyanan (Y)
On 2021/6/15 17:51, Marc Zyngier wrote: On Tue, 15 Jun 2021 10:04:36 +0100, Yanan Wang wrote: Commit 'b5331379bc626' (KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set) has converted the original function name 'unmap_stage2_range' to '__unmap_stage2_range', but leaving t

Re: [PATCH] KVM: arm64: Trival coding style fixes for all vgic-related files

2021-06-15 Thread wangyanan (Y)
On 2021/6/15 17:48, Marc Zyngier wrote: On Tue, 15 Jun 2021 04:50:19 +0100, Yanan Wang wrote: These fixes introduce no functional change but just adjustment about coding style issues for ARM64 vgic code. They mainly include identation fix of function parameters/arguments, identation fix of s

Re: [PATCH v5 6/6] KVM: arm64: Distinguish cases of memcache allocations completely

2021-06-03 Thread wangyanan (Y)
Hi Quentin, On 2021/6/2 19:07, Quentin Perret wrote: On Thursday 15 Apr 2021 at 19:50:32 (+0800), Yanan Wang wrote: With a guest translation fault, the memcache pages are not needed if KVM is only about to install a new leaf entry into the existing page table. And with a guest permission fault,

Re: [PATCH v5 1/6] KVM: arm64: Introduce KVM_PGTABLE_S2_GUEST stage-2 flag

2021-06-03 Thread wangyanan (Y)
Hi Quentin, On 2021/6/2 18:43, Quentin Perret wrote: Hi Yanan, On Thursday 15 Apr 2021 at 19:50:27 (+0800), Yanan Wang wrote: diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h index c3674c47d48c..a43cbe697b37 100644 --- a/arch/arm64/include/asm/kvm_pgtab

Re: [PATCH v5 5/6] KVM: arm64: Move I-cache flush to the fault handlers

2021-06-03 Thread wangyanan (Y)
Hi Quentin, On 2021/6/2 18:58, Quentin Perret wrote: On Thursday 15 Apr 2021 at 19:50:31 (+0800), Yanan Wang wrote: In this patch, we move invalidation of I-cache to the fault handlers to Nit: please avoid using 'This patch' in commit messages, see Documentation/process/submitting-patches.rst.

Re: [PATCH v5 4/6] KVM: arm64: Provide invalidate_icache_range at non-VHE EL2

2021-06-03 Thread wangyanan (Y)
Hi Marc, On 2021/6/2 18:22, Marc Zyngier wrote: On Thu, 15 Apr 2021 12:50:30 +0100, Yanan Wang wrote: We want to move I-cache maintenance for the guest to the stage-2 page table code for performance improvement. Before it can work, we should first make function invalidate_icache_range availabl

Re: [PATCH v5 2/6] KVM: arm64: Move D-cache flush to the fault handlers

2021-06-03 Thread wangyanan (Y)
Hi Marc, On 2021/6/2 18:19, Marc Zyngier wrote: On Thu, 15 Apr 2021 12:50:28 +0100, Yanan Wang wrote: We currently uniformly permorm CMOs of D-cache and I-cache in function user_mem_abort before calling the fault handlers. If we get concurrent guest faults(e.g. translation faults, permission f

Re: [PATCH v5 0/6] KVM: arm64: Improve efficiency of stage2 page table

2021-05-12 Thread wangyanan (Y)
A really gentle ping ... Sincerely, Yanan On 2021/4/15 19:50, Yanan Wang wrote: Hi, This series makes some efficiency improvement of guest stage-2 page table code, and there are some test results to quantify the benefit. The code has been re-arranged based on the latest kvmarm/next tree. Des

Re: [PATCH v4 1/2] KVM: arm64: Move CMOs from user_mem_abort to the fault handlers

2021-04-09 Thread wangyanan (Y)
Hi Quentin, On 2021/4/9 16:08, Quentin Perret wrote: Hi Yanan, On Friday 09 Apr 2021 at 11:36:51 (+0800), Yanan Wang wrote: diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c +static void stage2_invalidate_icache(void *addr, u64 size) +{ + if (icache_is_aliasing())

Re: [RFC PATCH v3 2/2] KVM: arm64: Distinguish cases of memcache allocations completely

2021-04-08 Thread wangyanan (Y)
On 2021/4/7 23:35, Alexandru Elisei wrote: Hi Yanan, On 3/26/21 3:16 AM, Yanan Wang wrote: With a guest translation fault, the memcache pages are not needed if KVM is only about to install a new leaf entry into the existing page table. And with a guest permission fault, the memcache pages are

Re: [RFC PATCH v3 1/2] KVM: arm64: Move CMOs from user_mem_abort to the fault handlers

2021-04-08 Thread wangyanan (Y)
Hi Alex, On 2021/4/7 23:31, Alexandru Elisei wrote: Hi Yanan, On 3/26/21 3:16 AM, Yanan Wang wrote: We currently uniformly permorm CMOs of D-cache and I-cache in function user_mem_abort before calling the fault handlers. If we get concurrent guest faults(e.g. translation faults, permission fau

Re: [RFC PATCH 4/4] KVM: arm64: Distinguish cases of memcache allocations completely

2021-03-25 Thread wangyanan (Y)
Hi Alex, On 2021/3/26 1:26, Alexandru Elisei wrote: Hi Yanan, On 2/8/21 11:22 AM, Yanan Wang wrote: With a guest translation fault, the memcache pages are not needed if KVM is only about to install a new leaf entry into the existing page table. And with a guest permission fault, the memcache p

Re: [RFC PATCH 3/4] KVM: arm64: Install the block entry before unmapping the page mappings

2021-03-22 Thread wangyanan (Y)
patch, since it's easier to get the full context. On 3/4/21 7:07 AM, wangyanan (Y) wrote: Hi Alex, On 2021/3/4 1:27, Alexandru Elisei wrote: Hi Yanan, On 3/3/21 11:04 AM, wangyanan (Y) wrote: Hi Alex, On 2021/3/3 1:13, Alexandru Elisei wrote: Hello, On 2/8/21 11:22 AM, Yanan Wang

Re: [PATCH 2/2] KVM: arm64: Skip the cache flush when coalescing tables into a block

2021-03-09 Thread wangyanan (Y)
On 2021/3/9 16:43, Marc Zyngier wrote: On Tue, 09 Mar 2021 08:34:43 +, "wangyanan (Y)" wrote: On 2021/3/9 0:34, Will Deacon wrote: On Mon, Jan 25, 2021 at 10:10:44PM +0800, Yanan Wang wrote: After dirty-logging is stopped for a VM configured with huge mappings, KVM will r

Re: [PATCH 2/2] KVM: arm64: Skip the cache flush when coalescing tables into a block

2021-03-09 Thread wangyanan (Y)
On 2021/3/9 0:34, Will Deacon wrote: On Mon, Jan 25, 2021 at 10:10:44PM +0800, Yanan Wang wrote: After dirty-logging is stopped for a VM configured with huge mappings, KVM will recover the table mappings back to block mappings. As we only replace the existing page tables with a block entry and

Re: [RFC PATCH 3/4] KVM: arm64: Install the block entry before unmapping the page mappings

2021-03-03 Thread wangyanan (Y)
On 2021/3/4 15:07, wangyanan (Y) wrote: Hi Alex, On 2021/3/4 1:27, Alexandru Elisei wrote: Hi Yanan, On 3/3/21 11:04 AM, wangyanan (Y) wrote: Hi Alex, On 2021/3/3 1:13, Alexandru Elisei wrote: Hello, On 2/8/21 11:22 AM, Yanan Wang wrote: When KVM needs to coalesce the normal page

Re: [RFC PATCH 3/4] KVM: arm64: Install the block entry before unmapping the page mappings

2021-03-03 Thread wangyanan (Y)
Hi Alex, On 2021/3/4 1:27, Alexandru Elisei wrote: Hi Yanan, On 3/3/21 11:04 AM, wangyanan (Y) wrote: Hi Alex, On 2021/3/3 1:13, Alexandru Elisei wrote: Hello, On 2/8/21 11:22 AM, Yanan Wang wrote: When KVM needs to coalesce the normal page mappings into a block mapping, we currently

Re: [RFC PATCH 3/4] KVM: arm64: Install the block entry before unmapping the page mappings

2021-03-03 Thread wangyanan (Y)
Hi Alex, On 2021/3/3 1:13, Alexandru Elisei wrote: Hello, On 2/8/21 11:22 AM, Yanan Wang wrote: When KVM needs to coalesce the normal page mappings into a block mapping, we currently invalidate the old table entry first followed by invalidation of TLB, then unmap the page mappings, and install

Re: [RFC PATCH 3/4] KVM: arm64: Install the block entry before unmapping the page mappings

2021-02-28 Thread wangyanan (Y)
On 2021/2/8 19:22, Yanan Wang wrote: When KVM needs to coalesce the normal page mappings into a block mapping, we currently invalidate the old table entry first followed by invalidation of TLB, then unmap the page mappings, and install the block entry at last. It will cost a long time to unmap

Re: [RFC PATCH 1/4] KVM: arm64: Move the clean of dcache to the map handler

2021-02-26 Thread wangyanan (Y)
On 2021/2/25 17:55, Marc Zyngier wrote: Hi Yanan, On Mon, 08 Feb 2021 11:22:47 +, Yanan Wang wrote: We currently uniformly clean dcache in user_mem_abort() before calling the fault handlers, if we take a translation fault and the pfn is cacheable. But if there are concurrent translation

Re: [RFC PATCH 1/4] KVM: arm64: Move the clean of dcache to the map handler

2021-02-26 Thread wangyanan (Y)
Hi Marc, Alex, On 2021/2/26 2:30, Marc Zyngier wrote: On Thu, 25 Feb 2021 17:39:00 +, Alexandru Elisei wrote: Hi Marc, On 2/25/21 9:55 AM, Marc Zyngier wrote: Hi Yanan, On Mon, 08 Feb 2021 11:22:47 +, Yanan Wang wrote: We currently uniformly clean dcache in user_mem_abort() before

Re: [RFC PATCH 0/4] KVM: arm64: Improve efficiency of stage2 page table

2021-02-24 Thread wangyanan (Y)
On 2021/2/25 1:20, Alexandru Elisei wrote: Hi, On 2/24/21 2:35 AM, wangyanan (Y) wrote: Hi Alex, On 2021/2/23 23:55, Alexandru Elisei wrote: Hi Yanan, I wanted to review the patches, but unfortunately I get an error when trying to apply the first patch in the series: Applying: KVM: arm64

Re: [RFC PATCH 0/4] KVM: arm64: Improve efficiency of stage2 page table

2021-02-23 Thread wangyanan (Y)
Hi Alex, On 2021/2/23 23:55, Alexandru Elisei wrote: Hi Yanan, I wanted to review the patches, but unfortunately I get an error when trying to apply the first patch in the series: Applying: KVM: arm64: Move the clean of dcache to the map handler error: patch failed: arch/arm64/kvm/hyp/pgtable.

Re: [RFC PATCH v4 0/2] Some optimization for stage-2 translation

2021-01-22 Thread wangyanan (Y)
Hi Marc, On 2021/1/22 19:47, Marc Zyngier wrote: Hi Yanan, On 2021-01-22 10:13, Yanan Wang wrote: Hi, Will, Marc, Is there any further comment on the v3 series I post previously? None, I was planning to queue them for 5.12 over the weekend. If they are not fine to you, then I think maybe w

Re: [RFC PATCH v4 0/2] Some optimization for stage-2 translation

2021-01-22 Thread wangyanan (Y)
Hi Marc, On 2021/1/22 19:47, Marc Zyngier wrote: Hi Yanan, On 2021-01-22 10:13, Yanan Wang wrote: Hi, Will, Marc, Is there any further comment on the v3 series I post previously? None, I was planning to queue them for 5.12 over the weekend. If they are not fine to you, then I think maybe w