[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/20] linux-user/arm: Mark the commpage executable
From: |
Richard Henderson |
Subject: |
[PULL 01/20] linux-user/arm: Mark the commpage executable |
Date: |
Thu, 1 Sep 2022 07:51:47 +0100 |
We're about to start validating PAGE_EXEC, which means
that we've got to mark the commpage executable. We had
been placing the commpage outside of reserved_va, which
was incorrect and lead to an abort.
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Tested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/arm/target_cpu.h | 4 ++--
linux-user/elfload.c | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h
index 709d19bc9e..89ba274cfc 100644
--- a/linux-user/arm/target_cpu.h
+++ b/linux-user/arm/target_cpu.h
@@ -34,9 +34,9 @@ static inline unsigned long arm_max_reserved_va(CPUState *cs)
} else {
/*
* We need to be able to map the commpage.
- * See validate_guest_space in linux-user/elfload.c.
+ * See init_guest_commpage in linux-user/elfload.c.
*/
- return 0xffff0000ul;
+ return 0xfffffffful;
}
}
#define MAX_RESERVED_VA arm_max_reserved_va
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index ce902dbd56..3e3dc02499 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -398,7 +398,8 @@ enum {
static bool init_guest_commpage(void)
{
- void *want = g2h_untagged(HI_COMMPAGE & -qemu_host_page_size);
+ abi_ptr commpage = HI_COMMPAGE & -qemu_host_page_size;
+ void *want = g2h_untagged(commpage);
void *addr = mmap(want, qemu_host_page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
@@ -417,6 +418,9 @@ static bool init_guest_commpage(void)
perror("Protecting guest commpage");
exit(EXIT_FAILURE);
}
+
+ page_set_flags(commpage, commpage + qemu_host_page_size,
+ PAGE_READ | PAGE_EXEC | PAGE_VALID);
return true;
}
--
2.34.1
- [PULL 00/20] tcg patch queue, Richard Henderson, 2022/09/01
- [PULL 01/20] linux-user/arm: Mark the commpage executable,
Richard Henderson <=
- [PULL 1/4] target/avr: Support probe argument to tlb_fill, Richard Henderson, 2022/09/01
- [PULL 02/20] linux-user/hppa: Allocate page zero as a commpage, Richard Henderson, 2022/09/01
- [PULL 2/4] target/avr: Call avr_cpu_do_interrupt directly, Richard Henderson, 2022/09/01
- [PULL 06/20] tests/tcg/i386: Move smc_code2 to an executable section, Richard Henderson, 2022/09/01
- [PULL 10/20] accel/tcg: Make tb_htable_lookup static, Richard Henderson, 2022/09/01
- [PULL 05/20] linux-user: Clear translations on mprotect(), Richard Henderson, 2022/09/01
- [PULL 07/20] accel/tcg: Introduce is_same_page(), Richard Henderson, 2022/09/01
- [PULL 12/20] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp, Richard Henderson, 2022/09/01
- [PULL 4/4] target/avr: Disable interrupts when env->skip set, Richard Henderson, 2022/09/01
- [PULL 11/20] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c, Richard Henderson, 2022/09/01