From: Hollis Blanchard Date: Mon, 15 Dec 2008 23:17:29 +0000 Subject: Re: [PATCH 07/11] "segment_map" Message-Id: <1229383049.4313.24.camel@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Thu, 2008-12-11 at 17:11 +0800, Liu Yu wrote: > +/* Caller must ensure that the specified guest TLB entry is safe to > insert into > + * the shadow TLB. */ > +/* XXX Map TLB1, for both one-one and one-to-many */ > +static int segment_map(struct kvmppc_vcpu_e500 *vcpu_e500, > + u64 gvaddr, gfn_t gfn, struct tlbe *gtlbe) > +{ > + unsigned int victim; > + > + victim = vcpu_e500->guest_tlb_nv[1]++; > + > + if (unlikely(vcpu_e500->guest_tlb_nv[1] >= tlb1_max_shadow_size())) > + vcpu_e500->guest_tlb_nv[1] = 0; > + > + shadow_map(vcpu_e500, gvaddr, gfn, gtlbe, 1, victim); > + > + return victim; > +} Please rename this... "segment" has a very special meaning in ppc32 MMUs, and this isn't it. :) Also, even though this is static, it couldn't hurt to prefix it with "kvmppc_e500_" or something. I like doing that so people unfamiliar with the code can tell at a glance what layer the function comes from (generic KVM, PowerPC KVM, regular PowerPC, BookE KVM, e500 KVM, etc). Static functions also still show up in System.map. -- Hollis Blanchard IBM Linux Technology Center