From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: KVM: MMU: bail out pagewalk on kvm_read_guest error
Date: Sun, 17 Jan 2010 10:23:37 +0200 [thread overview]
Message-ID: <4B52C909.2010909@redhat.com> (raw)
In-Reply-To: <20100114194127.GA3968@amt.cnet>
On 01/14/2010 09:41 PM, Marcelo Tosatti wrote:
> Exit the guest pagetable walk loop if reading gpte failed. Otherwise its
> possible to enter an endless loop processing the previous present pte.
>
> Cc: stable@kernel.org
> Signed-off-by: Marcelo Tosatti<mtosatti@redhat.com>
>
> diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
> index 58a0f1e..ede2131 100644
> --- a/arch/x86/kvm/paging_tmpl.h
> +++ b/arch/x86/kvm/paging_tmpl.h
> @@ -150,7 +150,9 @@ walk:
> walker->table_gfn[walker->level - 1] = table_gfn;
> walker->pte_gpa[walker->level - 1] = pte_gpa;
>
> - kvm_read_guest(vcpu->kvm, pte_gpa,&pte, sizeof(pte));
> + if (kvm_read_guest(vcpu->kvm, pte_gpa,&pte, sizeof(pte)))
> + goto not_present;
> +
>
On real hardware, if you place a pte at non-existing memory, you aren't
guaranteed to get the present bit clear, so why is this necessary?
We should be able to survive any garbage the pte previously contained.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-01-17 8:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 19:41 KVM: MMU: bail out pagewalk on kvm_read_guest error Marcelo Tosatti
2010-01-17 8:23 ` Avi Kivity [this message]
2010-01-18 17:05 ` Marcelo Tosatti
2010-01-18 17:10 ` Avi Kivity
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=4B52C909.2010909@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.