public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: Book3s HV: Fix tlbie compile error
@ 2014-06-11 15:16 Alexander Graf
  2014-06-12  3:46 ` Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2014-06-11 15:16 UTC (permalink / raw)
  To: kvm-ppc; +Cc: kvm

Some compilers complain about uninitialized variables in the compute_tlbie_rb
function. When you follow the code path you'll realize that we'll never get
to that point, but the compiler isn't all that smart.

So just default to 4k page sizes for everything, making the compiler happy
and the code slightly easier to read.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/asm/kvm_book3s_64.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
index fddb72b..c7871f3 100644
--- a/arch/powerpc/include/asm/kvm_book3s_64.h
+++ b/arch/powerpc/include/asm/kvm_book3s_64.h
@@ -110,16 +110,12 @@ static inline int __hpte_actual_psize(unsigned int lp, int psize)
 static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
 					     unsigned long pte_index)
 {
-	int b_psize, a_psize;
+	int b_psize = MMU_PAGE_4K, a_psize = MMU_PAGE_4K;
 	unsigned int penc;
 	unsigned long rb = 0, va_low, sllp;
 	unsigned int lp = (r >> LP_SHIFT) & ((1 << LP_BITS) - 1);
 
-	if (!(v & HPTE_V_LARGE)) {
-		/* both base and actual psize is 4k */
-		b_psize = MMU_PAGE_4K;
-		a_psize = MMU_PAGE_4K;
-	} else {
+	if (v & HPTE_V_LARGE) {
 		for (b_psize = 0; b_psize < MMU_PAGE_COUNT; b_psize++) {
 
 			/* valid entries have a shift value */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: PPC: Book3s HV: Fix tlbie compile error
  2014-06-11 15:16 [PATCH] KVM: PPC: Book3s HV: Fix tlbie compile error Alexander Graf
@ 2014-06-12  3:46 ` Paul Mackerras
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2014-06-12  3:46 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm-ppc, kvm

On Wed, Jun 11, 2014 at 05:16:02PM +0200, Alexander Graf wrote:
> Some compilers complain about uninitialized variables in the compute_tlbie_rb
> function. When you follow the code path you'll realize that we'll never get
> to that point, but the compiler isn't all that smart.
> 
> So just default to 4k page sizes for everything, making the compiler happy
> and the code slightly easier to read.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Acked-by: Paul Mackerras <paulus@samba.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-12  3:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-11 15:16 [PATCH] KVM: PPC: Book3s HV: Fix tlbie compile error Alexander Graf
2014-06-12  3:46 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox