From: Glauber Costa <gcosta@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@qumranet.com, aliguori@us.ibm.com
Subject: [PATCH 8/9] coalesce mmio regions without an explicit call
Date: Tue, 12 Aug 2008 21:48:08 -0300 [thread overview]
Message-ID: <1218588489-17182-9-git-send-email-gcosta@redhat.com> (raw)
In-Reply-To: <1218588489-17182-8-git-send-email-gcosta@redhat.com>
Try to coalesce mmio regions inside kvm_cpu_register_physical_memory().
Coalescing is done if area has TLB_MMIO flags set, or anything greater than that.
The original explicit function turns into an empty function. This is to be
bisection friendly. Direct calls are to be removed in a later commit.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
libkvm/libkvm.c | 4 ++++
qemu/qemu-kvm.c | 13 +++----------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
index d62cb2a..c563bb6 100644
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -1107,6 +1107,9 @@ int kvm_register_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t size)
perror("kvm_register_coalesced_mmio_zone");
return -errno;
}
+#ifdef DEBUG_MEMREG
+ printf("Registered coalesced mmio region for %llx (%lx)\n", addr, size);
+#endif
return 0;
}
#endif
@@ -1129,6 +1132,7 @@ int kvm_unregister_coalesced_mmio(kvm_context_t kvm, uint64_t addr, uint32_t siz
perror("kvm_unregister_coalesced_mmio_zone");
return -errno;
}
+ printf("Unregistered coalesced mmio region for %llx (%lx)\n", addr, size);
return 0;
}
#endif
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 96b622b..29c5c1d 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -800,6 +800,7 @@ void kvm_cpu_register_physical_memory(target_phys_addr_t start_addr,
printf("No free mmio slots\n");
exit(1);
}
+ kvm_register_coalesced_mmio(kvm_context, start_addr, size);
return;
}
r = kvm_is_intersecting_mem(kvm_context, start_addr);
@@ -1035,13 +1036,5 @@ void kvm_mutex_lock(void)
cpu_single_env = NULL;
}
-int qemu_kvm_register_coalesced_mmio(target_phys_addr_t addr, unsigned int size)
-{
- return kvm_register_coalesced_mmio(kvm_context, addr, size);
-}
-
-int qemu_kvm_unregister_coalesced_mmio(target_phys_addr_t addr,
- unsigned int size)
-{
- return kvm_unregister_coalesced_mmio(kvm_context, addr, size);
-}
+int qemu_kvm_register_coalesced_mmio(target_phys_addr_t addr, unsigned int size) {}
+int qemu_kvm_unregister_coalesced_mmio(target_phys_addr_t addr, unsigned int size) {}
--
1.5.5.1
next prev parent reply other threads:[~2008-08-13 0:54 UTC|newest]
Thread overview: 17+ 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 ` [PATCH 1/9] add debuging facilities to memory registration at libkvm Glauber Costa
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 ` Glauber Costa [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2008-09-12 15:10 [PATCH 0/9] Simplify memory registration Glauber Costa
2008-09-12 15:10 ` [PATCH 8/9] coalesce mmio regions without an explicit call Glauber Costa
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-9-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