Re: [PATCH v6 03/10] KVM: selftests: Use flag CLOCK_MONOTONIC_RAW for timing

2021-04-19 Thread wangyanan (Y)
On 2021/4/19 16:22, David Laight wrote: From: wangyanan (Y) Sent: 19 April 2021 07:40 Hi Paolo, On 2021/4/17 21:23, Paolo Bonzini wrote: On 30/03/21 10:08, Yanan Wang wrote: In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can also shield possiable impact of NTP, which

Re: [PATCH v6 03/10] KVM: selftests: Use flag CLOCK_MONOTONIC_RAW for timing

2021-04-19 Thread wangyanan (Y)
Hi Paolo, On 2021/4/17 21:23, Paolo Bonzini wrote: On 30/03/21 10:08, Yanan Wang wrote: In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can also shield possiable impact of NTP, which can provide more robustness. Suggested-by: Vitaly Kuznetsov Signed-off-by: Yanan Wang

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

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

Re: [PATCH v6 00/10] KVM: selftests: some improvement and a new test for kvm page table

2021-04-05 Thread wangyanan (Y)
Kindly ping... Hi Paolo, Will this series be picked up soon, or is there any other work for me to do? Regards, Yanan On 2021/3/30 16:08, Yanan Wang wrote: Hi, This v6 series can mainly include two parts. Rebased on kvm queue branch:

Re: [RFC PATCH v5 10/10] KVM: selftests: Add a test for kvm page table code

2021-03-29 Thread wangyanan (Y)
Hi Drew, Thanks for having a look. On 2021/3/29 19:38, Andrew Jones wrote: On Tue, Mar 23, 2021 at 09:52:31PM +0800, Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some

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

Re: [RFC PATCH v5 10/10] KVM: selftests: Add a test for kvm page table code

2021-03-23 Thread wangyanan (Y)
Hi Drew, BTW, any thoughts about the change in this patch? :) Thanks, Yanan On 2021/3/23 21:52, Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some improvement for kvm.

Re: [RFC PATCH v5 00/10] KVM: selftests: some improvement and a new test for kvm page table

2021-03-23 Thread wangyanan (Y)
On 2021/3/23 23:58, Sean Christopherson wrote: On Tue, Mar 23, 2021, Yanan Wang wrote: Hi, This v5 series can mainly include two parts. Based on kvm queue branch: https://git.kernel.org/pub/scm/virt/kvm/kvm.git/log/?h=queue Given the number of Reviewed-by tags, I'm pretty sure you can drop

Re: [RFC PATCH v5 02/10] tools headers: Add a macro to get HUGETLB page sizes for mmap

2021-03-23 Thread wangyanan (Y)
On 2021/3/23 22:03, Andrew Jones wrote: $SUBJECT says "tools headers", but this is actually changing a UAPI header and then copying the change to tools. Indeed. I think head of the subject should be "mm/hugetlb". I will fix it. Thanks, Yanan Thanks, drew On Tue, Mar 23, 2021 at 09:52:23PM

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

2021-03-22 Thread wangyanan (Y)
on this 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 wrote

Re: [RFC PATCH v4 9/9] KVM: selftests: Add a test for kvm page table code

2021-03-22 Thread wangyanan (Y)
On 2021/3/12 22:20, Andrew Jones wrote: On Tue, Mar 02, 2021 at 08:57:51PM +0800, Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some improvement for kvm. The function

Re: [RFC PATCH v4 7/9] KVM: selftests: List all hugetlb src types specified with page sizes

2021-03-22 Thread wangyanan (Y)
On 2021/3/12 20:02, Andrew Jones wrote: On Tue, Mar 02, 2021 at 08:57:49PM +0800, Yanan Wang wrote: With VM_MEM_SRC_ANONYMOUS_HUGETLB, we currently can only use system default hugetlb pages to back the testing guest memory. In order to add flexibility, now list all the known hugetlb backing

