aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-07-26 13:29:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2022-07-26 13:29:26 +0100
commitd1c912b816844aa045082595eba796b5a025dbc4 (patch)
tree8df10fa459b250ae4b50f664bc55767319efca6e
parent0d0275c31f00b71b49eb80bbdca2cfe244cf80fb (diff)
parent6f200f51869ff0de7ea0343dd7104362e994b382 (diff)
downloadqemu-arm-staging.tar.gz
Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into stagingstaging
linux-user pull request 20220726 # gpg: Signature made Tue 26 Jul 2022 10:44:29 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu: linux-user: Use target abi_int type for pipefd[1] in pipe() linux-user: Unconditionally use pipe2() syscall linux-user/hppa: Fix segfaults on page zero Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--linux-user/hppa/cpu_loop.c3
-rw-r--r--linux-user/syscall.c13
-rw-r--r--meson.build9
3 files changed, 5 insertions, 20 deletions
diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c
index a576d1a249..64263c3dc4 100644
--- a/linux-user/hppa/cpu_loop.c
+++ b/linux-user/hppa/cpu_loop.c
@@ -143,6 +143,9 @@ void cpu_loop(CPUHPPAState *env)
env->iaoq_f = env->gr[31];
env->iaoq_b = env->gr[31] + 4;
break;
+ case EXCP_IMP:
+ force_sig_fault(TARGET_SIGSEGV, TARGET_SEGV_MAPERR, env->iaoq_f);
+ break;
case EXCP_ILL:
force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f);
break;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 991b85e6b4..b27a6552aa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1586,21 +1586,12 @@ static abi_long do_ppoll(abi_long arg1, abi_long arg2, abi_long arg3,
}
#endif
-static abi_long do_pipe2(int host_pipe[], int flags)
-{
-#ifdef CONFIG_PIPE2
- return pipe2(host_pipe, flags);
-#else
- return -ENOSYS;
-#endif
-}
-
static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes,
int flags, int is_pipe2)
{
int host_pipe[2];
abi_long ret;
- ret = flags ? do_pipe2(host_pipe, flags) : pipe(host_pipe);
+ ret = pipe2(host_pipe, flags);
if (is_error(ret))
return get_errno(ret);
@@ -1624,7 +1615,7 @@ static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes,
}
if (put_user_s32(host_pipe[0], pipedes)
- || put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0])))
+ || put_user_s32(host_pipe[1], pipedes + sizeof(abi_int)))
return -TARGET_EFAULT;
return get_errno(ret);
}
diff --git a/meson.build b/meson.build
index 8a8c415fc1..75aaca8462 100644
--- a/meson.build
+++ b/meson.build
@@ -2026,15 +2026,6 @@ config_host_data.set('CONFIG_OPEN_BY_HANDLE', cc.links(gnu_source_prefix + '''
#else
int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
#endif'''))
-config_host_data.set('CONFIG_PIPE2', cc.links(gnu_source_prefix + '''
- #include <unistd.h>
- #include <fcntl.h>
-
- int main(void)
- {
- int pipefd[2];
- return pipe2(pipefd, O_CLOEXEC);
- }'''))
config_host_data.set('CONFIG_POSIX_MADVISE', cc.links(gnu_source_prefix + '''
#include <sys/mman.h>
#include <stddef.h>