public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <guangrong.xiao@linux.intel.com>
To: "jack.chen" <zhunxun@gmail.com>, KVM maillist <kvm@vger.kernel.org>
Subject: Re: EPT questions!
Date: Wed, 1 Mar 2017 11:40:31 +0800	[thread overview]
Message-ID: <d2b8429d-12cc-871a-fb0f-4c68cb5c2f9d@linux.intel.com> (raw)
In-Reply-To: <CADUDsArkjWNN8+vOxtEQ2TumHfM6ne2TsoM-x7NcJn0ojtf=cA@mail.gmail.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;
> }
>

  reply	other threads:[~2017-03-01  3:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  2:46 EPT questions! jack.chen
2017-03-01  3:40 ` Xiao Guangrong [this message]
2017-03-01  6:18   ` jack.chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2b8429d-12cc-871a-fb0f-4c68cb5c2f9d@linux.intel.com \
    --to=guangrong.xiao@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=zhunxun@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox