qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] accel/tcg: Make probe_access() a generic TCG helper


From: Richard Henderson
Subject: Re: [PATCH v2 2/2] accel/tcg: Make probe_access() a generic TCG helper
Date: Mon, 19 Jun 2023 11:54:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 6/19/23 11:19, Philippe Mathieu-Daudé wrote:
+
+void HELPER(probe_access)(CPUArchState *env, uint64_t ptr,
+                          uint32_t access_type, uint32_t mmu_idx,
+                          uint32_t size)
+{
+    uint32_t in_page = -((uint32_t)ptr | TARGET_PAGE_SIZE);
+    uintptr_t ra = GETPC();
+
+    if (likely(size <= in_page)) {
+        probe_access(env, ptr, size, access_type, mmu_idx, ra);
+    } else {
+        probe_access(env, ptr, in_page, access_type, mmu_idx, ra);
+        probe_access(env, ptr + in_page, size - in_page,
+                     access_type, mmu_idx, ra);
+    }
+}

This works if and only if size is <= TARGET_PAGE_SIZE.
This should probably have been documented for Arm, but
should definitely be documented for its new location.

It looks like this could be used for

hexagon: HELPER(probe_noshuf_load)
s390x/tcg/mem_helper.c:void HELPER(probe_write_access)

Although s390x is written to handle much larger SIZE, the maximum that it will ever issue is 16 * 16 = 256 for op_vstm. But it also handles target-specific address wrap at the end of the address space, which the above does not.

So perhaps it's not worth moving this after all?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]