From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PULL v2 14/14] accel/tcg: Restrict page_collection structure to system TB maintainance
Date: Tue, 20 Dec 2022 21:03:13 -0800 [thread overview]
Message-ID: <20221221050313.2950701-15-richard.henderson@linaro.org> (raw)
In-Reply-To: <20221221050313.2950701-1-richard.henderson@linaro.org>
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Only the system emulation part of TB maintainance uses the
page_collection structure. Restrict its declaration (and the
functions requiring it) to tb-maint.c.
Convert the 'len' argument of tb_invalidate_phys_page_fast__locked()
from signed to unsigned.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20221209093649.43738-6-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/internal.h | 7 -------
accel/tcg/tb-maint.c | 15 +++++++--------
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index 8f8c44d06b..6edff16fb0 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -36,16 +36,9 @@ void page_table_config_init(void);
#endif
#ifdef CONFIG_SOFTMMU
-struct page_collection;
-void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
- tb_page_addr_t start, int len,
- uintptr_t retaddr);
-struct page_collection *page_collection_lock(tb_page_addr_t start,
- tb_page_addr_t end);
void tb_invalidate_phys_range_fast(ram_addr_t ram_addr,
unsigned size,
uintptr_t retaddr);
-void page_collection_unlock(struct page_collection *set);
G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
#endif /* CONFIG_SOFTMMU */
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index d557013f00..1b8e860647 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -513,8 +513,8 @@ static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata)
* intersecting TBs.
* Locking order: acquire locks in ascending order of page index.
*/
-struct page_collection *
-page_collection_lock(tb_page_addr_t start, tb_page_addr_t end)
+static struct page_collection *page_collection_lock(tb_page_addr_t start,
+ tb_page_addr_t end)
{
struct page_collection *set = g_malloc(sizeof(*set));
tb_page_addr_t index;
@@ -558,7 +558,7 @@ page_collection_lock(tb_page_addr_t start, tb_page_addr_t end)
return set;
}
-void page_collection_unlock(struct page_collection *set)
+static void page_collection_unlock(struct page_collection *set)
{
/* entries are unlocked and freed via page_entry_destroy */
g_tree_destroy(set->tree);
@@ -1186,9 +1186,9 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
/*
* Call with all @pages in the range [@start, @start + len[ locked.
*/
-void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
- tb_page_addr_t start, int len,
- uintptr_t retaddr)
+static void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
+ tb_page_addr_t start,
+ unsigned len, uintptr_t ra)
{
PageDesc *p;
@@ -1198,8 +1198,7 @@ void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
}
assert_page_locked(p);
- tb_invalidate_phys_page_range__locked(pages, p, start, start + len,
- retaddr);
+ tb_invalidate_phys_page_range__locked(pages, p, start, start + len, ra);
}
/*
--
2.34.1
next prev parent reply other threads:[~2022-12-21 5:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-21 5:02 [PULL v2 00/14] accel/tcg: Rewrite user-only vma tracking Richard Henderson
2022-12-21 5:03 ` [PULL v2 01/14] util: Add interval-tree.c Richard Henderson
2022-12-21 5:03 ` [PULL v2 02/14] accel/tcg: Rename page_flush_tb Richard Henderson
2022-12-21 5:03 ` [PULL v2 03/14] accel/tcg: Use interval tree for TBs in user-only mode Richard Henderson
2022-12-21 5:03 ` [PULL v2 04/14] accel/tcg: Use interval tree for TARGET_PAGE_DATA_SIZE Richard Henderson
2022-12-21 5:03 ` [PULL v2 05/14] accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD Richard Henderson
2022-12-21 5:03 ` [PULL v2 06/14] accel/tcg: Move page_{get,set}_flags to user-exec.c Richard Henderson
2022-12-21 5:03 ` [PULL v2 07/14] accel/tcg: Use interval tree for user-only page tracking Richard Henderson
2022-12-23 14:32 ` Ilya Leoshkevich
2022-12-24 14:45 ` Richard Henderson
2022-12-21 5:03 ` [PULL v2 08/14] accel/tcg: Move PageDesc tree into tb-maint.c for system Richard Henderson
2022-12-21 5:03 ` [PULL v2 09/14] accel/tcg: Move remainder of page locking to tb-maint.c Richard Henderson
2022-12-21 5:03 ` [PULL v2 10/14] accel/tcg: Restrict cpu_io_recompile() to system emulation Richard Henderson
2022-12-21 5:03 ` [PULL v2 11/14] accel/tcg: Remove trace events from trace-root.h Richard Henderson
2022-12-21 5:03 ` [PULL v2 12/14] accel/tcg: Rename tb_invalidate_phys_page_fast{, __locked}() Richard Henderson
2022-12-21 5:03 ` [PULL v2 13/14] accel/tcg: Factor tb_invalidate_phys_range_fast() out Richard Henderson
2022-12-21 5:03 ` Richard Henderson [this message]
2022-12-21 15:43 ` [PULL v2 00/14] accel/tcg: Rewrite user-only vma tracking Peter Maydell
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=20221221050313.2950701-15-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--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).