From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, "Warner Losh" <imp@bsdimp.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL v2 05/14] accel/tcg: Drop PAGE_RESERVED for CONFIG_BSD
Date: Tue, 20 Dec 2022 21:03:04 -0800 [thread overview]
Message-ID: <20221221050313.2950701-6-richard.henderson@linaro.org> (raw)
In-Reply-To: <20221221050313.2950701-1-richard.henderson@linaro.org>
Make bsd-user match linux-user in not marking host pages
as reserved. This isn't especially effective anyway, as
it doesn't take into account any heap memory that qemu
may allocate after startup.
Reviewed-by: Warner Losh <imp@bsdimp.com>
Tested-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/translate-all.c | 65 ---------------------------------------
1 file changed, 65 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index b964ea44d7..48e9d70b4e 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -354,71 +354,6 @@ void page_init(void)
{
page_size_init();
page_table_config_init();
-
-#if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY)
- {
-#ifdef HAVE_KINFO_GETVMMAP
- struct kinfo_vmentry *freep;
- int i, cnt;
-
- freep = kinfo_getvmmap(getpid(), &cnt);
- if (freep) {
- mmap_lock();
- for (i = 0; i < cnt; i++) {
- unsigned long startaddr, endaddr;
-
- startaddr = freep[i].kve_start;
- endaddr = freep[i].kve_end;
- if (h2g_valid(startaddr)) {
- startaddr = h2g(startaddr) & TARGET_PAGE_MASK;
-
- if (h2g_valid(endaddr)) {
- endaddr = h2g(endaddr);
- page_set_flags(startaddr, endaddr, PAGE_RESERVED);
- } else {
-#if TARGET_ABI_BITS <= L1_MAP_ADDR_SPACE_BITS
- endaddr = ~0ul;
- page_set_flags(startaddr, endaddr, PAGE_RESERVED);
-#endif
- }
- }
- }
- free(freep);
- mmap_unlock();
- }
-#else
- FILE *f;
-
- last_brk = (unsigned long)sbrk(0);
-
- f = fopen("/compat/linux/proc/self/maps", "r");
- if (f) {
- mmap_lock();
-
- do {
- unsigned long startaddr, endaddr;
- int n;
-
- n = fscanf(f, "%lx-%lx %*[^\n]\n", &startaddr, &endaddr);
-
- if (n == 2 && h2g_valid(startaddr)) {
- startaddr = h2g(startaddr) & TARGET_PAGE_MASK;
-
- if (h2g_valid(endaddr)) {
- endaddr = h2g(endaddr);
- } else {
- endaddr = ~0ul;
- }
- page_set_flags(startaddr, endaddr, PAGE_RESERVED);
- }
- } while (!feof(f));
-
- fclose(f);
- mmap_unlock();
- }
-#endif
- }
-#endif
}
PageDesc *page_find_alloc(tb_page_addr_t index, bool alloc)
--
2.34.1
next prev parent reply other threads:[~2022-12-21 5:05 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 ` Richard Henderson [this message]
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 ` [PULL v2 14/14] accel/tcg: Restrict page_collection structure to system TB maintainance Richard Henderson
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-6-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=imp@bsdimp.com \
--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).