Skip to content

Commit

Permalink
Merge branch 'jb45765_for420' into 'master'
Browse files Browse the repository at this point in the history
[qemu-usermode] Update to 4.2.0. JB#45765

See merge request mer-core/qemu-usermode!11
  • Loading branch information
Matti Kosola committed Jan 30, 2020
2 parents eafe58b + b2158e2 commit 815fbb2
Show file tree
Hide file tree
Showing 20 changed files with 1,008 additions and 307 deletions.
@@ -1,19 +1,19 @@
From 25ff0573a73123d71e10ec4849ac9177ea53ac59 Mon Sep 17 00:00:00 2001
From c5ee3e5707dcf49d62b4b7d4714d9861153a900d Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:47:20 +0200
Subject: [PATCH 1/9] Revert "linux-user: Use safe_syscall for open and openat
system calls"
Subject: [PATCH 01/18] Revert "linux-user: Use safe_syscall for open and
openat system calls"

This reverts commit c10a07387b77b94d8f7233f3b5bb559211d4e49a.
---
linux-user/syscall.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 96cd4bf86d..17b13f0ca3 100644
index 171c0ca..55a96ad 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -362,6 +362,18 @@ static int sys_getcwd1(char *buf, size_t size)
@@ -375,6 +375,18 @@ static int sys_getcwd1(char *buf, size_t size)
return strlen(buf)+1;
}

Expand All @@ -32,7 +32,7 @@ index 96cd4bf86d..17b13f0ca3 100644
#ifdef TARGET_NR_utimensat
#if defined(__NR_utimensat)
#define __NR_sys_utimensat __NR_utimensat
@@ -718,8 +730,6 @@ static type safe_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
@@ -731,8 +743,6 @@ static type safe_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \

safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
Expand All @@ -41,7 +41,7 @@ index 96cd4bf86d..17b13f0ca3 100644
safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
struct rusage *, rusage)
safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
@@ -6816,7 +6826,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
@@ -7198,7 +7208,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,

if (is_proc_myself(pathname, "exe")) {
int execfd = qemu_getauxval(AT_EXECFD);
Expand All @@ -50,7 +50,7 @@ index 96cd4bf86d..17b13f0ca3 100644
}

for (fake_open = fakes; fake_open->filename; fake_open++) {
@@ -6852,7 +6862,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
@@ -7234,7 +7244,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
return fd;
}

Expand All @@ -60,5 +60,5 @@ index 96cd4bf86d..17b13f0ca3 100644

#define TIMER_MAGIC 0x0caf0000
--
2.20.1
1.8.3-rc3

@@ -1,26 +1,27 @@
From f72e0c717abd2dd23c6af3747567f269fb2a4747 Mon Sep 17 00:00:00 2001
From 8a45f877babcdddc8061026924923bb42ad97bd0 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:48:18 +0200
Subject: [PATCH 4/9] Revert "linux-user: Use safe_syscall for execve syscall"
Subject: [PATCH 02/18] Revert "linux-user: Use safe_syscall for execve
syscall"

