All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Alexander Graf <agraf@suse.de>
Cc: Scott Wood <scottwood@freescale.com>,
	Yoder Stuart-B08248 <B08248@freescale.com>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: RFC: New API for PPC for vcpu mmu access
Date: Thu, 10 Feb 2011 13:31:24 +0100	[thread overview]
Message-ID: <20110210123124.GA16377@edde.se.axis.com> (raw)
In-Reply-To: <4D53D22A.2010008@suse.de>

On Thu, Feb 10, 2011 at 12:55:22PM +0100, Alexander Graf wrote:
> Scott Wood wrote:
> > On Thu, 3 Feb 2011 10:19:06 +0100
> > Alexander Graf <agraf@suse.de> wrote:
> >
> >   
> >> Yeah, that one's tricky. Usually the way the memory resolver in qemu works is as follows:
> >>
> >>  * kvm goes to qemu
> >>  * qemu fetches all mmu and register data from kvm
> >>  * qemu runs its mmu resolution function as if the target was emulated
> >>
> >> So the "normal" way would be to fetch _all_ TLB entries from KVM, shove them into env and implement the MMU in qemu (at least enough of it to enable debugging). No other target modifies this code path. But no other target needs to copy > 30kb of data only to get the mmu data either :).
> >>     
> >
> > I guess you mean that cpu_synchronize_state() is supposed to pull in the
> > MMU state, though I don't see where it gets called for 'm'/'M' commands in
> > the gdb stub.
> >   
> 
> Well, we could also call it in get_phys_page_debug in target-ppc, but
> yes. I guess the reason it works for now is that SDR1 is pretty constant
> and was fetched earlier on. For BookE not syncing is obviously even more
> broken.
> 
> > The MMU code seems to be pretty target-specific.  It's not clear to what
> > extent there is a "normal" way, versus what book3s happens to rely on in
> > its get_physical_address() code.  I don't think there are any platforms
> > supported yet (with both KVM and a non-empty cpu_get_phys_page_debug()
> > implementation) that have a pure software-managed TLB.  x86 has page
> > tables, and book3s has the hash table (603/e300 doesn't, or more accurately
> > Linux doesn't use it, but I guess that's not supported by KVM yet?).
> >   
> 
> As for PPC, only 440, e500 and G3-5 are basically supported. It happens
> to work on POWER4 and above too and I've even got reports that it's good
> on e600 :).
> 
> > We could probably do some sort of lazy state transfer only when MMU code
> > that needs it is run.  This could initially include debug translations, for
> > testing a non-KVM-dependent get_physical_address() implementation, but
> > eventually that would use KVM_TRANSLATE (when KVM is used) and thus not
> >   
> 
> Yup :).
> 
> > trigger the state transfer.  I'd also like to add an "info tlb" command,
> > which would require the state transfer.
> >   
> 
> Very nice.
> 
> > BTW, how much other than the MMU is missing to be able to run an e500
> > target in qemu, without kvm?
> >   
> 
> The last person working on BookE emulation was Edgar. Edgar, how far did
> you get?

Hi,

TBH, I don't really know. My goal was to get linux running on an PPC-440
embedded with the Xilinx FPGA's. I managed to fix enough BookE emulation
to get that far.

After that, we've done a few more hacks to run fsboot and uboot. Also,
we've added support for some of the BookE debug registers to be able
to run gdbserver from within linux guests. Some of these patches haven't
made it upstream yet.

I haven't taken the time to compare the specs to qemu code, so I don't
really know how much is missing. My guess is that If you wan't to run
linux guests, the MMU won't be the limiting factor.

Cheers

WARNING: multiple messages have this Message-ID (diff)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Alexander Graf <agraf@suse.de>
Cc: Scott Wood <scottwood@freescale.com>,
	Yoder Stuart-B08248 <B08248@freescale.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: RFC: New API for PPC for vcpu mmu access
Date: Thu, 10 Feb 2011 13:31:24 +0100	[thread overview]
Message-ID: <20110210123124.GA16377@edde.se.axis.com> (raw)
In-Reply-To: <4D53D22A.2010008@suse.de>

