From: Ilya Leoshkevich <iii@linux.ibm.com>
To: "Richard Henderson" <richard.henderson@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Taylor Simpson" <tsimpson@quicinc.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH v3 2/5] linux-user: Fix madvise(MADV_DONTNEED) on alpha
Date: Tue, 6 Sep 2022 02:08:36 +0200 [thread overview]
Message-ID: <20220906000839.1672934-3-iii@linux.ibm.com> (raw)
In-Reply-To: <20220906000839.1672934-1-iii@linux.ibm.com>
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;
@@ -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) {
--
2.37.2
next prev parent reply other threads:[~2022-09-06 0:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 0:08 [PATCH v3 0/5] linux-user: Passthrough MADV_DONTNEED for certain file mappings Ilya Leoshkevich
2022-09-06 0:08 ` [PATCH v3 1/5] linux-user: Provide MADV_* definitions Ilya Leoshkevich
2022-09-23 21:51 ` Laurent Vivier
2022-09-06 0:08 ` Ilya Leoshkevich [this message]
2022-09-23 21:51 ` [PATCH v3 2/5] linux-user: Fix madvise(MADV_DONTNEED) on alpha Laurent Vivier
2022-09-06 0:08 ` [PATCH v3 3/5] linux-user: Implement stracing madvise() Ilya Leoshkevich
2022-09-23 21:51 ` Laurent Vivier
2022-09-06 0:08 ` [PATCH v3 4/5] linux-user: Passthrough MADV_DONTNEED for certain file mappings Ilya Leoshkevich
2022-09-23 21:51 ` Laurent Vivier
2022-09-06 0:08 ` [PATCH v3 5/5] tests/tcg/linux-test: Add linux-madvise test Ilya Leoshkevich
2022-09-23 21:52 ` Laurent Vivier
2022-09-06 7:35 ` [PATCH v3 0/5] linux-user: Passthrough MADV_DONTNEED for certain file mappings Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220906000839.1672934-3-iii@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=alex.bennee@linaro.org \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=tsimpson@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).