Re: [RFC PATCH v4 7/9] KVM: selftests: List all hugetlb src types specified with page sizes

2021-03-22 Thread wangyanan (Y)
On 2021/3/12 19:49, Andrew Jones wrote: On Tue, Mar 02, 2021 at 08:57:49PM +0800, Yanan Wang wrote: With VM_MEM_SRC_ANONYMOUS_HUGETLB, we currently can only use system default hugetlb pages to back the testing guest memory. In order to add flexibility, now list all the known hugetlb backing

Re: [RFC PATCH v4 6/9] KVM: selftests: Add a helper to get system default hugetlb page size

2021-03-22 Thread wangyanan (Y)
On 2021/3/12 19:40, Andrew Jones wrote: On Tue, Mar 02, 2021 at 08:57:48PM +0800, Yanan Wang wrote: If HUGETLB is configured in the host kernel, then we can know the system default hugetlb page size through *cat /proc/meminfo*. Otherwise, we will not see the information of hugetlb pages in

Re: [RFC PATCH v4 5/9] KVM: selftests: Add a helper to get system configured THP page size

2021-03-22 Thread wangyanan (Y)
Hi Drew, Thanks for your attention to this series! On 2021/3/12 19:31, Andrew Jones wrote: On Tue, Mar 02, 2021 at 08:57:47PM +0800, Yanan Wang wrote: If we want to have some tests about transparent hugepages, the system configured THP hugepage size should better be known by the tests, which

Re: [RFC PATCH v4 2/9] tools headers: Add a macro to get HUGETLB page sizes for mmap

2021-03-14 Thread wangyanan (Y)
On 2021/3/12 19:14, Andrew Jones wrote: On Tue, Mar 02, 2021 at 08:57:44PM +0800, Yanan Wang wrote: We know that if a system supports multiple hugetlb page sizes, the desired hugetlb page size can be specified in bits [26:31] of the flag arguments. The value in these 6 bits will be the shift

Re: [RFC PATCH v4 0/9] KVM: selftests: some improvement and a new test for kvm page table

2021-03-11 Thread wangyanan (Y)
Hi all, Kindly ping :)! Are there any further comments for this v4 series? Please let me know if there is still something that needs fixing. Or is this v4 series fine enough to be queued? Most of the patches have been added with Reviewed-by. If there are merge conflicts with the newest

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 wi

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

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

Re: [RFC PATCH v3 6/8] KVM: selftests: List all hugetlb src types specified with page sizes

2021-03-02 Thread wangyanan (Y)
Hi Ben, On 2021/3/2 1:09, Ben Gardon wrote: On Sun, Feb 28, 2021 at 11:00 PM Yanan Wang wrote: With VM_MEM_SRC_ANONYMOUS_HUGETLB, we currently can only use system default hugetlb pages to back the testing guest memory. In order to add flexibility, now list all the known hugetlb backing src

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

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()

Re: [RFC PATCH v2 3/7] KVM: selftests: Make a generic helper to get vm guest mode strings

2021-02-25 Thread wangyanan (Y)
On 2021/2/25 13:59, Yanan Wang wrote: For generality and conciseness, make an API which can be used in all kvm libs and selftests to get vm guest mode strings. And the index i is checked in the API in case of possiable faults. Signed-off-by: Yanan Wang And here too, will include

Re: [RFC PATCH v2 6/7] KVM: selftests: Adapt vm_userspace_mem_region_add to new helpers

2021-02-25 Thread wangyanan (Y)
On 2021/2/26 7:44, Ben Gardon wrote: On Wed, Feb 24, 2021 at 10:03 PM Yanan Wang wrote: With VM_MEM_SRC_ANONYMOUS_THP specified in vm_userspace_mem_region_add(), we have to get the transparent hugepage size for HVA alignment. With the new helpers, we can use get_backing_src_pagesz() to check

