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: Fri, 12 Sep 2008 14:49:27 +0000 [thread overview]
Message-ID: <1221230967.30132.2.camel@localhost.localdomain> (raw)
In-Reply-To: <1218790228-19549-1-git-send-email-yu.liu@freescale.com>
On Fri, 2008-09-12 at 10:28 +0800, Liu Yu-B13201 wrote:
> > > > 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;
> > > >
> > >
> > > Hollis, I'm reconsiderring this place.
> > > The problem is that e500 has 2 TLB, so I need to get the
> > tlb index and
> > > entry index from kvmppc_dtlb_search
> > > And if kvm_is_visible_gfn() returns nonzero, the two index
> > are needed to
> > > manipulate TLB0 or TLB1.
> >
> > OK, sounds reasonable. Feel free to change the prototypes of
> > these hooks
> > to whatever you need, as long as it's clean and still lets me
> > implement
> > 440.
> >
> > For example, maybe something like this:
> > int kvmppc_dtlb_index(struct kvm_vcpu *vcpu, u32 eaddr);
> >
> > You could then encode the TLB index in the high bits of the return
> > index. Alternatively, you could pass &tlb and &index, but I
> > think I like
> > that less.
> >
>
> I just wanted you to know this place has some dependent factors.
> Never mind. I think I could use the your former suggestion.
> I could calculate the index by offset or save index in vcpu->arch.
> What's your opinion?
I would definitely prefer using the index as a return value, rather than
saving to vcpu->arch.
--
Hollis Blanchard
IBM Linux Technology Center
prev parent reply other threads:[~2008-09-12 14:49 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
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 [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=1221230967.30132.2.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