All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Subject: bogus gfn - mfn - gfn - mfn checks in guest_physmap_add_entry
Date: Tue, 23 Nov 2010 22:01:58 +0100	[thread overview]
Message-ID: <20101123210158.GA9425@aepfle.de> (raw)


Hello,

what is the purpose of the mfn_to_gfn() check in
guest_physmap_add_entry()?
This function gets a fresh mfn and its gfn passed to update the global
p2m state. But before doing that, it checks wether that fresh mfn maps
still to some gfn. If it does, it checks if that gfn maps to any mfn. If
it doesnt, Xen crashes with an assert.

Now, if that mfn was part of an old guest, should that old guest cleanup
all of its mfns and update the machine_to_phys_mapping[]? Appearently
that rarely happens.
And if there is still some random gfn number in that array, the function
tries to see what happens with this number in the current guests
context. IF that number happens to be a gfn in paged-out state, there
will be no mfn. So the ASSERT triggers.

I would guess that if guest_physmap_add_entry() gets a page with type
p2m_ram_rw, nothing else can own that page. Is that right?
If so, this ASSERT or most of the loop can be removed.


Olaf

             reply	other threads:[~2010-11-23 21:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 21:01 Olaf Hering [this message]
2010-11-24 10:22 ` bogus gfn - mfn - gfn - mfn checks in guest_physmap_add_entry Tim Deegan
2010-11-24 10:26   ` Tim Deegan
2010-11-24 14:41   ` Olaf Hering
2010-11-24 14:53     ` Tim Deegan
2010-11-24 15:00       ` Olaf Hering
2010-11-25 15:03       ` Olaf Hering
2010-11-25 15:32         ` Tim Deegan
2010-11-25 20:56           ` Olaf Hering
2010-11-25 17:16         ` Keir Fraser
2010-11-25 20:53           ` Olaf Hering
2010-11-25 22:30             ` Keir Fraser
2010-11-26  7:27               ` Olaf Hering
2010-11-24 19:58     ` Olaf Hering
2010-11-24 20:25       ` Patrick Colp

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=20101123210158.GA9425@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.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.