From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] exec: Remove map_client_list family
Date: Tue, 10 Mar 2015 15:50:10 +0800 [thread overview]
Message-ID: <1425973810-22831-3-git-send-email-famz@redhat.com> (raw)
In-Reply-To: <1425973810-22831-1-git-send-email-famz@redhat.com>
Now that bounce buffer is no longer global and the callback and BH are
not necessary. Remove them altogether.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
dma-helpers.c | 20 --------------------
exec.c | 35 -----------------------------------
include/exec/cpu-common.h | 1 -
include/exec/memory.h | 2 --
4 files changed, 58 deletions(-)
diff --git a/dma-helpers.c b/dma-helpers.c
index 6918572..4de52dc 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -81,25 +81,6 @@ typedef struct {
DMAIOFunc *io_func;
} DMAAIOCB;
-static void dma_blk_cb(void *opaque, int ret);
-
-static void reschedule_dma(void *opaque)
-{
- DMAAIOCB *dbs = (DMAAIOCB *)opaque;
-
- qemu_bh_delete(dbs->bh);
- dbs->bh = NULL;
- dma_blk_cb(dbs, 0);
-}
-
-static void continue_after_map_failure(void *opaque)
-{
- DMAAIOCB *dbs = (DMAAIOCB *)opaque;
-
- dbs->bh = qemu_bh_new(reschedule_dma, dbs);
- qemu_bh_schedule(dbs->bh);
-}
-
static void dma_blk_unmap(DMAAIOCB *dbs)
{
int i;
@@ -161,7 +142,6 @@ static void dma_blk_cb(void *opaque, int ret)
if (dbs->iov.size == 0) {
trace_dma_map_wait(dbs);
- cpu_register_map_client(dbs, continue_after_map_failure);
return;
}
diff --git a/exec.c b/exec.c
index 5943cc2..45f324e 100644
--- a/exec.c
+++ b/exec.c
@@ -2519,38 +2519,6 @@ typedef struct MapClient {
QLIST_ENTRY(MapClient) link;
} MapClient;
-static QLIST_HEAD(map_client_list, MapClient) map_client_list
- = QLIST_HEAD_INITIALIZER(map_client_list);
-
-void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque))
-{
- MapClient *client = g_malloc(sizeof(*client));
-
- client->opaque = opaque;
- client->callback = callback;
- QLIST_INSERT_HEAD(&map_client_list, client, link);
- return client;
-}
-
-static void cpu_unregister_map_client(void *_client)
-{
- MapClient *client = (MapClient *)_client;
-
- QLIST_REMOVE(client, link);
- g_free(client);
-}
-
-static void cpu_notify_map_clients(void)
-{
- MapClient *client;
-
- while (!QLIST_EMPTY(&map_client_list)) {
- client = QLIST_FIRST(&map_client_list);
- client->callback(client->opaque);
- cpu_unregister_map_client(client);
- }
-}
-
bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write)
{
MemoryRegion *mr;
@@ -2576,8 +2544,6 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
* May map a subset of the requested range, given by and returned in *plen.
* May return NULL if resources needed to perform the mapping are exhausted.
* Use only for reads OR writes - not for read-modify-write operations.
- * Use cpu_register_map_client() to know when retrying the map operation is
- * likely to succeed.
*/
void *address_space_map(AddressSpace *as,
hwaddr addr,
@@ -2669,7 +2635,6 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
qemu_vfree(bounce->buffer);
memory_region_unref(bounce->mr);
g_free(bounce);
- cpu_notify_map_clients();
}
void *cpu_physical_memory_map(hwaddr addr,
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index fcc3162..c86c837 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -82,7 +82,6 @@ void *cpu_physical_memory_map(hwaddr addr,
int is_write);
void cpu_physical_memory_unmap(void *buffer, hwaddr len,
int is_write, hwaddr access_len);
-void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque));
bool cpu_physical_memory_is_io(hwaddr phys_addr);
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 06ffa1d..3ac93ab 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1127,8 +1127,6 @@ bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
* May map a subset of the requested range, given by and returned in @plen.
* May return %NULL if resources needed to perform the mapping are exhausted.
* Use only for reads OR writes - not for read-modify-write operations.
- * Use cpu_register_map_client() to know when retrying the map operation is
- * likely to succeed.
*
* @as: #AddressSpace to be accessed
* @addr: address within that address space
--
1.9.3
prev parent reply other threads:[~2015-03-10 7:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 7:50 [Qemu-devel] [PATCH 0/2] exec: Convert bounce buffer to a set Fam Zheng
2015-03-10 7:50 ` [Qemu-devel] [PATCH 1/2] " Fam Zheng
2015-03-10 11:14 ` Paolo Bonzini
2015-03-11 4:57 ` Fam Zheng
2015-03-10 7:50 ` Fam Zheng [this message]
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=1425973810-22831-3-git-send-email-famz@redhat.com \
--to=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).