On Thu, Feb 10, 2011 at 12:55:22PM +0100, Alexander Graf wrote:
> Scott Wood wrote:
> > On Thu, 3 Feb 2011 10:19:06 +0100
> > Alexander Graf <agraf@suse.de> wrote:
> >
> >   
> >> Yeah, that one's tricky. Usually the way the memory resolver in qemu works is as follows:
> >>
> >>  * kvm goes to qemu
> >>  * qemu fetches all mmu and register data from kvm
> >>  * qemu runs its mmu resolution function as if the target was emulated
> >>
> >> So the "normal" way would be to fetch _all_ TLB entries from KVM, shove them into env and implement the MMU in qemu (at least enough of it to enable debugging). No other target modifies this code path. But no other target needs to copy > 30kb of data only to get the mmu data either :).
> >>     
> >
> > I guess you mean that cpu_synchronize_state() is supposed to pull in the
> > MMU state, though I don't see where it gets called for 'm'/'M' commands in
> > the gdb stub.
> >   
> 
> Well, we could also call it in get_phys_page_debug in target-ppc, but
> yes. I guess the reason it works for now is that SDR1 is pretty constant
> and was fetched earlier on. For BookE not syncing is obviously even more
> broken.
> 
> > The MMU code seems to be pretty target-specific.  It's not clear to what
> > extent there is a "normal" way, versus what book3s happens to rely on in
> > its get_physical_address() code.  I don't think there are any platforms
> > supported yet (with both KVM and a non-empty cpu_get_phys_page_debug()
> > implementation) that have a pure software-managed TLB.  x86 has page
> > tables, and book3s has the hash table (603/e300 doesn't, or more accurately
> > Linux doesn't use it, but I guess that's not supported by KVM yet?).
> >   
> 
> As for PPC, only 440, e500 and G3-5 are basically supported. It happens
> to work on POWER4 and above too and I've even got reports that it's good
> on e600 :).
> 
> > We could probably do some sort of lazy state transfer only when MMU code
> > that needs it is run.  This could initially include debug translations, for
> > testing a non-KVM-dependent get_physical_address() implementation, but
> > eventually that would use KVM_TRANSLATE (when KVM is used) and thus not
> >   
> 
> Yup :).
> 
> > trigger the state transfer.  I'd also like to add an "info tlb" command,
> > which would require the state transfer.
> >   
> 
> Very nice.
> 
> > BTW, how much other than the MMU is missing to be able to run an e500
> > target in qemu, without kvm?
> >   
> 
> The last person working on BookE emulation was Edgar. Edgar, how far did
> you get?

Hi,

TBH, I don't really know. My goal was to get linux running on an PPC-440
embedded with the Xilinx FPGA's. I managed to fix enough BookE emulation
to get that far.

After that, we've done a few more hacks to run fsboot and uboot. Also,
we've added support for some of the BookE debug registers to be able
to run gdbserver from within linux guests. Some of these patches haven't
made it upstream yet.

I haven't taken the time to compare the specs to qemu code, so I don't
really know how much is missing. My guess is that If you wan't to run
linux guests, the MMU won't be the limiting factor.

Cheers

WARNING: multiple messages have this Message-ID (diff)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Alexander Graf <agraf@suse.de>
Cc: Scott Wood <scottwood@freescale.com>,
	Yoder Stuart-B08248 <B08248@freescale.com>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: RFC: New API for PPC for vcpu mmu access
Date: Thu, 10 Feb 2011 12:31:24 +0000	[thread overview]
Message-ID: <20110210123124.GA16377@edde.se.axis.com> (raw)
In-Reply-To: <4D53D22A.2010008@suse.de>

On Thu, Feb 10, 2011 at 12:55:22PM +0100, Alexander Graf wrote:
> Scott Wood wrote:
> > On Thu, 3 Feb 2011 10:19:06 +0100
> > Alexander Graf <agraf@suse.de> wrote:
> >
> >   
> >> Yeah, that one's tricky. Usually the way the memory resolver in qemu works is as follows:
> >>
> >>  * kvm goes to qemu
> >>  * qemu fetches all mmu and register data from kvm
> >>  * qemu runs its mmu resolution function as if the target was emulated
> >>
> >> So the "normal" way would be to fetch _all_ TLB entries from KVM, shove them into env and implement the MMU in qemu (at least enough of it to enable debugging). No other target modifies this code path. But no other target needs to copy > 30kb of data only to get the mmu data either :).
> >>     
> >
> > I guess you mean that cpu_synchronize_state() is supposed to pull in the
> > MMU state, though I don't see where it gets called for 'm'/'M' commands in
> > the gdb stub.
> >   
> 
> Well, we could also call it in get_phys_page_debug in target-ppc, but
> yes. I guess the reason it works for now is that SDR1 is pretty constant
> and was fetched earlier on. For BookE not syncing is obviously even more
> broken.
> 
> > The MMU code seems to be pretty target-specific.  It's not clear to what
> > extent there is a "normal" way, versus what book3s happens to rely on in
> > its get_physical_address() code.  I don't think there are any platforms
> > supported yet (with both KVM and a non-empty cpu_get_phys_page_debug()
> > implementation) that have a pure software-managed TLB.  x86 has page
> > tables, and book3s has the hash table (603/e300 doesn't, or more accurately
> > Linux doesn't use it, but I guess that's not supported by KVM yet?).
> >   
> 
> As for PPC, only 440, e500 and G3-5 are basically supported. It happens
> to work on POWER4 and above too and I've even got reports that it's good
> on e600 :).
> 
> > We could probably do some sort of lazy state transfer only when MMU code
> > that needs it is run.  This could initially include debug translations, for
> > testing a non-KVM-dependent get_physical_address() implementation, but
> > eventually that would use KVM_TRANSLATE (when KVM is used) and thus not
> >   
> 
> Yup :).
> 
> > trigger the state transfer.  I'd also like to add an "info tlb" command,
> > which would require the state transfer.
> >   
> 
> Very nice.
> 
> > BTW, how much other than the MMU is missing to be able to run an e500
> > target in qemu, without kvm?
> >   
> 
> The last person working on BookE emulation was Edgar. Edgar, how far did
> you get?

