Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
On 08/04/2015 09:23 PM, Paolo Bonzini wrote: On 04/08/2015 15:10, Xiao Guangrong wrote: This should be cpu_has_nx, I think. cpu_has_nx() checks the feature on host CPU, however, this is the shadow page table which completely follow guest's features. E.g, if guest does not

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 15:10, Xiao Guangrong wrote: >> >> This should be cpu_has_nx, I think. > > cpu_has_nx() checks the feature on host CPU, however, this is the shadow > page table which completely follow guest's features. > > E.g, if guest does not execution-protect the physical page, then > KVM

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
On 08/04/2015 08:14 PM, Paolo Bonzini wrote: On 04/08/2015 12:59, Xiao Guangrong wrote: +/* + * the page table on host is the shadow page table for the page + * table in guest or amd nested guest, its mmu features completely + * follow the features in guest. + */ +void

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 12:59, Xiao Guangrong wrote: > +/* > + * the page table on host is the shadow page table for the page > + * table in guest or amd nested guest, its mmu features completely > + * follow the features in guest. > + */ > +void > +reset_shadow_rsvds_bits_mask(struct kvm_vcpu *vcpu,

[PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
We have abstracted the data struct and functions which are used to check reserved bit on guest page tables, now we extend the logic to check reserved bits on shadow page tables Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/mmu.c | 51

[PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
We have abstracted the data struct and functions which are used to check reserved bit on guest page tables, now we extend the logic to check reserved bits on shadow page tables Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/include/asm/kvm_host.h | 1 +

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
On 08/04/2015 09:23 PM, Paolo Bonzini wrote: On 04/08/2015 15:10, Xiao Guangrong wrote: This should be cpu_has_nx, I think. cpu_has_nx() checks the feature on host CPU, however, this is the shadow page table which completely follow guest's features. E.g, if guest does not

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Xiao Guangrong
On 08/04/2015 08:14 PM, Paolo Bonzini wrote: On 04/08/2015 12:59, Xiao Guangrong wrote: +/* + * the page table on host is the shadow page table for the page + * table in guest or amd nested guest, its mmu features completely + * follow the features in guest. + */ +void

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 15:10, Xiao Guangrong wrote: This should be cpu_has_nx, I think. cpu_has_nx() checks the feature on host CPU, however, this is the shadow page table which completely follow guest's features. E.g, if guest does not execution-protect the physical page, then KVM does not do

Re: [PATCH 6/9] KVM: MMU: introduce the framework to check reserved bits on sptes

2015-08-04 Thread Paolo Bonzini
On 04/08/2015 12:59, Xiao Guangrong wrote: +/* + * the page table on host is the shadow page table for the page + * table in guest or amd nested guest, its mmu features completely + * follow the features in guest. + */ +void +reset_shadow_rsvds_bits_mask(struct kvm_vcpu *vcpu, struct