[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 5/9] mips/tcg: Call probe_write() for CONFIG_USER
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v1 5/9] mips/tcg: Call probe_write() for CONFIG_USER_ONLY as well |
Date: |
Fri, 23 Aug 2019 12:07:37 +0200 |
Let's call it also for CONFIG_USER_ONLY. While at it, add a FIXME and get
rid of one local variable.
MIPS code probably needs a bigger refactoring in regards of
ensure_writable_pages(), similar to s390x, so for example, watchpoints
can be handled reliably later. The actually accessed addresses should
be probed only, not full pages.
Signed-off-by: David Hildenbrand <address@hidden>
---
target/mips/op_helper.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index f88a3ab904..221e8bb1d7 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -4536,16 +4536,14 @@ static inline void ensure_writable_pages(CPUMIPSState
*env,
int mmu_idx,
uintptr_t retaddr)
{
-#if !defined(CONFIG_USER_ONLY)
- target_ulong page_addr;
+ /* FIXME: Probe the actual accesses (pass and use a size) */
if (unlikely(MSA_PAGESPAN(addr))) {
/* first page */
probe_write(env, addr, 0, mmu_idx, retaddr);
/* second page */
- page_addr = (addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
- probe_write(env, page_addr, 0, mmu_idx, retaddr);
+ addr = (addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
+ probe_write(env, addr, 0, mmu_idx, retaddr);
}
-#endif
}
void helper_msa_st_b(CPUMIPSState *env, uint32_t wd,
--
2.21.0
- Re: [Qemu-devel] [PATCH v1 1/9] s390x/tcg: Use guest_addr_valid() instead of h2g_valid() in probe_write_access(), (continued)
- [Qemu-devel] [PATCH v1 2/9] s390x/tcg: Fix length calculation in probe_write_access(), David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 3/9] tcg: Factor out CONFIG_USER_ONLY probe_write() from s390x code, David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 4/9] tcg: Enforce single page access in probe_write() for !CONFIG_USER_ONLY, David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 5/9] mips/tcg: Call probe_write() for CONFIG_USER_ONLY as well,
David Hildenbrand <=
- [Qemu-devel] [PATCH v1 6/9] hppa/tcg: Call probe_write() also for CONFIG_USER_ONLY, David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 7/9] s390x/tcg: Pass a size to probe_write() in do_csst(), David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 8/9] exec.c: Factor out core logic of check_watchpoint(), David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 9/9] tcg: Check for watchpoints in probe_write(), David Hildenbrand, 2019/08/23