* EPT questions!
@ 2017-03-01 2:46 jack.chen
2017-03-01 3:40 ` Xiao Guangrong
0 siblings, 1 reply; 3+ messages in thread
From: jack.chen @ 2017-03-01 2:46 UTC (permalink / raw)
To: KVM maillist
hello,I am confused about kvm_mmu_get_page function in KVM source
code,why it look for a the hash list first rather than alloc a new
page, what is the function of the hash list.thanks!
for_each_gfn_sp(vcpu->kvm, sp, gfn) {
if (is_obsolete_sp(vcpu->kvm, sp))
continue;
if (!need_sync && sp->unsync)
need_sync = true;
if (sp->role.word != role.word)
continue;
if (sp->unsync && kvm_sync_page_transient(vcpu, sp))
break;
mmu_page_add_parent_pte(vcpu, sp, parent_pte);
if (sp->unsync_children) {
kvm_make_request(KVM_REQ_MMU_SYNC, vcpu);
kvm_mmu_mark_parents_unsync(sp);
} else if (sp->unsync)
kvm_mmu_mark_parents_unsync(sp);
__clear_sp_write_flooding_count(sp);
trace_kvm_mmu_get_page(sp, false);
return sp;
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: EPT questions!
2017-03-01 2:46 EPT questions! jack.chen
@ 2017-03-01 3:40 ` Xiao Guangrong
2017-03-01 6:18 ` jack.chen
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Guangrong @ 2017-03-01 3:40 UTC (permalink / raw)
To: jack.chen, KVM maillist
Hash list is used as a cache. KVM is always trying to reuse the
existing SP if possible.
On 03/01/2017 10:46 AM, jack.chen wrote:
> hello,I am confused about kvm_mmu_get_page function in KVM source
> code,why it look for a the hash list first rather than alloc a new
> page, what is the function of the hash list.thanks!
> for_each_gfn_sp(vcpu->kvm, sp, gfn) {
>
> if (is_obsolete_sp(vcpu->kvm, sp))
> continue;
>
> if (!need_sync && sp->unsync)
> need_sync = true;
>
> if (sp->role.word != role.word)
> continue;
>
> if (sp->unsync && kvm_sync_page_transient(vcpu, sp))
> break;
>
> mmu_page_add_parent_pte(vcpu, sp, parent_pte);
> if (sp->unsync_children) {
> kvm_make_request(KVM_REQ_MMU_SYNC, vcpu);
> kvm_mmu_mark_parents_unsync(sp);
> } else if (sp->unsync)
> kvm_mmu_mark_parents_unsync(sp);
>
> __clear_sp_write_flooding_count(sp);
> trace_kvm_mmu_get_page(sp, false);
> return sp;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: EPT questions!
2017-03-01 3:40 ` Xiao Guangrong
@ 2017-03-01 6:18 ` jack.chen
0 siblings, 0 replies; 3+ messages in thread
From: jack.chen @ 2017-03-01 6:18 UTC (permalink / raw)
To: Xiao Guangrong; +Cc: KVM maillist
Thanks,I found everytime KVM creates a new kvm_mmu_page,it instert it
to hash list,but why the list have alweady existed SP corresponding
to specific gfn??
how KVM maintain the hash list??
thanks
2017-03-01 11:40 GMT+08:00 Xiao Guangrong <guangrong.xiao@linux.intel.com>:
>
> Hash list is used as a cache. KVM is always trying to reuse the
> existing SP if possible.
>
>
>
> On 03/01/2017 10:46 AM, jack.chen wrote:
>>
>> hello,I am confused about kvm_mmu_get_page function in KVM source
>> code,why it look for a the hash list first rather than alloc a new
>> page, what is the function of the hash list.thanks!
>> for_each_gfn_sp(vcpu->kvm, sp, gfn) {
>>
>> if (is_obsolete_sp(vcpu->kvm, sp))
>> continue;
>>
>> if (!need_sync && sp->unsync)
>> need_sync = true;
>>
>> if (sp->role.word != role.word)
>> continue;
>>
>> if (sp->unsync && kvm_sync_page_transient(vcpu, sp))
>> break;
>>
>> mmu_page_add_parent_pte(vcpu, sp, parent_pte);
>> if (sp->unsync_children) {
>> kvm_make_request(KVM_REQ_MMU_SYNC, vcpu);
>> kvm_mmu_mark_parents_unsync(sp);
>> } else if (sp->unsync)
>> kvm_mmu_mark_parents_unsync(sp);
>>
>> __clear_sp_write_flooding_count(sp);
>> trace_kvm_mmu_get_page(sp, false);
>> return sp;
>> }
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-01 6:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-01 2:46 EPT questions! jack.chen
2017-03-01 3:40 ` Xiao Guangrong
2017-03-01 6:18 ` jack.chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox