Patchwork [2/2] KVM/PPC: Fix kvm_main.c build error for PPC KVM

login
register
mail settings
Submitter yshi
Date July 2, 2009, 2:55 a.m.
Message ID <a3371dff010b57f832d47de0c15f4eb965041628.1246502441.git.yang.shi@windriver.com>
Download mbox | patch
Permalink /patch/29382/
State Not Applicable
Headers show

Comments

yshi - July 2, 2009, 2:55 a.m.
With the latest kernel building KVM for PPC, got integer overflow
error in kvm_main.c file. The root cause is that compiler consider
KVM_PAGES_PER_HPAGE as signed long type, however it should be
unsigned long type.

So, change it to unsigned long type in include/asm/kvm_host.h

Signed-off-by: Yang Shi <yang.shi@windriver.com>
---
 arch/powerpc/include/asm/kvm_host.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index dfdf13c..fddc3ed 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -34,7 +34,7 @@ 
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 
 /* We don't currently support large pages. */
-#define KVM_PAGES_PER_HPAGE (1<<31)
+#define KVM_PAGES_PER_HPAGE (1UL << 31)
 
 struct kvm;
 struct kvm_run;