"segment_map"
Quoted 8 lines · Liu Yu
+/* Caller must ensure that the specified guest TLB entry is safe to insert into
+ * the shadow TLB. */(quoted diff) +5
-0+/* 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;
Review
Quoted 10 lines
(quoted diff) +10
-0+ + 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.
Signature · 2 lines
Hollis Blanchard IBM Linux Technology Center
Quoted 33 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hollis Blanchard
Sent: Tuesday, December 16, 2008 7:17 AM
To: Liu Yu-B13201
Cc: [email protected]
Subject: Re: [PATCH 07/11] "segment_map"Review
Quoted 12 lines · Liu Yu
+/* Caller must ensure that the specified guest TLB entry is safe to insert into
+ * the shadow TLB. */(quoted diff) +9
-0+/* 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()))Review
Quoted 6 lines
(quoted diff) +6
-0+ 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. :)
Quoted 8 lines
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.
Fixed.