Re: [RFC PATCH v2 5/7] KVM: selftests: List all hugetlb src types specified with page sizes

2021-02-25 Thread wangyanan (Y)
On 2021/2/26 7:42, Ben Gardon wrote: On Wed, Feb 24, 2021 at 10:03 PM Yanan Wang wrote: With VM_MEM_SRC_ANONYMOUS_HUGETLB, we currently can only use system default hugetlb pages to back the testing guest memory. In order to add flexibility, now list all the known hugetlb backing src types

Re: [RFC PATCH v2 2/7] KVM: selftests: Use flag CLOCK_MONOTONIC_RAW for timing

2021-02-25 Thread wangyanan (Y)
On 2021/2/26 2:54, Andrew Jones wrote: On Thu, Feb 25, 2021 at 01:59:35PM +0800, Yanan Wang wrote: In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can also shield possiable impact of NTP, which can provide more robustness. IIRC, this should include Suggested-by: Vitaly

Re: [PATCH 04/15] KVM: selftests: Force stronger HVA alignment (1gb) for hugepages

2021-02-25 Thread wangyanan (Y)
On 2021/2/11 7:06, Sean Christopherson wrote: Align the HVA for hugepage memslots to 1gb, as opposed to incorrectly assuming all architectures' hugepages are 512*page_size. For x86, multiplying by 512 is correct, but only for 2mb pages, e.g. systems that support 1gb pages will never be able

Re: [PATCH 03/15] KVM: selftests: Align HVA for HugeTLB-backed memslots

2021-02-24 Thread wangyanan (Y)
Hi Sean, On 2021/2/11 7:06, Sean Christopherson wrote: Align the HVA for HugeTLB memslots, not just THP memslots. Add an assert so any future backing types are forced to assess whether or not they need to be aligned. Cc: Ben Gardon Cc: Yanan Wang Cc: Andrew Jones Cc: Peter Xu Cc: Aaron

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

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:

Re: [RFC PATCH 2/2] KVM: selftests: Add a test for kvm page table code

2021-02-10 Thread wangyanan (Y)
On 2021/2/10 1:57, Ben Gardon wrote: On Tue, Feb 9, 2021 at 1:43 AM wangyanan (Y) wrote: On 2021/2/9 4:29, Ben Gardon wrote: On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings),

Re: [RFC PATCH 2/2] KVM: selftests: Add a test for kvm page table code

2021-02-09 Thread wangyanan (Y)
On 2021/2/10 1:38, Ben Gardon wrote: On Mon, Feb 8, 2021 at 11:22 PM wangyanan (Y) wrote: Hi Ben, On 2021/2/9 4:29, Ben Gardon wrote: On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappi

Re: [RFC PATCH 1/2] KVM: selftests: Add a macro to get string of vm_mem_backing_src_type

2021-02-09 Thread wangyanan (Y)
On 2021/2/10 1:35, Sean Christopherson wrote: On Tue, Feb 09, 2021, Ben Gardon wrote: On Tue, Feb 9, 2021 at 3:21 AM wangyanan (Y) wrote: On 2021/2/9 2:13, Ben Gardon wrote: On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: Add a macro to get string of the backing source memory type, so

Re: [RFC PATCH 1/2] KVM: selftests: Add a macro to get string of vm_mem_backing_src_type

2021-02-09 Thread wangyanan (Y)
On 2021/2/9 2:13, Ben Gardon wrote: On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: Add a macro to get string of the backing source memory type, so that application can add choices for source types in the help() function, and users can specify which type to use for testing. Coincidentally,

Re: [RFC PATCH 1/2] KVM: selftests: Add a macro to get string of vm_mem_backing_src_type

2021-02-09 Thread wangyanan (Y)
Hi Sean, On 2021/2/9 1:43, Sean Christopherson wrote: On Mon, Feb 08, 2021, Yanan Wang wrote: Add a macro to get string of the backing source memory type, so that application can add choices for source types in the help() function, and users can specify which type to use for testing.

