public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
To: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [Patch] cleanup warning of kvmctl.c
Date: Fri, 19 Oct 2007 19:35:12 +0900	[thread overview]
Message-ID: <7EC8123BBADDD6takebe_akio@jp.fujitsu.com> (raw)

Hi,

Nice to meet you, all.
I recently got understanding kvm started,
and I found some worning at compiling kvm.

This patch is for cleanup of kvmctl.c.
I tested Booting Linux guest on x86_32.

Signed-off-by: Akio Takebe <takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>

--- kvm-48.orig/user/kvmctl.c	2007-10-19 01:42:58.000000000 +0900
+++ kvm-48/user/kvmctl.c	2007-10-19 19:14:05.000000000 +0900
@@ -313,7 +313,7 @@ int kvm_alloc_kernel_memory(kvm_context_
 	struct kvm_memory_region above_4g_memory = {
 		.slot = 4,
 		.memory_size = memory < pcimem ? 0 : memory - pcimem,
-		.guest_phys_addr = 0x100000000,
+		.guest_phys_addr = 0x100000000ULL,
 	};
 
 	if (memory >= pcimem)
@@ -372,12 +372,12 @@ int kvm_alloc_userspace_memory(kvm_conte
 	struct kvm_userspace_memory_region above_4g_memory = {
 		.slot = 4,
 		.memory_size = memory < pcimem ? 0 : memory - pcimem,
-		.guest_phys_addr = 0x100000000,
+		.guest_phys_addr = 0x100000000ULL,
 	};
 
 	if (memory >= pcimem) {
 		extended_memory.memory_size = pcimem - exmem;
-		*vm_mem = mmap(NULL, memory + 0x100000000 - pcimem,
+		*vm_mem = mmap(NULL, memory + 0x100000000ULL - pcimem,
 				PROT_READ|PROT_WRITE, MAP_ANONYMOUS |
 							MAP_SHARED, -1, 0);
 	}
@@ -413,13 +413,13 @@ int kvm_alloc_userspace_memory(kvm_conte
 	}
 
 	if (above_4g_memory.memory_size) {
-		r = munmap(*vm_mem + pcimem, 0x100000000 - pcimem);
+		r = munmap(*vm_mem + pcimem, 0x100000000ULL - pcimem);
 		if (r == -1) {
 			fprintf(stderr, "kvm_alloc_userspace_memory: %s",
 							strerror(errno));
 			return -1;
 		}
-		above_4g_memory.userspace_addr = (unsigned long)(*vm_mem + 0x100000000);
+		above_4g_memory.userspace_addr = (unsigned long)(*vm_mem + 0x100000000ULL);
 		r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &above_4g_memory);
 		if (r == -1) {
 			fprintf(stderr, "kvm_create_memory_region: %m\n");


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

             reply	other threads:[~2007-10-19 10:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 10:35 Akio Takebe [this message]
     [not found] ` <7EC8123BBADDD6takebe_akio-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2007-10-21  7:03   ` [Patch] cleanup warning of kvmctl.c Avi Kivity

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=7EC8123BBADDD6takebe_akio@jp.fujitsu.com \
    --to=takebe_akio-+cum20s59erqfuhtdcdx3a@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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