[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 23/43] bsd-user: define max args in terms of pages
From: |
imp |
Subject: |
[PATCH v3 23/43] bsd-user: define max args in terms of pages |
Date: |
Thu, 2 Sep 2021 17:47:09 -0600 |
From: Warner Losh <imp@FreeBSD.org>
For 32-bit platforms, pass in up to 256k of args. For 64-bit, bump that
to 512k.
Signed-off-by: Kyle Evans <kevans@freebsd.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/qemu.h | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 55d71130bb..fea1a167e4 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
+#include "qemu/units.h"
#include "exec/cpu_ldst.h"
#include "exec/exec-all.h"
@@ -101,11 +102,17 @@ extern const char *qemu_uname_release;
extern unsigned long mmap_min_addr;
/*
- * MAX_ARG_PAGES defines the number of pages allocated for arguments
- * and envelope for the new program. 32 should suffice, this gives
- * a maximum env+arg of 128kB w/4KB pages!
+ * TARGET_ARG_MAX defines the number of bytes allocated for arguments
+ * and envelope for the new program. 256k should suffice for a reasonable
+ * maxiumum env+arg in 32-bit environments, bump it up to 512k for !ILP32
+ * platforms.
*/
-#define MAX_ARG_PAGES 32
+#if TARGET_ABI_BITS > 32
+#define TARGET_ARG_MAX (512 * KiB)
+#else
+#define TARGET_ARG_MAX (256 * KiB)
+#endif
+#define MAX_ARG_PAGES (TARGET_ARG_MAX / TARGET_PAGE_SIZE)
/*
* This structure is used to hold the arguments that are
--
2.32.0
- Re: [PATCH v3 18/43] bsd-user: save the path to the qemu emulator, (continued)
- [PATCH v3 17/43] bsd-user: Include host-os.h from main, imp, 2021/09/02
- [PATCH v3 26/43] bsd-user: *BSD specific siginfo defintions, imp, 2021/09/02
- [PATCH v3 21/43] bsd-user: pull in target_arch_thread.h update target_arch_elf.h, imp, 2021/09/02
- [PATCH v3 30/43] bsd-user: elf cleanup, imp, 2021/09/02
- [PATCH v3 19/43] bsd-user: start to move target CPU functions to target_arch*, imp, 2021/09/02
- [PATCH v3 15/43] bsd-user: assume pthreads and support of __thread, imp, 2021/09/02
- [PATCH v3 23/43] bsd-user: define max args in terms of pages,
imp <=
- [PATCH v3 22/43] bsd-user: Include more things in qemu.h, imp, 2021/09/02
- [PATCH v3 24/43] bsd-user: Create target specific vmparam.h, imp, 2021/09/02
- [PATCH v3 33/43] bsd-user: Make cpu_model and cpu_type visible to all of main.c, imp, 2021/09/02
- [PATCH v3 31/43] bsd-user: Remove dead #ifdefs from elfload.c, imp, 2021/09/02
- [PATCH v3 35/43] bsd-user: Add target_arch_reg to describe a target's register set, imp, 2021/09/02
- [PATCH v3 20/43] bsd-user: Move per-cpu code into target_arch_cpu.h, imp, 2021/09/02