Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-24 Thread Nadav Amit
On Jul 18, 2014, at 12:38 AM, Marcelo Tosatti wrote: > On Thu, Jul 17, 2014 at 08:18:03PM +0300, Nadav Amit wrote: >> Small question if I may regarding kvm_mmu_pin_pages: >> ... >> I understand that the current use-case is for pinning only few >> pages. Yet, wouldn't it be better (for performan

Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-21 Thread Xiao Guangrong
On 07/22/2014 05:46 AM, Xiao Guangrong wrote: >> +if (is_pinned_spte(*sptep)) { >> +/* don't nuke pinned sptes if page aging: return >> + * young=yes instead. >> + */ >> +if (age) >> +

Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-21 Thread Xiao Guangrong
Hi Marcelo, On Jul 10, 2014, at 3:12 AM, mtosa...@redhat.com wrote: > struct kvm_vcpu_arch { > /* >* rip and regs accesses must go through > @@ -392,6 +402,9 @@ > struct kvm_mmu_memory_cache mmu_page_cache; > struct kvm_mmu_memory_cache mmu_page_header_cache; > > +

Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-17 Thread Marcelo Tosatti
On Thu, Jul 17, 2014 at 08:18:03PM +0300, Nadav Amit wrote: > Small question if I may regarding kvm_mmu_pin_pages: > > On 7/9/14, 10:12 PM, mtosa...@redhat.com wrote: > >+ > >+static int kvm_mmu_pin_pages(struct kvm_vcpu *vcpu) > >+{ > >+struct kvm_pinned_page_range *p; > >+int r = 1; > >+

Re: [patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-17 Thread Nadav Amit
Small question if I may regarding kvm_mmu_pin_pages: On 7/9/14, 10:12 PM, mtosa...@redhat.com wrote: + +static int kvm_mmu_pin_pages(struct kvm_vcpu *vcpu) +{ + struct kvm_pinned_page_range *p; + int r = 1; + + if (is_guest_mode(vcpu)) + return r; + + if (!v

[patch 2/4] KVM: MMU: allow pinning spte translations (TDP-only)

2014-07-09 Thread mtosatti
Allow vcpus to pin spte translations by: 1) Creating a per-vcpu list of pinned ranges. 2) On mmu reload request: - Fault ranges. - Mark sptes with a pinned bit. - Mark shadow pages as pinned. 3) Then modify the following actions: - Page age => skip spte flush.