From: Ingo Molnar <mingo@elte.hu>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [kvm-devel] [PATCH] KVM: MMU: Fix guest writes to nonpae pde
Date: Sun, 11 Mar 2007 11:32:50 +0100 [thread overview]
Message-ID: <20070311103250.GA23396@elte.hu> (raw)
In-Reply-To: <11736076283297-git-send-email-avi@qumranet.com>
* Avi Kivity <avi@qumranet.com> wrote:
> KVM shadow page tables are always in pae mode, regardless of the guest
> setting. This means that a guest pde (mapping 4MB of memory) is
> mapped to two shadow pdes (mapping 2MB each).
>
> When the guest writes to a pte or pde, we intercept the write and
> emulate it. We also remove any shadowed mappings corresponding to the
> write. Since the mmu did not account for the doubling in the number
> of pdes, it removed the wrong entry, resulting in a mismatch between
> shadow page tables and guest page tables, followed shortly by guest
> memory corruption.
>
> This patch fixes the problem by detecting the special case of writing
> to a non-pae pde and adjusting the address and number of shadow pdes
> zapped accordingly.
>
> Signed-off-by: Avi Kivity <avi@qumranet.com>
tested this with both PAE and non-PAE Linux host and guest - works fine.
Acked-by: Ingo Molnar <mingo@elte.hu>
Ingo
next prev parent reply other threads:[~2007-03-11 10:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-11 10:07 [PATCH 0/2] KVM: More fixes for 2.6.21-rc3 Avi Kivity
[not found] ` <11736076283998-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-11 10:07 ` [PATCH] KVM: MMU: Fix guest writes to nonpae pde Avi Kivity
2007-03-11 10:32 ` Ingo Molnar [this message]
2007-03-11 10:07 ` [PATCH] KVM: MMU: Fix host memory corruption on i386 with >= 4GB ram Avi Kivity
2007-03-11 10:33 ` [kvm-devel] " Ingo Molnar
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=20070311103250.GA23396@elte.hu \
--to=mingo@elte.hu \
--cc=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox