[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 4/9] tcg: Enforce single page access in probe_wri
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v1 4/9] tcg: Enforce single page access in probe_write() for !CONFIG_USER_ONLY |
Date: |
Fri, 23 Aug 2019 12:07:36 +0200 |
While the CONFIG_USER_ONLY variant can handle multiple pages (no MMU), the
!CONFIG_USER_ONLY variant can't and won't. We'll want to convert
probe_write() to return a host address (similar to tlb_vaddr_to_host())
soon. This only works on page granularity.
Signed-off-by: David Hildenbrand <address@hidden>
---
accel/tcg/cputlb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index bb9897b25a..4b49ccb58a 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1064,6 +1064,8 @@ void probe_write(CPUArchState *env, target_ulong addr,
int size, int mmu_idx,
uintptr_t index = tlb_index(env, mmu_idx, addr);
CPUTLBEntry *entry = tlb_entry(env, mmu_idx, addr);
+ g_assert(-(addr | TARGET_PAGE_MASK) >= size);
+
if (!tlb_hit(tlb_addr_write(entry), addr)) {
/* TLB entry is for a different page */
if (!VICTIM_TLB_HIT(addr_write, addr)) {
--
2.21.0
- [Qemu-devel] [PATCH v1 0/9] tcg: probe_write() refactorings and watchpoints, David Hildenbrand, 2019/08/23
- [Qemu-devel] [PATCH v1 1/9] s390x/tcg: Use guest_addr_valid() instead of h2g_valid() in probe_write_access(), David Hildenbrand, 2019/08/23
- [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 <=
- [Qemu-devel] [PATCH v1 5/9] mips/tcg: Call probe_write() for CONFIG_USER_ONLY as well, David Hildenbrand, 2019/08/23
- [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