This reverts commit ffdcbe223d23461669869e85786145cce65e1e8c.
---
linux-user/syscall.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 17b13f0ca3..348b9a7ee9 100644
index 55a96ad..11e3e41 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -734,7 +734,6 @@ safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
@@ -747,7 +747,6 @@ safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
struct rusage *, rusage)
safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
int, options, struct rusage *, rusage)
-safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp)
safe_syscall6(int, pselect6, int, nfds, fd_set *, readfds, fd_set *, writefds, \
fd_set *, exceptfds, struct timespec *, timeout, void *, sig)
safe_syscall5(int, ppoll, struct pollfd *, ufds, unsigned int, nfds,
@@ -7231,17 +7230,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
@@ -7614,17 +7613,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,

if (!(p = lock_user_string(arg1)))
goto execve_efault;
Expand All @@ -40,5 +41,5 @@ index 17b13f0ca3..348b9a7ee9 100644

goto execve_end;
--
2.20.1
1.8.3-rc3

@@ -1,7 +1,7 @@
From 31629feb8df2e01c46262bb973896523583fbc9e Mon Sep 17 00:00:00 2001
From 8ddd86705568ebc51a4dbac9a5070ea5707dc066 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:57:53 +0200
Subject: [PATCH 5/9] Revert "linux-user: Use safe_syscall wrapper for send*
Subject: [PATCH 03/18] Revert "linux-user: Use safe_syscall wrapper for send*
and recv* syscalls"

This reverts commit 666875306e03e1f94e1d4c808502585c10abc69a.
Expand All @@ -10,10 +10,10 @@ This reverts commit 666875306e03e1f94e1d4c808502585c10abc69a.
1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 348b9a7ee9..b71c1262a9 100644
index 11e3e41..5d6c87a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -754,14 +754,6 @@ safe_syscall5(ssize_t, preadv, int, fd, const struct iovec *, iov, int, iovcnt,
@@ -767,14 +767,6 @@ safe_syscall5(ssize_t, preadv, int, fd, const struct iovec *, iov, int, iovcnt,
unsigned long, pos_l, unsigned long, pos_h)
safe_syscall5(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
unsigned long, pos_l, unsigned long, pos_h)
Expand All @@ -28,7 +28,7 @@ index 348b9a7ee9..b71c1262a9 100644
safe_syscall2(int, flock, int, fd, int, operation)
safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
const struct timespec *, uts, size_t, sigsetsize)
@@ -2740,17 +2732,17 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
@@ -2990,17 +2982,17 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
msg.msg_iov->iov_len);
if (ret >= 0) {
msg.msg_iov->iov_base = host_msg;
Expand All @@ -49,7 +49,7 @@ index 348b9a7ee9..b71c1262a9 100644
if (!is_error(ret)) {
len = ret;
if (fd_trans_host_to_target_data(fd)) {
@@ -2995,9 +2987,9 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
@@ -3245,9 +3237,9 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
if (ret) {
goto fail;
}
Expand All @@ -61,7 +61,7 @@ index 348b9a7ee9..b71c1262a9 100644
}
fail:
if (copy_msg) {
@@ -3032,12 +3024,12 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
@@ -3282,12 +3274,12 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
}
addr = alloca(addrlen);
ret_addrlen = addrlen;
Expand All @@ -77,5 +77,5 @@ index 348b9a7ee9..b71c1262a9 100644
if (!is_error(ret)) {
if (fd_trans_host_to_target_data(fd)) {
--
2.20.1
1.8.3-rc3

@@ -1,7 +1,7 @@
From 65da11e06b0f560992af01b7ad5c379662254eef Mon Sep 17 00:00:00 2001
From c097e9d61af51fedf44d5a8b4eea41a50a72bd8c Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:59:47 +0200
Subject: [PATCH 6/9] Revert "linux-user: Use safe_syscall wrapper for accept
Subject: [PATCH 04/18] Revert "linux-user: Use safe_syscall wrapper for accept
and accept4 syscalls"

This reverts commit ff6dc130794bcd5b2033bc50262a7720285a74c7.
Expand All @@ -10,10 +10,10 @@ This reverts commit ff6dc130794bcd5b2033bc50262a7720285a74c7.
1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b71c1262a9..8546c06341 100644
index 5d6c87a..96ed793 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -757,8 +757,6 @@ safe_syscall5(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
@@ -770,8 +770,6 @@ safe_syscall5(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
safe_syscall2(int, flock, int, fd, int, operation)
safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
const struct timespec *, uts, size_t, sigsetsize)
Expand All @@ -22,7 +22,7 @@ index b71c1262a9..8546c06341 100644
safe_syscall2(int, nanosleep, const struct timespec *, req,
struct timespec *, rem)
#ifdef TARGET_NR_clock_nanosleep
@@ -2837,6 +2835,19 @@ static abi_long do_sendrecvmmsg(int fd, abi_ulong target_msgvec,
@@ -3087,6 +3085,19 @@ static abi_long do_sendrecvmmsg(int fd, abi_ulong target_msgvec,
return ret;
}

Expand All @@ -42,7 +42,7 @@ index b71c1262a9..8546c06341 100644
/* do_accept4() Must return target values and target errnos. */
static abi_long do_accept4(int fd, abi_ulong target_addr,
abi_ulong target_addrlen_addr, int flags)
@@ -2849,7 +2860,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
@@ -3099,7 +3110,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
host_flags = target_to_host_bitmask(flags, fcntl_flags_tbl);

if (target_addr == 0) {
Expand All @@ -51,7 +51,7 @@ index b71c1262a9..8546c06341 100644
}

/* linux returns EINVAL if addrlen pointer is invalid */
@@ -2866,7 +2877,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
@@ -3116,7 +3127,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
addr = alloca(addrlen);

ret_addrlen = addrlen;
Expand All @@ -61,5 +61,5 @@ index b71c1262a9..8546c06341 100644
host_to_target_sockaddr(target_addr, addr, MIN(addrlen, ret_addrlen));
if (put_user_u32(ret_addrlen, target_addrlen_addr)) {
--
2.20.1
1.8.3-rc3

@@ -1,7 +1,7 @@
From 8b1f096c3793539893fe02e2e87b7cf983972546 Mon Sep 17 00:00:00 2001
From 7bc5b415e9b39961d01ed6cb7b6b6f77c0108ebb Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 11:00:44 +0200
Subject: [PATCH 7/9] Revert "linux-user: Use safe_syscall for wait system
Subject: [PATCH 05/18] Revert "linux-user: Use safe_syscall for wait system
calls"

This reverts commit 4af80a3783950380df85ecca78aea3e3bad2e846.
Expand All @@ -10,10 +10,10 @@ This reverts commit 4af80a3783950380df85ecca78aea3e3bad2e846.
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8546c06341..fd61c0a500 100644
index 96ed793..9a95158 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -730,10 +730,6 @@ static type safe_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
@@ -743,10 +743,6 @@ static type safe_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \

safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
Expand All @@ -24,7 +24,7 @@ index 8546c06341..fd61c0a500 100644
safe_syscall6(int, pselect6, int, nfds, fd_set *, readfds, fd_set *, writefds, \
fd_set *, exceptfds, struct timespec *, timeout, void *, sig)
safe_syscall5(int, ppoll, struct pollfd *, ufds, unsigned int, nfds,
@@ -7095,7 +7091,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
@@ -7478,7 +7474,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_waitpid:
{
int status;
Expand All @@ -33,7 +33,7 @@ index 8546c06341..fd61c0a500 100644
if (!is_error(ret) && arg2 && ret
&& put_user_s32(host_to_target_waitstatus(status), arg2))
return -TARGET_EFAULT;
@@ -7107,7 +7103,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
@@ -7490,7 +7486,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
{
siginfo_t info;
info.si_pid = 0;
Expand All @@ -42,7 +42,7 @@ index 8546c06341..fd61c0a500 100644
if (!is_error(ret) && arg3 && info.si_pid != 0) {
if (!(p = lock_user(VERIFY_WRITE, arg3, sizeof(target_siginfo_t), 0)))
return -TARGET_EFAULT;
@@ -8850,7 +8846,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
@@ -9244,7 +9240,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
rusage_ptr = &rusage;
else
rusage_ptr = NULL;
Expand All @@ -52,5 +52,5 @@ index 8546c06341..fd61c0a500 100644
if (status_ptr && ret) {
status = host_to_target_waitstatus(status);
--
2.20.1
1.8.3-rc3

@@ -1,19 +1,19 @@
From 62746443ff235d6b3035fdaab2d1543181ba5355 Mon Sep 17 00:00:00 2001
From fc481085c58c1add1bc1b6980c4e0713964e06a9 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 11:13:13 +0200
Subject: [PATCH 8/9] Revert "linux-user: Use safe_syscall wrapper for connect
syscall"
Subject: [PATCH 06/18] Revert "linux-user: Use safe_syscall wrapper for
connect syscall"

This reverts commit 2a3c7619288af9cfcc09a233dce911bf80849dfb.
---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fd61c0a500..0c95b9bc6d 100644
index 9a95158..d5bc5b8 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2657,7 +2657,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr,
@@ -2907,7 +2907,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr,
if (ret)
return ret;

Expand All @@ -23,5 +23,5 @@ index fd61c0a500..0c95b9bc6d 100644

/* do_sendrecvmsg_locked() Must return target values and target errnos. */
--
2.20.1
1.8.3-rc3

35 changes: 35 additions & 0 deletions rpm/0007-Revert-linux-user-Use-direct-syscall-for-utimensat.patch
@@ -0,0 +1,35 @@
From 3ecf0acf5bc0e7be754bcd69f0535c3dadb2b8ae Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 29 Jan 2020 12:49:43 +0200
Subject: [PATCH 07/18] Revert "linux-user: Use direct syscall for utimensat"

This reverts commit 700fa58e4b9100d6bd77df06d2e5d1f457720c4d.
---
linux-user/syscall.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d5bc5b8..12ea401 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -388,7 +388,16 @@ static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
}

#ifdef TARGET_NR_utimensat
-#if defined(__NR_utimensat)
+#ifdef CONFIG_UTIMENSAT
+static int sys_utimensat(int dirfd, const char *pathname,
+ const struct timespec times[2], int flags)
+{
+ if (pathname == NULL)
+ return futimens(dirfd, times);
+ else
+ return utimensat(dirfd, pathname, times, flags);
+}
+#elif defined(__NR_utimensat)
#define __NR_sys_utimensat __NR_utimensat
_syscall4(int,sys_utimensat,int,dirfd,const char *,pathname,
const struct timespec *,tsp,int,flags)
--
1.8.3-rc3

0 comments on commit 815fbb2

Please sign in to comment.