[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-8.0 03/11] linux-user: Diagnose misaligned -R size
From: |
Richard Henderson |
Subject: |
[PATCH for-8.0 03/11] linux-user: Diagnose misaligned -R size |
Date: |
Wed, 22 Mar 2023 08:07:36 -0700 |
We have been enforcing host page alignment for the non-R
fallback of MAX_RESERVED_VA, but failing to enforce for -R.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/linux-user/main.c b/linux-user/main.c
index 4b18461969..39d9bd4d7a 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -793,6 +793,12 @@ int main(int argc, char **argv, char **envp)
*/
max_reserved_va = MAX_RESERVED_VA(cpu);
if (reserved_va != 0) {
+ if (reserved_va % qemu_host_page_size) {
+ char *s = size_to_str(qemu_host_page_size);
+ fprintf(stderr, "Reserved virtual address not aligned mod %s\n",
s);
+ g_free(s);
+ exit(EXIT_FAILURE);
+ }
if (max_reserved_va && reserved_va > max_reserved_va) {
fprintf(stderr, "Reserved virtual address too big\n");
exit(EXIT_FAILURE);
--
2.34.1
- [PATCH for-8.0 00/11] tcg patch queue, Richard Henderson, 2023/03/22
- [PATCH for-8.0 02/11] tcg: use QTree instead of GTree, Richard Henderson, 2023/03/22
- [PATCH for-8.0 03/11] linux-user: Diagnose misaligned -R size,
Richard Henderson <=
- [PATCH for-8.0 01/11] util: import GTree as QTree, Richard Henderson, 2023/03/22
- [PATCH for-8.0 04/11] include/exec: Change reserved_va semantics to last byte, Richard Henderson, 2023/03/22
- [PATCH for-8.0 05/11] accel/tcg: Pass last not end to page_set_flags, Richard Henderson, 2023/03/22
- [PATCH for-8.0 07/11] accel/tcg: Pass last not end to PAGE_FOR_EACH_TB, Richard Henderson, 2023/03/22
- [PATCH for-8.0 11/11] linux-user/arm: Take more care allocating commpage, Richard Henderson, 2023/03/22