From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm-devel <kvm@vger.kernel.org>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Subject: Re: KVM: MMU: drop read-only large sptes when creating lower level sptes
Date: Tue, 25 Feb 2014 09:23:51 +0100 [thread overview]
Message-ID: <530C5317.5060406@redhat.com> (raw)
In-Reply-To: <20140224165932.GA15971@amt.cnet>
Il 24/02/2014 17:59, Marcelo Tosatti ha scritto:
>
> Read-only large sptes can be created due to read-only faults as
> follows:
>
> - QEMU pagetable entry that maps guest memory is read-only
> due to COW.
> - Guest read faults such memory, COW is not broken, because
> it is a read-only fault.
> - Enable dirty logging, large spte not nuked because it is read-only.
> - Write-fault on such memory causes guest to loop endlessly
> (which must go down to level 1 because dirty logging is enabled).
>
> Fix by dropping large spte when necessary.
>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index e50425d..9b53135 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -2672,6 +2672,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
> break;
> }
>
> + drop_large_spte(vcpu, iterator.sptep);
> if (!is_shadow_present_pte(*iterator.sptep)) {
> u64 base_addr = iterator.addr;
>
>
>
Queued for kvm/master, will push as soon as I test it.
Thanks,
Paolo
prev parent reply other threads:[~2014-02-25 8:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 16:59 KVM: MMU: drop read-only large sptes when creating lower level sptes Marcelo Tosatti
2014-02-25 3:30 ` Xiao Guangrong
2014-02-25 13:13 ` Marcelo Tosatti
2014-02-25 15:11 ` Xiao Guangrong
2014-02-25 22:52 ` Marcelo Tosatti
2014-02-25 8:23 ` Paolo Bonzini [this message]
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=530C5317.5060406@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=xiaoguangrong@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).