From: Avi Kivity <avi@redhat.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: don't treat NULL parent_pte as multimapped in mmu_parent_walk()
Date: Thu, 07 Jan 2010 18:05:56 +0200 [thread overview]
Message-ID: <4B460664.1090006@redhat.com> (raw)
In-Reply-To: <4B460441.6090602@gmail.com>
On 01/07/2010 05:56 PM, Roel Kluin wrote:
> If a kvm_mmu_page is not multimapped but parent_pte is NULL
> don't treat it as multimapped and dereference it.
>
> Signed-off-by: Roel Kluin<roel.kluin@gmail.com>
> ---
> This wasn't tested and maybe I misunderstood so please review.
>
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 4c3e5b2..eb17287 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -1031,10 +1031,12 @@ static void mmu_parent_walk(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
> struct kvm_mmu_page *parent_sp;
> int i;
>
> - if (!sp->multimapped&& sp->parent_pte) {
> - parent_sp = page_header(__pa(sp->parent_pte));
> - fn(vcpu, parent_sp);
> - mmu_parent_walk(vcpu, parent_sp, fn);
> + if (!sp->multimapped) {
> + if (sp->parent_pte) {
> + parent_sp = page_header(__pa(sp->parent_pte));
> + fn(vcpu, parent_sp);
> + mmu_parent_walk(vcpu, parent_sp, fn);
> + }
> return;
> }
> hlist_for_each_entry(pte_chain, node,&sp->parent_ptes, link)
>
>
If sp->parent_pte is NULL then the list walk terminates immediately.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2010-01-07 16:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-07 15:56 [PATCH] kvm: don't treat NULL parent_pte as multimapped in mmu_parent_walk() Roel Kluin
2010-01-07 16:05 ` Avi Kivity [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-01-07 15:56 Roel Kluin
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=4B460664.1090006@redhat.com \
--to=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=roel.kluin@gmail.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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.