public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@qumranet.com, aliguori@us.ibm.com
Subject: [PATCH 1/9] add debuging facilities to memory registration at libkvm
Date: Tue, 12 Aug 2008 21:48:01 -0300	[thread overview]
Message-ID: <1218588489-17182-2-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1218588489-17182-1-git-send-email-gcosta@redhat.com>

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 libkvm/libkvm.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index 5edfad7..0bacb43 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -52,6 +52,8 @@
 #include "kvm-s390.h"
 #endif
 
+//#define DEBUG_MEMREG
+
 int kvm_abi = EXPECTED_KVM_API_VERSION;
 int kvm_page_size;
 
@@ -548,6 +550,12 @@ int kvm_create_mem_hole(kvm_context_t kvm, unsigned long phys_start,
 	}
 	free_slot(slot);
 
+#ifdef DEBUG_MEMREG
+	printf("%s, newslot1: gpa: %llx, size: %llx, uaddr: %llx, slot: %x, flags: %lx\n",
+		__func__, newslot1.guest_phys_addr, newslot1.memory_size,
+		newslot1.userspace_addr, newslot1.slot, newslot1.flags);
+#endif
+
 	r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &newslot1);
 	if (r == -1) {
 		fprintf(stderr, "kvm_create_mem_hole: %s\n", strerror(errno));
@@ -557,6 +565,11 @@ int kvm_create_mem_hole(kvm_context_t kvm, unsigned long phys_start,
 		      newslot1.memory_size, 1, newslot1.userspace_addr,
 		      newslot1.flags);
 
+#ifdef DEBUG_MEMREG
+	printf("%s, newslot2: gpa: %llx, size: %llx, uaddr: %llx, slot: %x, flags: %lx\n",
+		__func__, newslot2.guest_phys_addr, newslot2.memory_size,
+		newslot2.userspace_addr, newslot2.slot, newslot2.flags);
+#endif
 	r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &newslot2);
 	if (r == -1) {
 		fprintf(stderr, "kvm_create_mem_hole: %s\n", strerror(errno));
@@ -584,6 +597,11 @@ int kvm_register_userspace_phys_mem(kvm_context_t kvm,
 	int r;
 
 	memory.slot = get_free_slot(kvm);
+#ifdef DEBUG_MEMREG
+	printf("%s, memory: gpa: %llx, size: %llx, uaddr: %llx, slot: %x, flags: %lx\n",
+		__func__, memory.guest_phys_addr, memory.memory_size,
+		memory.userspace_addr, memory.slot, memory.flags);
+#endif
 	r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &memory);
 	if (r == -1) {
 		fprintf(stderr, "create_userspace_phys_mem: %s\n", strerror(errno));
-- 
1.5.5.1


  reply	other threads:[~2008-08-13  0:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13  0:48 [RFC 0/9] Memory registration rework Glauber Costa
2008-08-13  0:48 ` Glauber Costa [this message]
2008-08-13  0:48   ` [PATCH 2/9] experimental change to avoid doing the same thing twice Glauber Costa
2008-08-13  0:48     ` [PATCH 3/9] do not use mem_hole anymore Glauber Costa
2008-08-13  0:48       ` [PATCH 4/9] allow intersecting region to be on the boundary Glauber Costa
2008-08-13  0:48         ` [PATCH 5/9] substitute is_allocated_mem with more general is_containing_region Glauber Costa
2008-08-13  0:48           ` [PATCH 6/9] move kvm_cpu_register_memory_area into qemu's Glauber Costa
2008-08-13  0:48             ` [PATCH 7/9] cleanup kvm memory registration Glauber Costa
2008-08-13  0:48               ` [PATCH 8/9] coalesce mmio regions without an explicit call Glauber Costa
2008-08-13  0:48                 ` [PATCH 9/9] remove explicit calls to kvm_qemu_register_coalesced_mmio Glauber Costa
2008-08-13 14:11             ` [PATCH 6/9] move kvm_cpu_register_memory_area into qemu's Anthony Liguori
2008-08-13 14:33               ` Glauber Costa
2008-08-13 11:41           ` [PATCH 5/9] substitute is_allocated_mem with more general is_containing_region Avi Kivity
2008-08-13 13:02             ` Glauber Costa
2008-08-13 11:43 ` [RFC 0/9] Memory registration rework Avi Kivity
2008-08-13 14:13   ` Anthony Liguori

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=1218588489-17182-2-git-send-email-gcosta@redhat.com \
    --to=gcosta@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@qumranet.com \
    --cc=kvm@vger.kernel.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