Hi,

TBH, I don't really know. My goal was to get linux running on an PPC-440
embedded with the Xilinx FPGA's. I managed to fix enough BookE emulation
to get that far.

After that, we've done a few more hacks to run fsboot and uboot. Also,
we've added support for some of the BookE debug registers to be able
to run gdbserver from within linux guests. Some of these patches haven't
made it upstream yet.

I haven't taken the time to compare the specs to qemu code, so I don't
really know how much is missing. My guess is that If you wan't to run
linux guests, the MMU won't be the limiting factor.

Cheers

  reply	other threads:[~2011-02-10 12:31 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 20:33 RFC: New API for PPC for vcpu mmu access Yoder Stuart-B08248
2011-02-02 20:33 ` Yoder Stuart-B08248
2011-02-02 20:33 ` [Qemu-devel] " Yoder Stuart-B08248
2011-02-02 21:33 ` Alexander Graf
2011-02-02 21:33   ` Alexander Graf
2011-02-02 21:33   ` [Qemu-devel] " Alexander Graf
2011-02-02 22:08   ` Scott Wood
2011-02-02 22:08     ` Scott Wood
2011-02-02 22:08     ` [Qemu-devel] " Scott Wood
2011-02-03  9:19     ` Alexander Graf
2011-02-03  9:19       ` Alexander Graf
2011-02-03  9:19       ` [Qemu-devel] " Alexander Graf
2011-02-04 22:33       ` Scott Wood
2011-02-04 22:33         ` Scott Wood
2011-02-04 22:33         ` [Qemu-devel] " Scott Wood
2011-02-07 15:43         ` Alexander Graf
2011-02-07 15:43           ` Alexander Graf
2011-02-07 15:43           ` [Qemu-devel] " Alexander Graf
2011-02-07 16:40           ` Yoder Stuart-B08248
2011-02-07 16:40             ` Yoder Stuart-B08248
2011-02-07 16:40             ` [Qemu-devel] " Yoder Stuart-B08248
2011-02-07 16:49             ` Alexander Graf
2011-02-07 16:49               ` Alexander Graf
2011-02-07 16:49               ` [Qemu-devel] " Alexander Graf
2011-02-07 18:52               ` Scott Wood
2011-02-07 18:52                 ` Scott Wood
2011-02-07 18:52                 ` [Qemu-devel] " Scott Wood
2011-02-07 19:56                 ` Yoder Stuart-B08248
2011-02-07 19:56                   ` Yoder Stuart-B08248
2011-02-07 19:56                   ` [Qemu-devel] " Yoder Stuart-B08248
2011-02-09 17:03                   ` Alexander Graf
2011-02-09 17:03                     ` Alexander Graf
2011-02-09 17:03                     ` [Qemu-devel] " Alexander Graf
2011-02-07 20:15           ` Scott Wood
2011-02-07 20:15             ` Scott Wood
2011-02-07 20:15             ` [Qemu-devel] " Scott Wood
2011-02-09 17:21             ` Alexander Graf
2011-02-09 17:21               ` Alexander Graf
2011-02-09 17:21               ` [Qemu-devel] " Alexander Graf
2011-02-09 23:09               ` Scott Wood
2011-02-09 23:09                 ` Scott Wood
2011-02-09 23:09                 ` [Qemu-devel] " Scott Wood
2011-02-10 11:45                 ` Alexander Graf
2011-02-10 11:45                   ` Alexander Graf
2011-02-10 11:45                   ` [Qemu-devel] " Alexander Graf
2011-02-10 18:51                   ` Scott Wood
2011-02-10 18:51                     ` Scott Wood
2011-02-10 18:51                     ` [Qemu-devel] " Scott Wood
2011-02-11  0:20                     ` Alexander Graf
2011-02-11  0:20                       ` Alexander Graf
2011-02-11  0:20                       ` [Qemu-devel] " Alexander Graf
2011-02-11  0:22                       ` Alexander Graf
2011-02-11  0:22                         ` Alexander Graf
2011-02-11  0:22                         ` [Qemu-devel] " Alexander Graf
2011-02-11  1:41                         ` Alexander Graf
2011-02-11  1:41                           ` Alexander Graf
2011-02-11  1:41                           ` [Qemu-devel] " Alexander Graf
2011-02-11 20:53                           ` Scott Wood
2011-02-11 20:53                             ` Scott Wood
2011-02-11 20:53                             ` [Qemu-devel] " Scott Wood
2011-02-11 21:07                             ` Alexander Graf
2011-02-11 21:07                               ` Alexander Graf
2011-02-11 21:07                               ` [Qemu-devel] " Alexander Graf
2011-02-12  0:57                               ` Scott Wood
2011-02-12  0:57                                 ` Scott Wood
2011-02-12  0:57                                 ` [Qemu-devel] " Scott Wood
2011-02-13 22:43                                 ` Alexander Graf
2011-02-13 22:43                                   ` Alexander Graf
2011-02-13 22:43                                   ` [Qemu-devel] " Alexander Graf
2011-02-14 17:11                                   ` Scott Wood
2011-02-14 17:11                                     ` Scott Wood
2011-02-14 17:11                                     ` [Qemu-devel] " Scott Wood
2011-02-14 20:19                                     ` Alexander Graf
2011-02-14 20:19                                       ` Alexander Graf
2011-02-14 20:19                                       ` [Qemu-devel] " Alexander Graf
2011-02-14 21:16                                       ` Scott Wood
2011-02-14 21:16                                         ` Scott Wood
2011-02-14 21:16                                         ` [Qemu-devel] " Scott Wood
2011-02-14 23:39                                         ` Alexander Graf
2011-02-14 23:39                                           ` Alexander Graf
2011-02-14 23:39                                           ` [Qemu-devel] " Alexander Graf
2011-02-14 23:49                                           ` Scott Wood
2011-02-14 23:49                                             ` Scott Wood
2011-02-14 23:49                                             ` [Qemu-devel] " Scott Wood
2011-02-15  0:00                                             ` Alexander Graf
2011-02-15  0:00                                               ` Alexander Graf
2011-02-15  0:00                                               ` [Qemu-devel] " Alexander Graf
2011-02-07 17:13       ` Avi Kivity
2011-02-07 17:13         ` Avi Kivity
2011-02-07 17:13         ` [Qemu-devel] " Avi Kivity
2011-02-07 17:30         ` Yoder Stuart-B08248
2011-02-07 17:30           ` Yoder Stuart-B08248
2011-02-07 17:30           ` [Qemu-devel] " Yoder Stuart-B08248
2011-02-08  9:10           ` Avi Kivity
2011-02-08  9:10             ` Avi Kivity
2011-02-08  9:10             ` [Qemu-devel] " Avi Kivity
2011-02-10  0:04       ` Scott Wood
2011-02-10  0:04         ` Scott Wood
2011-02-10  0:04         ` [Qemu-devel] " Scott Wood
2011-02-10 11:55         ` Alexander Graf
2011-02-10 11:55           ` Alexander Graf
2011-02-10 11:55           ` [Qemu-devel] " Alexander Graf
2011-02-10 12:31           ` Edgar E. Iglesias [this message]
2011-02-10 12:31             ` Edgar E. Iglesias
2011-02-10 12:31             ` [Qemu-devel] " Edgar E. Iglesias
2011-02-02 22:34   ` Yoder Stuart-B08248
2011-02-02 22:34     ` Yoder Stuart-B08248
2011-02-02 22:34     ` [Qemu-devel] " Yoder Stuart-B08248
2011-02-03  9:29     ` Alexander Graf
2011-02-03  9:29       ` Alexander Graf
2011-02-03  9:29       ` [Qemu-devel] " Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2011-02-02 20:30 Yoder Stuart-B08248

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=20110210123124.GA16377@edde.se.axis.com \
    --to=edgar.iglesias@gmail.com \
    --cc=B08248@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=scottwood@freescale.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.