Skip to content

Commit 8112426

Browse files
philmdrth7680
authored andcommitted
accel/tcg: Restrict page_collection structure to system TB maintainance
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>
1 parent f349e92 commit 8112426

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

accel/tcg/internal.h

-7
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,9 @@ void page_table_config_init(void);
3636
#endif
3737

3838
#ifdef CONFIG_SOFTMMU
39-
struct page_collection;
40-
void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
41-
tb_page_addr_t start, int len,
42-
uintptr_t retaddr);
43-
struct page_collection *page_collection_lock(tb_page_addr_t start,
44-
tb_page_addr_t end);
4539
void tb_invalidate_phys_range_fast(ram_addr_t ram_addr,
4640
unsigned size,
4741
uintptr_t retaddr);
48-
void page_collection_unlock(struct page_collection *set);
4942
G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
5043
#endif /* CONFIG_SOFTMMU */
5144

accel/tcg/tb-maint.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ static gint tb_page_addr_cmp(gconstpointer ap, gconstpointer bp, gpointer udata)
513513
* intersecting TBs.
514514
* Locking order: acquire locks in ascending order of page index.
515515
*/
516-
struct page_collection *
517-
page_collection_lock(tb_page_addr_t start, tb_page_addr_t end)
516+
static struct page_collection *page_collection_lock(tb_page_addr_t start,
517+
tb_page_addr_t end)
518518
{
519519
struct page_collection *set = g_malloc(sizeof(*set));
520520
tb_page_addr_t index;
@@ -558,7 +558,7 @@ page_collection_lock(tb_page_addr_t start, tb_page_addr_t end)
558558
return set;
559559
}
560560

561-
void page_collection_unlock(struct page_collection *set)
561+
static void page_collection_unlock(struct page_collection *set)
562562
{
563563
/* entries are unlocked and freed via page_entry_destroy */
564564
g_tree_destroy(set->tree);
@@ -1186,9 +1186,9 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
11861186
/*
11871187
* Call with all @pages in the range [@start, @start + len[ locked.
11881188
*/
1189-
void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
1190-
tb_page_addr_t start, int len,
1191-
uintptr_t retaddr)
1189+
static void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
1190+
tb_page_addr_t start,
1191+
unsigned len, uintptr_t ra)
11921192
{
11931193
PageDesc *p;
11941194

@@ -1198,8 +1198,7 @@ void tb_invalidate_phys_page_fast__locked(struct page_collection *pages,
11981198
}
11991199

12001200
assert_page_locked(p);
1201-
tb_invalidate_phys_page_range__locked(pages, p, start, start + len,
1202-
retaddr);
1201+
tb_invalidate_phys_page_range__locked(pages, p, start, start + len, ra);
12031202
}
12041203

12051204
/*

0 commit comments

Comments
 (0)