[PATCH 3/11] KVM: Add spte's point in the struct kvm_mmu_page

Paolo Bonzini pbonzini at redhat.com
Tue Jan 8 03:34:00 AEDT 2019


On 04/01/19 09:53, lantianyu1986 at gmail.com wrote:
> @@ -332,6 +332,7 @@ struct kvm_mmu_page {
>  	int root_count;          /* Currently serving as active root */
>  	unsigned int unsync_children;
>  	struct kvm_rmap_head parent_ptes; /* rmap pointers to parent sptes */
> +	u64 *sptep;

Is this really needed?  Can we put the "last" flag in the struct instead
as a bool?  In fact, if you do

	u16 unsync_children;
	bool unsync;
	bool last_level;

the struct does not grow at all. :)

(I'm not sure where "large" is tested using the sptep field, even though
it is in the commit message).

Paolo

>  	/* The page is obsolete if mmu_valid_gen != kvm->arch.mmu_valid_gen.  */
>  	unsigned long mmu_valid_gen;



More information about the Linuxppc-dev mailing list