qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 2/5] linux-user: Fix madvise(MADV_DONTNEED) on alpha


From: Laurent Vivier
Subject: Re: [PATCH v3 2/5] linux-user: Fix madvise(MADV_DONTNEED) on alpha
Date: Fri, 23 Sep 2022 23:51:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1

Le 06/09/2022 à 02:08, Ilya Leoshkevich a écrit :
MADV_DONTNEED has a different value on alpha, compared to all the other
architectures. Fix by using TARGET_MADV_DONTNEED instead of
MADV_DONTNEED.

Fixes: 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
  linux-user/mmap.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 048c4135af..a5f1ab129c 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -22,6 +22,7 @@
  #include "qemu.h"
  #include "user-internals.h"
  #include "user-mmap.h"
+#include "target_mman.h"
static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
  static __thread int mmap_lock_count;Applied to my linux-user-for-7.2 branch.

Thanks,
Laurent

@@ -891,7 +892,7 @@ abi_long target_madvise(abi_ulong start, abi_ulong len_in, 
int advice)
       * anonymous mappings. In this case passthrough is safe, so do it.
       */
      mmap_lock();
-    if (advice == MADV_DONTNEED &&
+    if (advice == TARGET_MADV_DONTNEED &&
          can_passthrough_madv_dontneed(start, end)) {
          ret = get_errno(madvise(g2h_untagged(start), len, MADV_DONTNEED));
          if (ret == 0) {
Applied to my linux-user-for-7.2 branch.

Thanks,
Laurent




reply via email to

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