[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/15] linux-user: Diagnose misaligned -R size
From: |
Richard Henderson |
Subject: |
[PULL 03/15] linux-user: Diagnose misaligned -R size |
Date: |
Tue, 28 Mar 2023 15:57:54 -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
- [PULL 00/15] tcg patch queue, Richard Henderson, 2023/03/28
- [PULL 02/15] tcg: use QTree instead of GTree, Richard Henderson, 2023/03/28
- [PULL 03/15] linux-user: Diagnose misaligned -R size,
Richard Henderson <=
- [PULL 06/15] accel/tcg: Pass last not end to PAGE_FOR_EACH_TB, Richard Henderson, 2023/03/28
- [PULL 01/15] util: import GTree as QTree, Richard Henderson, 2023/03/28
- [PULL 04/15] accel/tcg: Pass last not end to page_set_flags, Richard Henderson, 2023/03/28
- [PULL 05/15] accel/tcg: Pass last not end to page_reset_target_data, Richard Henderson, 2023/03/28
- [PULL 07/15] accel/tcg: Pass last not end to page_collection_lock, Richard Henderson, 2023/03/28
- [PULL 08/15] accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked, Richard Henderson, 2023/03/28
- [PULL 10/15] linux-user: Pass last not end to probe_guest_base, Richard Henderson, 2023/03/28
- [PULL 09/15] accel/tcg: Pass last not end to tb_invalidate_phys_range, Richard Henderson, 2023/03/28
- [PULL 11/15] include/exec: Change reserved_va semantics to last byte, Richard Henderson, 2023/03/28
- [PULL 13/15] softmmu: Restrict cpu_check_watchpoint / address_matches to TCG accel, Richard Henderson, 2023/03/28