Re: [RFC PATCH 2/2] KVM: selftests: Add a test for kvm page table code

2021-02-09 Thread wangyanan (Y)
On 2021/2/9 4:29, Ben Gardon wrote: On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some improvement for kvm. The function guest_code()

Re: [RFC PATCH 2/2] KVM: selftests: Add a test for kvm page table code

2021-02-08 Thread wangyanan (Y)
Hi Ben, On 2021/2/9 4:29, Ben Gardon wrote: On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some improvement for kvm. The function

Re: [RFC PATCH 2/2] KVM: selftests: Add a test for kvm page table code

2021-02-08 Thread wangyanan (Y)
Hi Vitaly, On 2021/2/8 18:21, Vitaly Kuznetsov wrote: Yanan Wang writes: This test serves as a performance tester and a bug reproducer for kvm page table code (GPA->HPA mappings), so it gives guidance for people trying to make some improvement for kvm. The function guest_code() is designed

Re: [PATCH v2 3/3] KVM: arm64: Mark the page dirty only if the fault is handled successfully

2021-01-14 Thread wangyanan (Y)
On 2021/1/13 23:51, Will Deacon wrote: On Wed, Dec 16, 2020 at 08:28:44PM +0800, Yanan Wang wrote: We now mark the page dirty and set the bitmap before calling fault handlers in user_mem_abort(), and we might end up having spurious dirty pages if update of permissions or mapping has failed.

Re: [PATCH v2 2/3] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2021-01-14 Thread wangyanan (Y)
On 2021/1/13 23:44, Will Deacon wrote: On Wed, Dec 16, 2020 at 08:28:43PM +0800, Yanan Wang wrote: In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the same GPA could

Re: [PATCH v2 0/3] RFC: Solve several problems in stage 2 translation

2020-12-27 Thread wangyanan (Y)
Hi Will, Marc, Gently Ping. Is there any comments about this V2 series? Many thanks, Yanan. On 2020/12/16 20:28, Yanan Wang wrote: Hi, this is the second version, thanks for reading. PATCH1/3: Procedures of hyp stage 1 mapping and guest stage 2 mapping are different, but they are tied

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-13 Thread wangyanan (Y)
Hi Will, Marc, On 2020/12/11 18:00, Will Deacon wrote: On Fri, Dec 11, 2020 at 09:49:28AM +, Marc Zyngier wrote: On 2020-12-11 08:01, Yanan Wang wrote: @@ -461,25 +462,56 @@ static int stage2_map_set_prot_attr(enum kvm_pgtable_prot prot, return 0; } +static bool

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-13 Thread wangyanan (Y)
On 2020/12/11 17:49, Marc Zyngier wrote: Hi Yanan, On 2020-12-11 08:01, Yanan Wang wrote: In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the same GPA could occur

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-13 Thread wangyanan (Y)
On 2020/12/11 17:53, Will Deacon wrote: Hi Yanan, On Fri, Dec 11, 2020 at 04:01:15PM +0800, Yanan Wang wrote: In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the

Re: [PATCH v2 0/3] Fix several bugs in KVM stage 2 translation

2020-12-02 Thread wangyanan (Y)
On 2020/12/2 20:23, Marc Zyngier wrote: Hi Yanan, [...] BTW: there are two more things below that I want to talk about. 1.  Recently, I have been focusing on the ARMv8.4-TTRem feature which is aimed at changing block size in stage 2 mapping. I have a plan to implement this feature for

Re: [PATCH v2 0/3] Fix several bugs in KVM stage 2 translation

2020-12-02 Thread wangyanan (Y)
Hi Will, Marc, On 2020/12/2 4:59, Will Deacon wrote: On Wed, Dec 02, 2020 at 04:10:31AM +0800, Yanan Wang wrote: When installing a new pte entry or updating an old valid entry in stage 2 translation, we use get_page()/put_page() to record page_count of the page-table pages. PATCH 1/3 aims to

