On 9/1/22 09:45, Ilya Leoshkevich wrote:
+/*
+ * For linux-user, indicates that the page is mapped with the same
semantics
+ * in both guest and host.
+ */
+#define PAGE_PASSTHROUGH 0x0800

I would expect a change to PAGE_STICKY in accel/tcg/translate-all.c, so that this bit is preserved across mprotect. Yes?

@@ -845,7 +861,7 @@ static bool
can_passthrough_madv_dontneed(abi_ulong start, abi_ulong end)
      }
     for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
-        if (!(page_get_flags(addr) & PAGE_ANON)) {
+        if (!(page_get_flags(addr) & (PAGE_ANON |
PAGE_PASSTHROUGH))) {

Do you want both PAGE_ANON and PAGE_PASSTHROUGH?
If not, is PAGE_PASSTHOUGH is sufficient by itself, why check PAGE_ANON?

I would like to ping this patch and two others that I used for
debugging it:

[PATCH] linux-user: Fix stracing in-memory mmap arguments
https://patchew.org/QEMU/20220630165901.2459135-1-...@linux.ibm.com/

Queued to linux-user-next.

[PATCH] linux-user: Implement stracing madvise()
https://patchew.org/QEMU/20220725134440.172892-1-...@linux.ibm.com/

There are many more MADV_* than just the 5 you list.


r~

Reply via email to