Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: kvm-ppc@vger.kernel.org
Subject: RE: [patch 0/4] add e500 platform support  for KVM
Date: Mon, 08 Sep 2008 17:30:37 +0000	[thread overview]
Message-ID: <1220895037.11733.48.camel@localhost.localdomain> (raw)
In-Reply-To: <1218790228-19549-1-git-send-email-yu.liu@freescale.com>

On Sat, 2008-08-30 at 11:15 +0800, Liu Yu wrote:
> > > Unlike 44x use TID=0 map userspace and TID=1 map kernel space,
> > > I plan to use host TLB1 to map kernel, and host TLB0 to map 
> > userspace.
> > > This category can make it convient to handle privilege 
> > switch: that is
> > > before enterring guest just need tlbivax TLB1.
> > > Userspace tlb enties with differnet TID can exist in host 
> > TLB0 till host
> > > kvm process switch or guest meet explicit tlbiax command.
> > > 
> > > I just have this idea and have not thought all the detail through.
> > > What do you think of it?
> > 
> > You might run into problems if you ever get large guest userspace
> > mappings. I know hugetlbfs doesn't exist for e500 Linux right now, but
> > it could in the future, and plus there are other kernels to consider.
> 
> Can you give me more details? 
> I'm not sure how hugetlbfs could be in the future, but TLB0 has a fixed
> mapping size 4KB.

You can't assume that TLB1 does not contain user mappings, because
that's not true with hugetlbfs. Of course, hugetlbfs doesn't (yet?)
exist for e500, so the assumption is valid until that happens.

However, we *really* need large host page mappings to make KVM fast.
Right now we have to split guest large pages (covering the kernel) into
lots of 4K mappings, which means our TLB miss rate is *much* higher than
if we could use hugetlbfs on the host. In that case, we could use
hugetlbfs large user pages to back the guest kernel mappings.

> > > > booke_fsl_interrupts.S looks like a lot of code copied and 
> > > > pasted, with
> > > > the obvious exception of the TLB handlers. Can't we work out 
> > > > some better
> > > > way to share the rest?
> > > 
> > > That would be great.
> > > I just considered it step-by-step, and I am not very 
> > familiar with gnu
> > > assemble macro, define things,
> > > and I nocited head_fsl_booke.S and head_44x.S...
> > > 
> > > I will think about it.
> > 
> > OK, so there are two basic differences in booke_interrupts.S, and
> > they're both in the common "lightweight exit" path: the additional PID
> > register switching and the modifications to the TLB save/restore.
> > 
> > The PID stuff should be easy enough to hide: just create a
> > "KVMPPC_SAVE_PID" macro.
> 
> Do we need a new header file to define this?

Yup, we'd need something like e500_interrupts.h and 440_interrupts.h,
and these would only be included from booke_interrupts.S.

> > For now we can probably do the same with the TLB manipulations.
> 
> How do you think the way I define struct tlb_array and tlbe?
> If you think it's fine, I think 44x can adopt it.

I've been meaning to rename "struct tlbe" for a long time. It should
really be called "kvmppc_440_tlbe" or something.

As for the dynamic allocation of the TLB arrays, instead of building
them into struct kvm_vcpu_arch, I think that probably makes sense. A
little more annoying to manage, but makes sense.

-- 
Hollis Blanchard
IBM Linux Technology Center


  parent reply	other threads:[~2008-09-08 17:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15  8:50 [patch 0/4] add e500 platform support for KVM Liu Yu
2008-08-21 20:54 ` Hollis Blanchard
2008-08-22 11:00 ` Liu Yu
2008-08-29 17:09 ` Hollis Blanchard
2008-08-30  3:15 ` Liu Yu
2008-09-08 17:30 ` Hollis Blanchard [this message]
2008-09-09  2:08 ` Liu Yu-B13201
2008-09-09 11:08 ` Hollis Blanchard
2008-09-11  8:43 ` Liu Yu-B13201
2008-09-11 14:45 ` Hollis Blanchard
2008-09-12  2:28 ` Liu Yu-B13201
2008-09-12  2:31 ` Liu Yu-B13201
2008-09-12 14:49 ` Hollis Blanchard

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=1220895037.11733.48.camel@localhost.localdomain \
    --to=hollisb@us.ibm.com \
    --cc=kvm-ppc@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