Re: [RFC PATCH 1/3] KVM: arm64: Fix possible memory leak in kvm stage2

2020-12-01 Thread wangyanan (Y)
On 2020/12/2 2:15, Will Deacon wrote: On Wed, Dec 02, 2020 at 01:19:35AM +0800, wangyanan (Y) wrote: On 2020/12/1 22:16, Will Deacon wrote: On Tue, Dec 01, 2020 at 03:21:23PM +0800, wangyanan (Y) wrote: On 2020/11/30 21:21, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:45PM +0800, Yanan

Re: [RFC PATCH 2/3] KVM: arm64: Fix handling of merging tables into a block entry

2020-12-01 Thread wangyanan (Y)
On 2020/12/1 22:35, Marc Zyngier wrote: Hi Yanan, On 2020-12-01 14:11, wangyanan (Y) wrote: On 2020/12/1 21:46, Will Deacon wrote: On Tue, Dec 01, 2020 at 10:30:41AM +0800, wangyanan (Y) wrote: [...] The point is at b.iii where the TLBI is not enough. There are many page mappings

Re: [RFC PATCH 1/3] KVM: arm64: Fix possible memory leak in kvm stage2

2020-12-01 Thread wangyanan (Y)
On 2020/12/1 22:16, Will Deacon wrote: On Tue, Dec 01, 2020 at 03:21:23PM +0800, wangyanan (Y) wrote: On 2020/11/30 21:21, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:45PM +0800, Yanan Wang wrote: diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index

Re: [RFC PATCH 2/3] KVM: arm64: Fix handling of merging tables into a block entry

2020-12-01 Thread wangyanan (Y)
On 2020/12/1 21:46, Will Deacon wrote: On Tue, Dec 01, 2020 at 10:30:41AM +0800, wangyanan (Y) wrote: On 2020/12/1 0:01, Will Deacon wrote: On Mon, Nov 30, 2020 at 11:24:19PM +0800, wangyanan (Y) wrote: On 2020/11/30 21:34, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:46PM +0800, Yanan

Re: [RFC PATCH 1/3] KVM: arm64: Fix possible memory leak in kvm stage2

2020-11-30 Thread wangyanan (Y)
Hi Will, On 2020/11/30 21:21, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:45PM +0800, Yanan Wang wrote: When installing a new leaf pte onto an invalid ptep, we need to get_page(ptep). When just updating a valid leaf ptep, we shouldn't get_page(ptep). Incorrect page_count of translation

Re: [RFC PATCH 3/3] KVM: arm64: Add usage of stage 2 fault lookup level in user_mem_abort()

2020-11-30 Thread wangyanan (Y)
Hi Will, On 2020/11/30 21:49, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:47PM +0800, Yanan Wang wrote: If we get a FSC_PERM fault, just using (logging_active && writable) to determine calling kvm_pgtable_stage2_map(). There will be two more cases we should consider. (1) After

Re: [RFC PATCH 2/3] KVM: arm64: Fix handling of merging tables into a block entry

2020-11-30 Thread wangyanan (Y)
Hi Will, On 2020/12/1 0:01, Will Deacon wrote: Hi, Cheers for the quick reply. See below for more questions... On Mon, Nov 30, 2020 at 11:24:19PM +0800, wangyanan (Y) wrote: On 2020/11/30 21:34, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:46PM +0800, Yanan Wang wrote: diff --git

Re: [RFC PATCH 2/3] KVM: arm64: Fix handling of merging tables into a block entry

2020-11-30 Thread wangyanan (Y)
On 2020/11/30 21:34, Will Deacon wrote: On Mon, Nov 30, 2020 at 08:18:46PM +0800, Yanan Wang wrote: In dirty logging case(logging_active == True), we need to collapse a block entry into a table if necessary. After dirty logging is canceled, when merging tables back into a block entry, we