[PATCH] HV: Fix definition of struct hv_vp_assist_page.

2018-05-21 Thread Tianyu Lan
The struct hv_vp_assist_page was defined incorrectly. The "vtl_control" should be u64[3], "nested_enlightenments_control" should be a u64 and there is 7 reserved bytes following "enlighten_vmentry". This patch is to fix it. Signed-off-by: Lan Tianyu ---

[RFC Patch 1/3] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-06-04 Thread Tianyu Lan
Hyper-V provides a pv hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. This patch is to implement it. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/Makefile | 2 +-

[RFC Patch 0/3] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support

2018-06-04 Thread Tianyu Lan
Hyper-V provides a para-virtualization hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. The tradition way is to send IPIs to all affected vcpus and executes INVEPT on each vcpus. It

Re: [RFC Patch 1/3] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-06-05 Thread Tianyu Lan
Hi Michael: Thanks for your review. On 6/6/2018 12:59 AM, Michael Kelley (EOSG) wrote: >> -Original Message- >> From: linux-kernel-ow...@vger.kernel.org >> On Behalf >> Of Tianyu Lan >> Sent: Monday, June 4, 2018 2:08 AM >> Cc: Tianyu Lan ;

[PATCH 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support

2018-07-02 Thread Tianyu Lan
Hyper-V provides a para-virtualization hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. The tradition way is to send IPIs to all affected vcpus and executes INVEPT on each vcpus. It

[PATCH 1/4] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-07-02 Thread Tianyu Lan
Hyper-V supports a pv hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. This patch is to implement it. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/Makefile | 2 +-

Re: [Patch] vmbus: Simply hv_get_next_write_location() function

2018-01-25 Thread Tianyu Lan
On Thu, Jan 25, 2018 at 12:37 AM, Stephen Hemminger <step...@networkplumber.org> wrote: > On Wed, 24 Jan 2018 14:21:30 +0800 > lantianyu1...@gmail.com wrote: > >> From: Tianyu Lan <tianyu@microsoft.com> >> >> The "next" variable is redunda

Re: [PATCH V3 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support

2018-07-23 Thread Tianyu Lan
On 7/23/2018 3:39 PM, Wanpeng Li wrote: > On Fri, 20 Jul 2018 at 16:32, Paolo Bonzini wrote: >> >> On 20/07/2018 05:58, KY Srinivasan wrote: >>> >>> >>>> -----Original Message- >>>> From: Tianyu Lan >>>> Sent: Thursday, Jul

Re: [PATCH V3 1/4] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-07-19 Thread Tianyu Lan
On 7/19/2018 8:05 PM, Thomas Gleixner wrote: > On Thu, 19 Jul 2018, Tianyu Lan wrote: >> @@ -0,0 +1,64 @@ >> +// SPDX-License-Identifier: GPL-2.0 >> + >> +/* >> + * Hyper-V nested virtualization code. >> + * >> + * Copyright (C) 2018, Micr

[PATCH V3 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support

2018-07-19 Thread Tianyu Lan
Hyper-V provides a para-virtualization hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. The tradition way is to send IPIs to all affected vcpus and executes INVEPT on each vcpus. It

[PATCH V3 2/4] X86/Hyper-V: Add hyperv_nested_flush_guest_mapping ftrace support

2018-07-19 Thread Tianyu Lan
This patch is to add hyperv_nested_flush_guest_mapping support to trace hvFlushGuestPhysicalAddressSpace hypercall. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/nested.c| 3 +++ arch/x86/include/asm/trace/hyperv.h | 14 ++ 2 files changed, 17 insertions(+) diff --git

[PATCH V3 1/4] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-07-19 Thread Tianyu Lan
Hyper-V supports a pv hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. This patch is to implement it. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/Makefile | 2 +-

Re: [PATCH V3 0/4] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support

2018-07-19 Thread Tianyu Lan
On 7/19/2018 4:57 PM, Paolo Bonzini wrote: > On 19/07/2018 10:39, Tianyu Lan wrote: >> Hyper-V provides a para-virtualization hypercall >> HvFlushGuestPhysicalAddressSpace >> to flush nested VM address space mapping in l1 hypervisor and it's to reduce >> overhead &

[Update PATCH V3 1/4] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-07-19 Thread Tianyu Lan
Hyper-V supports a pv hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. This patch is to implement it. Signed-off-by: Lan Tianyu --- Change since v3 Remove GPL boilerplate.

Re: [PATCH V2 3/5] KVM/VMX: Add identical ept table pointer check

2018-07-18 Thread Tianyu Lan
On 7/18/2018 7:59 PM, Paolo Bonzini wrote: > On 09/07/2018 11:02, Tianyu Lan wrote: >> +static void check_ept_pointer(struct kvm_vcpu *vcpu, u64 eptp) >> +{ >> +struct kvm *kvm = vcpu->kvm; >> +u64 tmp_eptp = INVALID_PAGE; >> +int i; >> +

Re: [PATCH V2 2/5] KVM: Add tlb remote flush callback in kvm_x86_ops.

2018-07-18 Thread Tianyu Lan
Hi Paolo: Thanks for review. On 7/18/2018 8:01 PM, Paolo Bonzini wrote: > On 09/07/2018 11:02, Tianyu Lan wrote: >> +/* >> + * Call kvm_arch_hv_tlb_remote first and go back old way when >> + * return failure. >> + */ >> +if (

[ 1/1] KVM/MMU: Fix comment in walk_shadow_page_lockless_end()

2018-09-06 Thread Tianyu Lan
kvm_commit_zap_page() has been renamed to kvm_mmu_commit_zap_page() This patch is to fix the commit. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 7ccd29b95746..648b839a349d

[PATCH 2/13] KVM/MMU: Add tlb flush with range helper function

2018-09-10 Thread Tianyu Lan
This patch is to add wrapper functions for tlb_remote_flush_with_range callback. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 48 1 file changed, 48 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

[PATCH 00/13] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-09-10 Thread Tianyu Lan
For nested memory virtualization, Hyper-v doesn't set write-protect L1 hypervisor EPT page directory and page table node to track changes while it relies on guest to tell it changes via HvFlushGuestAddressLlist hypercall. HvFlushGuestAddressLlist hypercall provides a way to flush EPT page table

[PATCH 3/13] KVM: Replace old tlb flush function with new one to flush a specified range.

2018-09-10 Thread Tianyu Lan
This patch is to replace kvm_flush_remote_tlbs() with kvm_flush_ remote_tlbs_with_address() in some functions without logic change. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 34 +++--- arch/x86/kvm/paging_tmpl.h | 9 +++-- 2 files changed, 30

[PATCH 4/13] KVM/MMU: Flush tlb directly in the kvm_handle_hva_range()

2018-09-10 Thread Tianyu Lan
This patch is to flush tlb directly in the kvm_handle_hva_range() when range flush is available. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 0ee310bad2c6..cadb6a0b5247 100644 ---

[PATCH 6/13] KVM/MMU: Flush tlb directly in kvm_mmu_zap_collapsible_spte()

2018-09-10 Thread Tianyu Lan
kvm_mmu_zap_collapsible_spte() returns flush request to the slot_handle_leaf() and the latter does flush on demand. When range flush is available, make kvm_mmu_zap_collapsible_spte() to flush tlb with range directly to avoid returning range back to slot_handle_leaf(). Signed-off-by: Lan Tianyu

[PATCH 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops

2018-09-10 Thread Tianyu Lan
Add flush range call back in the kvm_x86_ops and platform can use it to register its associated function. The parameter "kvm_tlb_range" accepts a single range and flush list which contains a list of ranges. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 8 1 file

[PATCH 7/13] KVM: Add flush_link and parent_pte in the struct kvm_mmu_page

2018-09-10 Thread Tianyu Lan
PV EPT tlb flush function will accept a list of flush ranges and use struct kvm_mmu_page as the list entry. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index

[PATCH 11/13] x86/Hyper-v: Add trace in the hyperv_nested_flush_guest_mapping_range()

2018-09-10 Thread Tianyu Lan
This patch is to trace log in the hyperv_nested_flush_ guest_mapping_range(). Signed-off-by: Lan Tianyu --- arch/x86/hyperv/nested.c| 1 + arch/x86/include/asm/trace/hyperv.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/x86/hyperv/nested.c

[PATCH 8/13] KVM: Add spte's point in the struct kvm_mmu_page

2018-09-10 Thread Tianyu Lan
It's necessary to check whether mmu page is last or large page when add mmu page into flush list. "spte" is needed for such check and so add spte point in the struct kvm_mmu_page. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/mmu.c | 5 +

[PATCH 10/13] x86/hyper-v: Add HvFlushGuestAddressList hypercall support

2018-09-10 Thread Tianyu Lan
Hyper-V provides HvFlushGuestAddressList() hypercall to flush EPT tlb with specified ranges. This patch is to add the hypercall support. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/nested.c | 110 + arch/x86/include/asm/hyperv-tlfs.h | 17 ++

[PATCH 9/13] KVM/MMU: Replace tlb flush function with range list flush function

2018-09-10 Thread Tianyu Lan
This patch is to use range list flush function in the mmu_sync_children(), kvm_mmu_commit_zap_page() and FNAME(sync_page)(). Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 26 +++--- arch/x86/kvm/paging_tmpl.h | 5 - 2 files changed, 27 insertions(+), 4

[PATCH 5/13] KVM/MMU: Flush tlb directly in the kvm_zap_gfn_range()

2018-09-10 Thread Tianyu Lan
Originally, flush tlb is done by slot_handle_level_range(). This patch is to flush tlb directly in the kvm_zap_gfn_range() when range flush is available. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git

Re: [PATCH V2 1/5] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-07-11 Thread Tianyu Lan
Hi Michael: Thanks for your review. On 7/11/2018 5:29 AM, Michael Kelley (EOSG) wrote: > From: Tianyu Lan Monday, July 9, 2018 2:03 AM >> Hyper-V supports a pv hypercall HvFlushGuestPhysicalAddressSpace to >> flush nested VM address space mapping in l1 hypervisor and it

[PATCH V2 4/5] KVM/x86: Add tlb_remote_flush callback support for vmx

2018-07-09 Thread Tianyu Lan
Register tlb_remote_flush callback for vmx when hyperv capability of nested guest mapping flush is detected. The interface can help to reduce overhead when flush ept table among vcpus for nested VM. The tradition way is to send IPIs to all affected vcpus and executes INVEPT on each vcpus. It will

[PATCH V2 0/5] KVM/x86/hyper-V: Introduce PV guest address space mapping flush support

2018-07-09 Thread Tianyu Lan
Hyper-V provides a para-virtualization hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. The tradition way is to send IPIs to all affected vcpus and executes INVEPT on each vcpus. It

[PATCH V2 3/5] KVM/VMX: Add identical ept table pointer check

2018-07-09 Thread Tianyu Lan
This patch is to check ept table pointer of each cpus when set ept tables and store identical ept table pointer if all ept table pointers of single VM are same. This is for support of para-virt ept flush hypercall. Signed-off-by: Lan Tianyu --- Change since v1: Replace

[PATCH V2 5/5] X86/Hyper-V: Add hyperv_nested_flush_guest_mapping ftrace support

2018-07-09 Thread Tianyu Lan
This patch is to add hyperv_nested_flush_guest_mapping support to trace hvFlushGuestPhysicalAddressSpace hypercall. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/nested.c| 3 +++ arch/x86/include/asm/trace/hyperv.h | 14 ++ 2 files changed, 17 insertions(+) diff --git

[PATCH V2 1/5] X86/Hyper-V: Add flush HvFlushGuestPhysicalAddressSpace hypercall support

2018-07-09 Thread Tianyu Lan
Hyper-V supports a pv hypercall HvFlushGuestPhysicalAddressSpace to flush nested VM address space mapping in l1 hypervisor and it's to reduce overhead of flushing ept tlb among vcpus. This patch is to implement it. Signed-off-by: Lan Tianyu --- arch/x86/hyperv/Makefile | 2 +-

[PATCH V2 2/5] KVM: Add tlb remote flush callback in kvm_x86_ops.

2018-07-09 Thread Tianyu Lan
This patch is to provide a way for platforms to register hv tlb remote flush callback and this helps to optimize operation of tlb flush among vcpus for nested virtualization case. Signed-off-by: Lan Tianyu --- Change since v1: Add kvm_arch_hv_flush_remote_tlb() to avoid compilation issue

Re: [PATCH V3 2/13] KVM/MMU: Add tlb flush with range helper function

2018-10-08 Thread Tianyu Lan
Hi Paolo: Thanks for your review. Sorry for later response due to holiday. On Mon, Oct 1, 2018 at 11:26 PM Paolo Bonzini wrote: > > On 27/09/2018 05:48, Tianyu Lan wrote: > > + > > + if (range && kvm_x86_ops-&g

Re: [PATCH V4 2/15] KVM/MMU: Add tlb flush with range helper function

2018-10-14 Thread Tianyu Lan
the > > series, this function remains unused. So, not only is it not used > > in this patch, it's not used in this series. > > Note - I seem to have only received patches 1 through 4, so this is > based on the patches I've received. > Sorry to confuse your. I get from CCers from get_maintainer.pl script. The next patch "[PATCH V4 3/15]KVM: Replace old tlb flush function with new one to flush a specified range" calls new function. https://lkml.org/lkml/2018/10/13/254 The patch "[PATCH V4 4/15] KVM: Make kvm_set_spte_hva() return int" changes under ARM directory. Please have a look. Thanks. -- Best regards Tianyu Lan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH V4 2/15] KVM/MMU: Add tlb flush with range helper function

2018-10-14 Thread Tianyu Lan
patch that actually > use it. > > -Liran > Normally, I also prefer to put the function definition into the patch which use it. But the following patch "KVM: Replace old tlb flush function with new one to flush a specified range" and other patches which use

Re: [PATCH V4 7/15] KVM/MMU: Flush tlb directly in the kvm_zap_gfn_range()

2018-10-15 Thread Tianyu Lan
} > > } > > > > + if (flush && kvm_available_flush_tlb_with_range()) > > + kvm_flush_remote_tlbs_with_address(kvm, gfn_start, > > + gfn_end - gfn_start + 1); > > + > > ..

[PATCH V3 10/13] x86/hyper-v: Add HvFlushGuestAddressList hypercall support

2018-09-26 Thread Tianyu Lan
Hyper-V provides HvFlushGuestAddressList() hypercall to flush EPT tlb with specified ranges. This patch is to add the hypercall support. Signed-off-by: Lan Tianyu --- Change since v2: Fix some coding style issues - Move HV_MAX_FLUSH_PAGES and HV_MAX_FLUSH_REP_COUNT to

[PATCH V3 9/13] KVM/MMU: Replace tlb flush function with range list flush function

2018-09-26 Thread Tianyu Lan
This patch is to use range list flush function in the mmu_sync_children(), kvm_mmu_commit_zap_page() and FNAME(sync_page)(). Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 26 +++--- arch/x86/kvm/paging_tmpl.h | 5 - 2 files changed, 27 insertions(+), 4

[PATCH V3 7/13] KVM: Add flush_link and parent_pte in the struct kvm_mmu_page

2018-09-26 Thread Tianyu Lan
PV EPT tlb flush function will accept a list of flush ranges and use struct kvm_mmu_page as the list entry. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index

[PATCH V3 3/13] KVM: Replace old tlb flush function with new one to flush a specified range.

2018-09-26 Thread Tianyu Lan
This patch is to replace kvm_flush_remote_tlbs() with kvm_flush_ remote_tlbs_with_address() in some functions without logic change. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 33 ++--- arch/x86/kvm/paging_tmpl.h | 3 ++- 2 files changed, 24

[PATCH V3 8/13] KVM: Add spte's point in the struct kvm_mmu_page

2018-09-26 Thread Tianyu Lan
It's necessary to check whether mmu page is last or large page when add mmu page into flush list. "spte" is needed for such check and so add spte point in the struct kvm_mmu_page. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/mmu.c | 5 +

[PATCH V3 11/13] x86/Hyper-v: Add trace in the hyperv_nested_flush_guest_mapping_range()

2018-09-26 Thread Tianyu Lan
This patch is to trace log in the hyperv_nested_flush_ guest_mapping_range(). Signed-off-by: Lan Tianyu --- arch/x86/hyperv/nested.c| 1 + arch/x86/include/asm/trace/hyperv.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/x86/hyperv/nested.c

[PATCH V3 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops

2018-09-26 Thread Tianyu Lan
Add flush range call back in the kvm_x86_ops and platform can use it to register its associated function. The parameter "kvm_tlb_range" accepts a single range and flush list which contains a list of ranges. Signed-off-by: Lan Tianyu --- Change since v1: Change "end_gfn" to "pages" to

[PATCH V3 5/13] KVM/MMU: Flush tlb directly in the kvm_zap_gfn_range()

2018-09-26 Thread Tianyu Lan
Originally, flush tlb is done by slot_handle_level_range(). This patch is to flush tlb directly in the kvm_zap_gfn_range() when range flush is available. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git

[PATCH V3 2/13] KVM/MMU: Add tlb flush with range helper function

2018-09-26 Thread Tianyu Lan
This patch is to add wrapper functions for tlb_remote_flush_with_range callback. Signed-off-by: Lan Tianyu --- Change since V2: Fix comment in the kvm_flush_remote_tlbs_with_range() --- arch/x86/kvm/mmu.c | 48 1 file changed, 48

[PATCH V3 4/13] KVM/MMU: Flush tlb directly in the kvm_handle_hva_range()

2018-09-26 Thread Tianyu Lan
This patch is to flush tlb directly in the kvm_handle_hva_range() when range flush is available. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d10d8423e8d6..877edae0401f 100644 ---

[PATCH V3 00/13] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-09-26 Thread Tianyu Lan
For nested memory virtualization, Hyper-v doesn't set write-protect L1 hypervisor EPT page directory and page table node to track changes while it relies on guest to tell it changes via HvFlushGuestAddressLlist hypercall. HvFlushGuestAddressLlist hypercall provides a way to flush EPT page table

[PATCH V3 6/13] KVM/MMU: Flush tlb directly in kvm_mmu_zap_collapsible_spte()

2018-09-26 Thread Tianyu Lan
kvm_mmu_zap_collapsible_spte() returns flush request to the slot_handle_leaf() and the latter does flush on demand. When range flush is available, make kvm_mmu_zap_collapsible_spte() to flush tlb with range directly to avoid returning range back to slot_handle_leaf(). Signed-off-by: Lan Tianyu

Re: [PATCH V3 10/13] x86/hyper-v: Add HvFlushGuestAddressList hypercall support

2018-09-26 Thread Tianyu Lan
On 9/27/2018 12:16 PM, Michael Kelley (EOSG) wrote: > From: Tianyu Lan Sent: Wednesday, September 26, 2018 8:50 PM >> >> Hyper-V provides HvFlushGuestAddressList() hypercall to flush EPT tlb >> with specified ranges. This patch is to add the hypercall support. >> &

Re: [PATCH V2 4/13] KVM/MMU: Flush tlb directly in the kvm_handle_hva_range()

2018-09-20 Thread Tianyu Lan
On 9/20/2018 12:08 AM, Michael Kelley (EOSG) wrote: > From: Tianyu Lan Sent: Monday, September 17, 2018 8:19 PM >> + >> +if (ret && kvm_available_flush_tlb_with_range()) { >> +kvm_flush

Re: [PATCH V5 00/10] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-11-27 Thread Tianyu Lan
+++---- > arch/x86/kvm/paging_tmpl.h | 3 +- > arch/x86/kvm/vmx.c | 69 ++ > virt/kvm/arm/mmu.c | 6 ++- > virt/kvm/kvm_main.c | 5 +- > 17 files changed, 295 insertions(+), 51 deletions(-) > > -- > 2.14.4 > -- Best regards Tianyu Lan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH V5 00/10] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-11-27 Thread Tianyu Lan
On Tue, Nov 27, 2018 at 8:12 PM Dan Carpenter wrote: > > On Tue, Nov 27, 2018 at 07:59:22PM +0800, Tianyu Lan wrote: > > Gentile Ping... > > > > On Thu, Nov 8, 2018 at 10:43 PM wrote: > > > > > > From: Lan Tianyu > > > > > > Sor

[PATCH V2 4/13] KVM/MMU: Flush tlb directly in the kvm_handle_hva_range()

2018-09-17 Thread Tianyu Lan
This patch is to flush tlb directly in the kvm_handle_hva_range() when range flush is available. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 822e170881a4..dfd2a0710417 100644 ---

[PATCH V2 3/13] KVM: Replace old tlb flush function with new one to flush a specified range.

2018-09-17 Thread Tianyu Lan
This patch is to replace kvm_flush_remote_tlbs() with kvm_flush_ remote_tlbs_with_address() in some functions without logic change. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 33 ++--- arch/x86/kvm/paging_tmpl.h | 3 ++- 2 files changed, 24

[PATCH V2 00/13] x86/KVM/Hyper-v: Add HV ept tlb range flush hypercall support in KVM

2018-09-17 Thread Tianyu Lan
For nested memory virtualization, Hyper-v doesn't set write-protect L1 hypervisor EPT page directory and page table node to track changes while it relies on guest to tell it changes via HvFlushGuestAddressLlist hypercall. HvFlushGuestAddressLlist hypercall provides a way to flush EPT page table

[PATCH V2 10/13] x86/hyper-v: Add HvFlushGuestAddressList hypercall support

2018-09-17 Thread Tianyu Lan
Hyper-V provides HvFlushGuestAddressList() hypercall to flush EPT tlb with specified ranges. This patch is to add the hypercall support. Signed-off-by: Lan Tianyu --- Change since v1: Add hyperv tlb flush struct to avoid use kvm tlb flush struct in the hyperv file. ---

[PATCH V2 6/13] KVM/MMU: Flush tlb directly in kvm_mmu_zap_collapsible_spte()

2018-09-17 Thread Tianyu Lan
kvm_mmu_zap_collapsible_spte() returns flush request to the slot_handle_leaf() and the latter does flush on demand. When range flush is available, make kvm_mmu_zap_collapsible_spte() to flush tlb with range directly to avoid returning range back to slot_handle_leaf(). Signed-off-by: Lan Tianyu

[PATCH V2 11/13] x86/Hyper-v: Add trace in the hyperv_nested_flush_guest_mapping_range()

2018-09-17 Thread Tianyu Lan
This patch is to trace log in the hyperv_nested_flush_ guest_mapping_range(). Signed-off-by: Lan Tianyu --- arch/x86/hyperv/nested.c| 1 + arch/x86/include/asm/trace/hyperv.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/x86/hyperv/nested.c

[PATCH V2 8/13] KVM: Add spte's point in the struct kvm_mmu_page

2018-09-17 Thread Tianyu Lan
It's necessary to check whether mmu page is last or large page when add mmu page into flush list. "spte" is needed for such check and so add spte point in the struct kvm_mmu_page. Signed-off-by: Lan Tianyu --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/mmu.c | 5 +

[PATCH V2 5/13] KVM/MMU: Flush tlb directly in the kvm_zap_gfn_range()

2018-09-17 Thread Tianyu Lan
Originally, flush tlb is done by slot_handle_level_range(). This patch is to flush tlb directly in the kvm_zap_gfn_range() when range flush is available. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git

[PATCH V2 2/13] KVM/MMU: Add tlb flush with range helper function

2018-09-17 Thread Tianyu Lan
This patch is to add wrapper functions for tlb_remote_flush_with_range callback. Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 48 1 file changed, 48 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

[PATCH V2 9/13] KVM/MMU: Replace tlb flush function with range list flush function

2018-09-17 Thread Tianyu Lan
This patch is to use range list flush function in the mmu_sync_children(), kvm_mmu_commit_zap_page() and FNAME(sync_page)(). Signed-off-by: Lan Tianyu --- arch/x86/kvm/mmu.c | 26 +++--- arch/x86/kvm/paging_tmpl.h | 5 - 2 files changed, 27 insertions(+), 4

[PATCH V2 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops

2018-09-17 Thread Tianyu Lan
Add flush range call back in the kvm_x86_ops and platform can use it to register its associated function. The parameter "kvm_tlb_range" accepts a single range and flush list which contains a list of ranges. Signed-off-by: Lan Tianyu --- Change since v1: Change "end_gfn" to "pages" to

Re: [PATCH 10/13] x86/hyper-v: Add HvFlushGuestAddressList hypercall support

2018-09-12 Thread Tianyu Lan
Hi Michael: Thanks for your review. On 9/12/2018 8:22 AM, Michael Kelley (EOSG) wrote: > From: Tianyu Lan Sent: Monday, September 10, 2018 1:39 AM >> + >> +int hyperv_flush_guest_mapping_range(u64 as, struct kvm_tlb_range *range) > > I'm really concerned about

Re: [PATCH 1/13] KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops

2018-09-12 Thread Tianyu Lan
Hi Sean: Thanks for your review. On 9/10/2018 10:21 PM, Sean Christopherson wrote: > On Mon, 2018-09-10 at 08:38 +0000, Tianyu Lan wrote: >> Add flush range call back in the kvm_x86_ops and platform can use it >> to register its associated function. The parameter

Re: [PATCH V3 1/10] X86/Hyper-V: Add parameter offset for hyperv_fill_flush_guest_mapping_list()

2019-02-26 Thread Tianyu Lan
e better? Yes, this makes sense. Will update. Thanks. -- Best regards Tianyu Lan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [Resend PATCH V5 0/3] x86/Hyper-V/IOMMU: Add Hyper-V IOMMU driver to support x2apic mode

2019-02-26 Thread Tianyu Lan
Add Hyper-V stub IOMMU driver > > MAINTAINERS: Add Hyper-V IOMMU driver into Hyper-V CORE AND DRIVERS > > scope > > Applied (patch 2 with slight subject changes > 'HYPERV/IOMMU' -> 'iommu/hyper-v'), thanks. Great. Thanks. -- Best regards Tianyu Lan ___

Re: [Update PATCH] x86/Hyper-V: Fix definition HV_MAX_FLUSH_REP_COUNT

2019-02-25 Thread Tianyu Lan
> support") > > "Fixes" Sorry, fix this in the V2. -- Best regards Tianyu Lan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH] x86/Hyper-V: Fix definition HV_MAX_FLUSH_REP_COUNT

2019-02-23 Thread Tianyu Lan
ot;%s\")%n" > OK. Will update. Thanks. > You also messed up your To: line, keeping anyone from being able to > respond to this message who do not know how to hand-edit the response > line :( I put all expected reviewers in the Cc line and will put into To lin

Re: [PATCH V3 00/10] X86/KVM/Hyper-V: Add HV ept tlb range list flush support in KVM

2019-02-23 Thread Tianyu Lan
chset is based on the fix patch "x86/Hyper-V: Fix definition > > HV_MAX_FLUSH_REP_COUNT". > > (https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1939455.html) > > Note that this won't make it in 5.1 unless Linus releases an -rc8. > Otherwise, I'll get

Re: [PATCH 1/3] x86/Hyper-V: Set x2apic destination mode to physical when x2apic is available

2019-01-31 Thread Tianyu Lan
ted()) > x2apic_phys = 1; > > It works the same and is slightly more pleasant to look at. Yes, that will better. Thanks for your suggestion. Dan -- Best regards Tianyu Lan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 1/3] x86/Hyper-V: Set x2apic destination mode to physical when x2apic is available

2019-01-31 Thread Tianyu Lan
-36,6 +36,8 @@ > > struct ms_hyperv_info ms_hyperv; > > EXPORT_SYMBOL_GPL(ms_hyperv); > > > > +extern int x2apic_phys; > > Shouldn't this be in a .h file somewhere instead? You are right. I should use here. Thanks. > thanks, > > greg k-h -- Best regards

Re: [Update PATCH] x86/Hyper-V: Initialize Syn timer clock when it's

2020-04-02 Thread Tianyu Lan
Hi Dan: Sorry. Please ignore this patch and it's based on the old code. On 4/2/2020 7:21 PM, Dan Carpenter wrote: This doesn't apply to today's linux-next. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org

Re: [Update PATCH] x86/Hyper-V: Initialize Syn timer clock when it's

2020-03-30 Thread Tianyu Lan
Hi Vitaly: Thanks for your review. On 3/30/2020 11:09 PM, Vitaly Kuznetsov wrote: ltyker...@gmail.com writes: From: Tianyu Lan Current code initializes clock event data structure for syn timer even when it's not available. Fix it. Signed-off-by: Tianyu Lan --- - Fix the wrong title

Re: [PATCH V2] x86/Hyper-V: don't allocate clockevent device when synthetic timer is unavailable

2020-03-31 Thread Tianyu Lan
On 3/31/2020 7:20 PM, Vitaly Kuznetsov wrote: ltyker...@gmail.com writes: From: Tianyu Lan Current code initializes clock event data structure for syn timer even when it's unavailable. Fix it. Signed-off-by: Tianyu Lan --- Change since v1: Update title and commit log. drivers/hv

Re: [PATCH] x86/Hyper-V: Initialize Syn timer clock even when it's not available

2020-03-30 Thread Tianyu Lan
Sorry for wrong title. Please ignore it. On 3/30/2020 10:09 PM, ltyker...@gmail.com wrote: From: Tianyu Lan Current code initializes clock event data structure for syn timer even when it's available or not. Fix it. Signed-off-by: Tianyu Lan --- drivers/hv/hv.c | 15 +-- 1