kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Wayne Li <waynli329@gmail.com>, kvm-devel <kvm@vger.kernel.org>,
	kvm-ppc <kvm-ppc@vger.kernel.org>, qemu-ppc <qemu-ppc@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: Problem with virtual to physical memory translation when KVM is enabled.
Date: Tue, 3 Mar 2020 13:39:32 +1100	[thread overview]
Message-ID: <20200303023932.GC35885@umbus.fritz.box> (raw)
In-Reply-To: <CAFEAcA84xCMzUNfYNBNR8ShA58aor_rbYTq7jnmsLQqhvbOH8w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

On Tue, Feb 25, 2020 at 04:16:43PM +0000, Peter Maydell wrote:
> On Tue, 25 Feb 2020 at 16:10, Wayne Li <waynli329@gmail.com> wrote:
> > So what could be causing this problem?  I’m guessing it has something
> > to do with the translation lookaside buffers (TLBs)?  But the
> > translation between virtual and physical memory clearly works when KVM
> > isn’t enabled.  So what could cause this to stop working when KVM is
> > enabled?
> 
> When you're not using KVM, virtual-to-physical lookups are
> done using QEMU's emulation code that emulates the MMU.
> When you are using KVM, virtual-to-physical lookups
> are done entirely using the host CPU (except for corner
> cases like when we come out of the kernel and the user
> does things with the gdb debug stub). So all the page
> tables and other guest setup of the MMU had better match
> what the host CPU expects. (I don't know how big the
> differences between e5500 and e6500 MMU are or whether
> the PPC architecture/KVM supports emulating the one on
> the other: some PPC expert will probably be able to tell you.)

Well, sort of.  Including things like KVM-PR, things get complicated.
But in any case, the resposibility for translation lies somewhere
between the cpu itself and the KVM code - qemu is not involved.

Depending on exactly what the host's MMU looks like and what it has in
the way of virtualization features, that might make it impossible to
run a guest expecting a substantially different cpu model from the
host's.

Unfortunately, I'm not really at all familiar with the Freescale
parts, and even less with the KVM implementation for them.  It doesn't
surprise me that there are substantial bugs there, but I wouldn't
realy now where to begin to fix them.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2020-03-03  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 16:09 Problem with virtual to physical memory translation when KVM is enabled Wayne Li
2020-02-25 16:16 ` Peter Maydell
2020-03-03  2:39   ` David Gibson [this message]

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=20200303023932.GC35885@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=waynli329@gmail.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 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).