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: Thu, 21 Aug 2008 20:54:06 +0000	[thread overview]
Message-ID: <1219352046.20238.65.camel@localhost.localdomain> (raw)
In-Reply-To: <1218790228-19549-1-git-send-email-yu.liu@freescale.com>

On Fri, 2008-08-15 at 16:50 +0800, Liu Yu wrote:
> These patches add the support of e500 platform for KVM.

Hi Yu, sorry it's taken me this long to take a look. I've been sick and
catching up from vacation...

> The code is just in the primary stage,
> so this time just for discussion.

Could you talk a little about how it differs from the 440
implementation? For example, how are you using TLB0 and TLB1?

Some of the refactoring you've done, like creating completely separate
kvmppc_handle_tlb_miss() functions, surprises me. For example, I'd
expect the DTLB miss code to be refactored like this:

        case BOOKE_INTERRUPT_DTLB_MISS:	
        	gtlbe = kvmppc_dtlb_search(vcpu, eaddr); <- CORE HOOK
        	if (!gtlbe) {
        		/* The guest didn't have a mapping for it. */
        		kvmppc_queue_exception(vcpu, exit_nr);
        		vcpu->arch.dear = vcpu->arch.fault_dear;
        		vcpu->arch.esr = vcpu->arch.fault_esr;
        		kvmppc_deliver_dtlb_miss(vcpu); <- CORE HOOK
        		vcpu->stat.dtlb_real_miss_exits++;
        		r = RESUME_GUEST;
        		break;
        	}
        
        	vcpu->arch.paddr_accessed = tlb_xlate(gtlbe, eaddr);
        	gfn = vcpu->arch.paddr_accessed >> PAGE_SHIFT;
        
        	if (kvm_is_visible_gfn(vcpu->kvm, gfn)) {
        		kvmppc_mmu_map(vcpu, eaddr, gfn, gtlbe->tid,
        		               gtlbe->word2); <- CORE HOOK
        		vcpu->stat.dtlb_virt_miss_exits++;
        		r = RESUME_GUEST;
        	} else
        		r = kvmppc_emulate_mmio(run, vcpu);
        
        	break;

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?

Christian makes a great point about interrupts in
host_tlb_write_entry(), but I have an even bigger question: by not
tracking the state of the shadow TLB, you're implementing lazy
save/restore. In contrast, 440 is doing a full TLB reload, since I
assume that a) the TLB is so small that is almost certainly full of
useful entries, and b) TLB misses are much more expensive with KVM than
on bare metal.

> I have tested them under branch 2.6.26, but not under the lastest code,
> for my board can not boot up via current kvm tree.

Hmm, that's too bad.

-- 
Hollis Blanchard
IBM Linux Technology Center


  reply	other threads:[~2008-08-21 20:54 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 [this message]
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
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=1219352046.20238.65.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