Re: [PATCH RESEND v4 8/9] KVM: MMU: Enable Lazy mode SPPT setup

2019-09-10 Thread Yang Weijiang
On Mon, Sep 09, 2019 at 07:10:22PM +0200, Paolo Bonzini wrote: > On 04/09/19 15:49, Yang Weijiang wrote: > >>> This would not enable SPP if the guest is backed by huge pages. > >>> Instead, either the PT_PAGE_TABLE_LEVEL level must be forced for all > >>> pages covered by SPP ranges, or (better)

Re: [PATCH RESEND v4 8/9] KVM: MMU: Enable Lazy mode SPPT setup

2019-09-09 Thread Paolo Bonzini
On 04/09/19 15:49, Yang Weijiang wrote: >>> This would not enable SPP if the guest is backed by huge pages. >>> Instead, either the PT_PAGE_TABLE_LEVEL level must be forced for all >>> pages covered by SPP ranges, or (better) kvm_enable_spp_protection must >>> be able to cover multiple pages at

Re: [PATCH RESEND v4 8/9] KVM: MMU: Enable Lazy mode SPPT setup

2019-09-04 Thread Yang Weijiang
On Tue, Aug 20, 2019 at 09:12:14PM +0800, Yang Weijiang wrote: > On Mon, Aug 19, 2019 at 04:46:54PM +0200, Paolo Bonzini wrote: > > On 14/08/19 09:04, Yang Weijiang wrote: > > > + > > > + if (vcpu->kvm->arch.spp_active && level == PT_PAGE_TABLE_LEVEL) > > > +

Re: [PATCH RESEND v4 8/9] KVM: MMU: Enable Lazy mode SPPT setup

2019-08-20 Thread Yang Weijiang
On Mon, Aug 19, 2019 at 04:46:54PM +0200, Paolo Bonzini wrote: > On 14/08/19 09:04, Yang Weijiang wrote: > > + > > + if (vcpu->kvm->arch.spp_active && level == PT_PAGE_TABLE_LEVEL) > > + kvm_enable_spp_protection(vcpu->kvm, gfn); > > + > > This would not enable SPP if the guest is

Re: [PATCH RESEND v4 8/9] KVM: MMU: Enable Lazy mode SPPT setup

2019-08-19 Thread Paolo Bonzini
On 14/08/19 09:04, Yang Weijiang wrote: > + > + if (vcpu->kvm->arch.spp_active && level == PT_PAGE_TABLE_LEVEL) > + kvm_enable_spp_protection(vcpu->kvm, gfn); > + This would not enable SPP if the guest is backed by huge pages. Instead, either the PT_PAGE_TABLE_LEVEL level must be

[PATCH RESEND v4 8/9] KVM: MMU: Enable Lazy mode SPPT setup

2019-08-14 Thread Yang Weijiang
If SPP subpages are set while the physical page are not available in EPT leaf entry, the mapping is first stored in SPP access bitmap buffer. SPPT setup is deferred to access to the protected page, in EPT page fault handler, the SPPT enries are set up. Signed-off-by: Yang Weijiang ---