* [PATCH] kvm: don't treat NULL parent_pte as multimapped in mmu_parent_walk()
@ 2010-01-07 15:56 Roel Kluin
2010-01-07 16:05 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2010-01-07 15:56 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, kvm, linux-kernel
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kvm: don't treat NULL parent_pte as multimapped in mmu_parent_walk()
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
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-01-07 16:05 UTC (permalink / raw)
To: Roel Kluin
Cc: Marcelo Tosatti, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
x86, kvm, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-07 16:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).