Re: [PATCH v3 04/11] KVM: page track: add the framework of guest page tracking

From: Xiao Guangrong
Date: Mon Feb 22 2016 - 23:05:56 EST




On 02/19/2016 07:24 PM, Paolo Bonzini wrote:


On 14/02/2016 12:31, Xiao Guangrong wrote:

#define KVM_MAX_VCPUS 255
#define KVM_SOFT_MAX_VCPUS 160
@@ -650,6 +651,7 @@ struct kvm_lpage_info {
struct kvm_arch_memory_slot {
struct kvm_rmap_head *rmap[KVM_NR_PAGE_SIZES];
struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1];
+ unsigned short *gfn_track[KVM_PAGE_TRACK_MAX];

Please add a comment at struct kvm_mmu_page_role mentioning that the
number of role bits for shadow pages (i.e. not counting direct and
invalid) must not exceed 15 (16 thoretically risks overflow already!),
and counting the 14 bits that are in use.


Okay, good idea, it can avoid the potential issue in the future development,
will do it in the next version.