public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net,
	Thomas Cataldo <thomas.cataldo@aliasource.fr>
Subject: Re: WARNING: at /usr/src/modules/kvm/mmu.c:390	account_shadowed()
Date: Thu, 24 Apr 2008 14:14:21 -0300	[thread overview]
Message-ID: <20080424171421.GA14073@dmt> (raw)
In-Reply-To: <480ED76E.9040400@qumranet.com>

On Wed, Apr 23, 2008 at 09:30:06AM +0300, Avi Kivity wrote:
> > as I got no reply, I guess it is a bad setup on my part. If that might
> > help, this happenned while I was doing a "make -j" on webkit svn tree
> > (ie. heavy c++ compilation workload) .
> >
> >   
> 
> No this is not bad setup.  No amount of bad setup should give this warning.
> 
> You didn't get a reply because no one knows what to make of it, and 
> because it's much more fun to debate endianess or contemplete guests 
> with eighty thousand disks than to fix those impossible bugs.  If you 
> can give clear instructions on how to reproduce this, we will try it 
> out.  Please be sure to state OS name and versions for the guest as well 
> as the host.

It is valid to have more than PAGES_PER_HPAGE in the largepage's
shadowed count. If the gpte read races with a pte-update-from-guest (and
the pte update results in a different sp->role), it might account twice
for a single gfn.

Such "zombie" shadow pages should eventually be removed through
recycling, allowing for instantiation of a large page, unless references
can be leaked. Can't spot such leakage problem though.

Thoughts?

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 2ad6f54..8ae2118 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -387,7 +387,6 @@ static void account_shadowed(struct kvm *kvm, gfn_t gfn)
 
 	write_count = slot_largepage_idx(gfn, gfn_to_memslot(kvm, gfn));
 	*write_count += 1;
-	WARN_ON(*write_count > KVM_PAGES_PER_HPAGE);
 }
 
 static void unaccount_shadowed(struct kvm *kvm, gfn_t gfn)

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-24 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21 19:57 WARNING: at /usr/src/modules/kvm/mmu.c:390 account_shadowed() Thomas Cataldo
2008-04-22 22:11 ` Thomas Cataldo
2008-04-23  6:30   ` Avi Kivity
2008-04-24 17:14     ` Marcelo Tosatti [this message]
2008-04-26  8:08       ` Avi Kivity
2008-04-30 19:34         ` Thomas Cataldo
     [not found]         ` <f19173c90805190217l508bd81fsb249c0b3a450d5fe@mail.gmail.com>
2008-05-19  9:23           ` Fwd: [kvm-devel] " Thomas Cataldo
2008-05-19 14:30           ` 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=20080424171421.GA14073@dmt \
    --to=mtosatti@redhat.com \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=thomas.cataldo@aliasource.fr \
    /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