* [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches
@ 2019-06-26 12:11 Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 1/6] util/path: Do not cache all filenames at startup Laurent Vivier
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier
The following changes since commit 474f3938d79ab36b9231c9ad3b5a9314c2aeacde:
Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-jun-21-2019' into staging (2019-06-21 15:40:50 +0100)
are available in the Git repository at:
git://github.com/vivier/qemu.git tags/linux-user-for-4.1-pull-request
for you to fetch changes up to b50d1e42a4a7dc746ecd42c34c386d81a997759c:
linux-user: set default PPC64 CPU (2019-06-24 23:10:36 +0200)
----------------------------------------------------------------
Update ppc64 feature and default CPU
next setsockops() options
Improve "-L" option
Another fix for 5.2-rc1 headers
----------------------------------------------------------------
Laurent Vivier (3):
linux-user: emulate msgsnd(), msgrcv() and semtimedop()
linux-user: update PPC64 HWCAP2 feature list
linux-user: set default PPC64 CPU
Neng Chen (1):
linux-user: Add support for setsockopt() options
IPV6_<ADD|DROP>_MEMBERSHIP
Richard Henderson (1):
util/path: Do not cache all filenames at startup
Yunqiang Su (1):
linux-user: Add support for setsockopt() option SOL_ALG
linux-user/elfload.c | 12 ++-
linux-user/ppc/target_elf.h | 2 +-
linux-user/syscall.c | 111 +++++++++++++++------
linux-user/syscall_defs.h | 1 +
util/path.c | 193 ++++++++----------------------------
5 files changed, 135 insertions(+), 184 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL 1/6] util/path: Do not cache all filenames at startup
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
@ 2019-06-26 12:11 ` Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 2/6] linux-user: emulate msgsnd(), msgrcv() and semtimedop() Laurent Vivier
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Richard Henderson, Laurent Vivier
From: Richard Henderson <richard.henderson@linaro.org>
If one uses -L $PATH to point to a full chroot, the startup time
is significant. In addition, the existing probing algorithm fails
to handle symlink loops.
Instead, probe individual paths on demand. Cache both positive
and negative results within $PATH, so that any one filename is
probed only once.
Use glib filename functions for clarity.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190519201953.20161-2-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
util/path.c | 193 ++++++++++++----------------------------------------
1 file changed, 43 insertions(+), 150 deletions(-)
diff --git a/util/path.c b/util/path.c
index 7f9fc272fbb3..8e174eb43642 100644
--- a/util/path.c
+++ b/util/path.c
@@ -8,170 +8,63 @@
#include <dirent.h>
#include "qemu/cutils.h"
#include "qemu/path.h"
+#include "qemu/thread.h"
-struct pathelem
-{
- /* Name of this, eg. lib */
- char *name;
- /* Full path name, eg. /usr/gnemul/x86-linux/lib. */
- char *pathname;
- struct pathelem *parent;
- /* Children */
- unsigned int num_entries;
- struct pathelem *entries[0];
-};
-
-static struct pathelem *base;
-
-/* First N chars of S1 match S2, and S2 is N chars long. */
-static int strneq(const char *s1, unsigned int n, const char *s2)
-{
- unsigned int i;
-
- for (i = 0; i < n; i++)
- if (s1[i] != s2[i])
- return 0;
- return s2[i] == 0;
-}
-
-static struct pathelem *add_entry(struct pathelem *root, const char *name,
- unsigned type);
+static const char *base;
+static GHashTable *hash;
+static QemuMutex lock;
-static struct pathelem *new_entry(const char *root,
- struct pathelem *parent,
- const char *name)
-{
- struct pathelem *new = g_malloc(sizeof(*new));
- new->name = g_strdup(name);
- new->pathname = g_strdup_printf("%s/%s", root, name);
- new->num_entries = 0;
- return new;
-}
-
-#define streq(a,b) (strcmp((a), (b)) == 0)
-
-/* Not all systems provide this feature */
-#if defined(DT_DIR) && defined(DT_UNKNOWN) && defined(DT_LNK)
-# define dirent_type(dirent) ((dirent)->d_type)
-# define is_dir_maybe(type) \
- ((type) == DT_DIR || (type) == DT_UNKNOWN || (type) == DT_LNK)
-#else
-# define dirent_type(dirent) (1)
-# define is_dir_maybe(type) (type)
-#endif
-
-static struct pathelem *add_dir_maybe(struct pathelem *path)
+void init_paths(const char *prefix)
{
- DIR *dir;
-
- if ((dir = opendir(path->pathname)) != NULL) {
- struct dirent *dirent;
-
- while ((dirent = readdir(dir)) != NULL) {
- if (!streq(dirent->d_name,".") && !streq(dirent->d_name,"..")){
- path = add_entry(path, dirent->d_name, dirent_type(dirent));
- }
- }
- closedir(dir);
+ if (prefix[0] == '\0' || !strcmp(prefix, "/")) {
+ return;
}
- return path;
-}
-
-static struct pathelem *add_entry(struct pathelem *root, const char *name,
- unsigned type)
-{
- struct pathelem **e;
-
- root->num_entries++;
-
- root = g_realloc(root, sizeof(*root)
- + sizeof(root->entries[0])*root->num_entries);
- e = &root->entries[root->num_entries-1];
- *e = new_entry(root->pathname, root, name);
- if (is_dir_maybe(type)) {
- *e = add_dir_maybe(*e);
+ if (prefix[0] == '/') {
+ base = g_strdup(prefix);
+ } else {
+ char *cwd = g_get_current_dir();
+ base = g_build_filename(cwd, prefix, NULL);
+ g_free(cwd);
}
- return root;
-}
-
-/* This needs to be done after tree is stabilized (ie. no more reallocs!). */
-static void set_parents(struct pathelem *child, struct pathelem *parent)
-{
- unsigned int i;
-
- child->parent = parent;
- for (i = 0; i < child->num_entries; i++)
- set_parents(child->entries[i], child);
+ hash = g_hash_table_new(g_str_hash, g_str_equal);
+ qemu_mutex_init(&lock);
}
-/* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */
-static const char *
-follow_path(const struct pathelem *cursor, const char *name)
-{
- unsigned int i, namelen;
-
- name += strspn(name, "/");
- namelen = strcspn(name, "/");
-
- if (namelen == 0)
- return cursor->pathname;
-
- if (strneq(name, namelen, ".."))
- return follow_path(cursor->parent, name + namelen);
-
- if (strneq(name, namelen, "."))
- return follow_path(cursor, name + namelen);
-
- for (i = 0; i < cursor->num_entries; i++)
- if (strneq(name, namelen, cursor->entries[i]->name))
- return follow_path(cursor->entries[i], name + namelen);
-
- /* Not found */
- return NULL;
-}
-
-void init_paths(const char *prefix)
+/* Look for path in emulation dir, otherwise return name. */
+const char *path(const char *name)
{
- char pref_buf[PATH_MAX];
-
- if (prefix[0] == '\0' ||
- !strcmp(prefix, "/"))
- return;
+ gpointer key, value;
+ const char *ret;
- if (prefix[0] != '/') {
- char *cwd = getcwd(NULL, 0);
- size_t pref_buf_len = sizeof(pref_buf);
+ /* Only do absolute paths: quick and dirty, but should mostly be OK. */
+ if (!base || !name || name[0] != '/') {
+ return name;
+ }
- if (!cwd)
- abort();
- pstrcpy(pref_buf, sizeof(pref_buf), cwd);
- pstrcat(pref_buf, pref_buf_len, "/");
- pstrcat(pref_buf, pref_buf_len, prefix);
- free(cwd);
- } else
- pstrcpy(pref_buf, sizeof(pref_buf), prefix + 1);
+ qemu_mutex_lock(&lock);
- base = new_entry("", NULL, pref_buf);
- base = add_dir_maybe(base);
- if (base->num_entries == 0) {
- g_free(base->pathname);
- g_free(base->name);
- g_free(base);
- base = NULL;
+ /* Have we looked up this file before? */
+ if (g_hash_table_lookup_extended(hash, name, &key, &value)) {
+ ret = value ? value : name;
} else {
- set_parents(base, base);
+ char *save = g_strdup(name);
+ char *full = g_build_filename(base, name, NULL);
+
+ /* Look for the path; record the result, pass or fail. */
+ if (access(full, F_OK) == 0) {
+ /* Exists. */
+ g_hash_table_insert(hash, save, full);
+ ret = full;
+ } else {
+ /* Does not exist. */
+ g_free(full);
+ g_hash_table_insert(hash, save, NULL);
+ ret = name;
+ }
}
-}
-
-/* Look for path in emulation dir, otherwise return name. */
-const char *path(const char *name)
-{
- /* Only do absolute paths: quick and dirty, but should mostly be OK.
- Could do relative by tracking cwd. */
- if (!base || !name || name[0] != '/')
- return name;
- return follow_path(base, name) ?: name;
+ qemu_mutex_unlock(&lock);
+ return ret;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL 2/6] linux-user: emulate msgsnd(), msgrcv() and semtimedop()
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 1/6] util/path: Do not cache all filenames at startup Laurent Vivier
@ 2019-06-26 12:11 ` Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 3/6] linux-user: Add support for setsockopt() option SOL_ALG Laurent Vivier
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier, Cornelia Huck
When we have updated kernel headers to 5.2-rc1 we have introduced
new syscall numbers that can be not supported by older kernels
and fail with ENOSYS while the guest emulation succeeded before
because the syscalls were emulated with ipc().
This patch fixes the problem by using ipc() if the new syscall
returns ENOSYS.
Fixes: 86e636951ddc ("linux-user: fix __NR_semtimedop undeclared error")
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20190529084804.25950-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 61 +++++++++++++++++++--------------------
linux-user/syscall_defs.h | 1 +
2 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b187c1281dce..e942049cb0da 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -762,50 +762,21 @@ safe_syscall2(int, nanosleep, const struct timespec *, req,
safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
const struct timespec *, req, struct timespec *, rem)
#endif
-#if !defined(__NR_msgsnd) || !defined(__NR_msgrcv) || !defined(__NR_semtimedop)
-/* This host kernel architecture uses a single ipc syscall; fake up
- * wrappers for the sub-operations to hide this implementation detail.
- * Annoyingly we can't include linux/ipc.h to get the constant definitions
- * for the call parameter because some structs in there conflict with the
- * sys/ipc.h ones. So we just define them here, and rely on them being
- * the same for all host architectures.
- */
-#define Q_SEMTIMEDOP 4
-#define Q_MSGSND 11
-#define Q_MSGRCV 12
-#define Q_IPCCALL(VERSION, OP) ((VERSION) << 16 | (OP))
-
+#ifdef __NR_ipc
safe_syscall6(int, ipc, int, call, long, first, long, second, long, third,
void *, ptr, long, fifth)
#endif
#ifdef __NR_msgsnd
safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz,
int, flags)
-#else
-static int safe_msgsnd(int msgid, const void *msgp, size_t sz, int flags)
-{
- return safe_ipc(Q_IPCCALL(0, Q_MSGSND), msgid, sz, flags, (void *)msgp, 0);
-}
#endif
#ifdef __NR_msgrcv
safe_syscall5(int, msgrcv, int, msgid, void *, msgp, size_t, sz,
long, msgtype, int, flags)
-#else
-static int safe_msgrcv(int msgid, void *msgp, size_t sz, long type, int flags)
-{
- return safe_ipc(Q_IPCCALL(1, Q_MSGRCV), msgid, sz, flags, msgp, type);
-}
#endif
#ifdef __NR_semtimedop
safe_syscall4(int, semtimedop, int, semid, struct sembuf *, tsops,
unsigned, nsops, const struct timespec *, timeout)
-#else
-static int safe_semtimedop(int semid, struct sembuf *tsops, unsigned nsops,
- const struct timespec *timeout)
-{
- return safe_ipc(Q_IPCCALL(0, Q_SEMTIMEDOP), semid, nsops, 0, tsops,
- (long)timeout);
-}
#endif
#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
safe_syscall5(int, mq_timedsend, int, mqdes, const char *, msg_ptr,
@@ -3529,11 +3500,21 @@ static inline abi_long target_to_host_sembuf(struct sembuf *host_sembuf,
static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops)
{
struct sembuf sops[nsops];
+ abi_long ret;
if (target_to_host_sembuf(sops, ptr, nsops))
return -TARGET_EFAULT;
- return get_errno(safe_semtimedop(semid, sops, nsops, NULL));
+ ret = -TARGET_ENOSYS;
+#ifdef __NR_semtimedop
+ ret = get_errno(safe_semtimedop(semid, sops, nsops, NULL));
+#endif
+#ifdef __NR_ipc
+ if (ret == -TARGET_ENOSYS) {
+ ret = get_errno(safe_ipc(IPCOP_semtimedop, semid, nsops, 0, sops, 0));
+ }
+#endif
+ return ret;
}
struct target_msqid_ds
@@ -3688,7 +3669,16 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
}
host_mb->mtype = (abi_long) tswapal(target_mb->mtype);
memcpy(host_mb->mtext, target_mb->mtext, msgsz);
+ ret = -TARGET_ENOSYS;
+#ifdef __NR_msgsnd
ret = get_errno(safe_msgsnd(msqid, host_mb, msgsz, msgflg));
+#endif
+#ifdef __NR_ipc
+ if (ret == -TARGET_ENOSYS) {
+ ret = get_errno(safe_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg,
+ host_mb, 0));
+ }
+#endif
g_free(host_mb);
unlock_user_struct(target_mb, msgp, 0);
@@ -3716,7 +3706,16 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
ret = -TARGET_ENOMEM;
goto end;
}
+ ret = -TARGET_ENOSYS;
+#ifdef __NR_msgrcv
ret = get_errno(safe_msgrcv(msqid, host_mb, msgsz, msgtyp, msgflg));
+#endif
+#ifdef __NR_ipc
+ if (ret == -TARGET_ENOSYS) {
+ ret = get_errno(safe_ipc(IPCOP_CALL(1, IPCOP_msgrcv), msqid, msgsz,
+ msgflg, host_mb, msgtyp));
+ }
+#endif
if (ret > 0) {
abi_ulong target_mtext_addr = msgp + sizeof(abi_ulong);
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 7f141f699c1a..3175440e9dd9 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -32,6 +32,7 @@
#define TARGET_SYS_RECVMMSG 19 /* recvmmsg() */
#define TARGET_SYS_SENDMMSG 20 /* sendmmsg() */
+#define IPCOP_CALL(VERSION, OP) ((VERSION) << 16 | (OP))
#define IPCOP_semop 1
#define IPCOP_semget 2
#define IPCOP_semctl 3
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL 3/6] linux-user: Add support for setsockopt() option SOL_ALG
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 1/6] util/path: Do not cache all filenames at startup Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 2/6] linux-user: emulate msgsnd(), msgrcv() and semtimedop() Laurent Vivier
@ 2019-06-26 12:11 ` Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 4/6] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP Laurent Vivier
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Yunqiang Su, Laurent Vivier, Aleksandar Markovic
From: Yunqiang Su <ysu@wavecomp.com>
Add support for options SOL_ALG of the syscall setsockopt(). This
option is used in relation to Linux kernel Crypto API, and allows
a user to set additional information for the cipher operation via
syscall setsockopt(). The field "optname" must be one of the
following:
- ALG_SET_KEY – seting the key
- ALG_SET_AEAD_AUTHSIZE – set the authentication tag size
SOL_ALG is relatively newer setsockopt() option. Therefore, the
code that handles SOL_ALG is enclosed in "ifdef" so that the build
does not fail for older kernels that do not contain support for
SOL_ALG. "ifdef" also contains check if ALG_SET_KEY and
ALG_SET_AEAD_AUTHSIZE are defined.
Signed-off-by: Yunqiang Su <ysu@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1560953834-29584-3-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e942049cb0da..ed1c9b0033be 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -102,6 +102,7 @@
#include <linux/blkpg.h>
#include <netpacket/packet.h>
#include <linux/netlink.h>
+#include <linux/if_alg.h>
#include "linux_loop.h"
#include "uname.h"
@@ -1941,6 +1942,36 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
goto unimplemented;
}
break;
+#if defined(SOL_ALG) && defined(ALG_SET_KEY) && defined(ALG_SET_AEAD_AUTHSIZE)
+ case SOL_ALG:
+ switch (optname) {
+ case ALG_SET_KEY:
+ {
+ char *alg_key = g_malloc(optlen);
+
+ if (!alg_key) {
+ return -TARGET_ENOMEM;
+ }
+ if (copy_from_user(alg_key, optval_addr, optlen)) {
+ g_free(alg_key);
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(setsockopt(sockfd, level, optname,
+ alg_key, optlen));
+ g_free(alg_key);
+ break;
+ }
+ case ALG_SET_AEAD_AUTHSIZE:
+ {
+ ret = get_errno(setsockopt(sockfd, level, optname,
+ NULL, optlen));
+ break;
+ }
+ default:
+ goto unimplemented;
+ }
+ break;
+#endif
case TARGET_SOL_SOCKET:
switch (optname) {
case TARGET_SO_RCVTIMEO:
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL 4/6] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
` (2 preceding siblings ...)
2019-06-26 12:11 ` [Qemu-devel] [PULL 3/6] linux-user: Add support for setsockopt() option SOL_ALG Laurent Vivier
@ 2019-06-26 12:11 ` Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 5/6] linux-user: update PPC64 HWCAP2 feature list Laurent Vivier
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Aleksandar Markovic, Riku Voipio, Laurent Vivier, Neng Chen
From: Neng Chen <nchen@wavecomp.com>
Add support for the option IPV6_<ADD|DROP>_MEMBERSHIP of the syscall
setsockopt(). This option controls membership in multicast groups.
Argument is a pointer to a struct ipv6_mreq.
The glibc <netinet/in.h> header defines the ipv6_mreq structure,
which includes the following members:
struct in6_addr ipv6mr_multiaddr;
unsigned int ipv6mr_interface;
Whereas the kernel in its <linux/in6.h> header defines following
members of the same structure:
struct in6_addr ipv6mr_multiaddr;
int ipv6mr_ifindex;
POSIX defines ipv6mr_interface [1].
__UAPI_DEF_IVP6_MREQ appears in kernel headers with v3.12:
cfd280c91253 net: sync some IP headers with glibc
Without __UAPI_DEF_IVP6_MREQ, kernel defines ipv6mr_ifindex, and
this is explained in cfd280c91253:
"If you include the kernel headers first you get those,
and if you include the glibc headers first you get those,
and the following patch arranges a coordination and
synchronization between the two."
So before 3.12, a program can't include both <netinet/in.h> and
<linux/in6.h>.
In linux-user/syscall.c, we only include <netinet/in.h> (glibc) and
not <linux/in6.h> (kernel headers), so ipv6mr_interface is the one
to use.
[1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/netinet/in.h.html
Signed-off-by: Neng Chen <nchen@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1560953834-29584-2-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/syscall.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ed1c9b0033be..d2c9817938c9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1892,6 +1892,25 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
&pki, sizeof(pki)));
break;
}
+ case IPV6_ADD_MEMBERSHIP:
+ case IPV6_DROP_MEMBERSHIP:
+ {
+ struct ipv6_mreq ipv6mreq;
+
+ if (optlen < sizeof(ipv6mreq)) {
+ return -TARGET_EINVAL;
+ }
+
+ if (copy_from_user(&ipv6mreq, optval_addr, sizeof(ipv6mreq))) {
+ return -TARGET_EFAULT;
+ }
+
+ ipv6mreq.ipv6mr_interface = tswap32(ipv6mreq.ipv6mr_interface);
+
+ ret = get_errno(setsockopt(sockfd, level, optname,
+ &ipv6mreq, sizeof(ipv6mreq)));
+ break;
+ }
default:
goto unimplemented;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL 5/6] linux-user: update PPC64 HWCAP2 feature list
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
` (3 preceding siblings ...)
2019-06-26 12:11 ` [Qemu-devel] [PULL 4/6] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP Laurent Vivier
@ 2019-06-26 12:11 ` Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 6/6] linux-user: set default PPC64 CPU Laurent Vivier
2019-07-01 15:59 ` [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Peter Maydell
6 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier
QEMU_PPC_FEATURE2_VEC_CRYPTO enables the use
of VSX instructions in libcrypto that are accelerated
by the TCG vector instructions now.
QEMU_PPC_FEATURE2_DARN allows to use the new builtin
qemu_guest_getrandom() function.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190609143521.19374-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/elfload.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 9fd65708c4c4..bd43c4817df8 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -768,7 +768,13 @@ enum {
QEMU_PPC_FEATURE2_HAS_EBB = 0x10000000, /* Event Base Branching */
QEMU_PPC_FEATURE2_HAS_ISEL = 0x08000000, /* Integer Select */
QEMU_PPC_FEATURE2_HAS_TAR = 0x04000000, /* Target Address Register */
+ QEMU_PPC_FEATURE2_VEC_CRYPTO = 0x02000000,
+ QEMU_PPC_FEATURE2_HTM_NOSC = 0x01000000,
QEMU_PPC_FEATURE2_ARCH_3_00 = 0x00800000, /* ISA 3.00 */
+ QEMU_PPC_FEATURE2_HAS_IEEE128 = 0x00400000, /* VSX IEEE Bin Float 128-bit */
+ QEMU_PPC_FEATURE2_DARN = 0x00200000, /* darn random number insn */
+ QEMU_PPC_FEATURE2_SCV = 0x00100000, /* scv syscall */
+ QEMU_PPC_FEATURE2_HTM_NO_SUSPEND = 0x00080000, /* TM w/o suspended state */
};
#define ELF_HWCAP get_elf_hwcap()
@@ -822,8 +828,10 @@ static uint32_t get_elf_hwcap2(void)
GET_FEATURE(PPC_ISEL, QEMU_PPC_FEATURE2_HAS_ISEL);
GET_FEATURE2(PPC2_BCTAR_ISA207, QEMU_PPC_FEATURE2_HAS_TAR);
GET_FEATURE2((PPC2_BCTAR_ISA207 | PPC2_LSQ_ISA207 | PPC2_ALTIVEC_207 |
- PPC2_ISA207S), QEMU_PPC_FEATURE2_ARCH_2_07);
- GET_FEATURE2(PPC2_ISA300, QEMU_PPC_FEATURE2_ARCH_3_00);
+ PPC2_ISA207S), QEMU_PPC_FEATURE2_ARCH_2_07 |
+ QEMU_PPC_FEATURE2_VEC_CRYPTO);
+ GET_FEATURE2(PPC2_ISA300, QEMU_PPC_FEATURE2_ARCH_3_00 |
+ QEMU_PPC_FEATURE2_DARN);
#undef GET_FEATURE
#undef GET_FEATURE2
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PULL 6/6] linux-user: set default PPC64 CPU
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
` (4 preceding siblings ...)
2019-06-26 12:11 ` [Qemu-devel] [PULL 5/6] linux-user: update PPC64 HWCAP2 feature list Laurent Vivier
@ 2019-06-26 12:11 ` Laurent Vivier
2019-07-01 15:59 ` [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Peter Maydell
6 siblings, 0 replies; 8+ messages in thread
From: Laurent Vivier @ 2019-06-26 12:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, Laurent Vivier
The default CPU for pseries has been set to POWER9 by default.
We can use the same default for linux-user
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190609143521.19374-2-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/ppc/target_elf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/ppc/target_elf.h b/linux-user/ppc/target_elf.h
index 576a5b9959f4..061661885423 100644
--- a/linux-user/ppc/target_elf.h
+++ b/linux-user/ppc/target_elf.h
@@ -10,7 +10,7 @@
static inline const char *cpu_get_model(uint32_t eflags)
{
#ifdef TARGET_PPC64
- return "POWER8";
+ return "POWER9";
#else
return "750";
#endif
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
` (5 preceding siblings ...)
2019-06-26 12:11 ` [Qemu-devel] [PULL 6/6] linux-user: set default PPC64 CPU Laurent Vivier
@ 2019-07-01 15:59 ` Peter Maydell
6 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2019-07-01 15:59 UTC (permalink / raw)
To: Laurent Vivier; +Cc: Riku Voipio, QEMU Developers
On Wed, 26 Jun 2019 at 13:18, Laurent Vivier <laurent@vivier.eu> wrote:
>
> The following changes since commit 474f3938d79ab36b9231c9ad3b5a9314c2aeacde:
>
> Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-jun-21-2019' into staging (2019-06-21 15:40:50 +0100)
>
> are available in the Git repository at:
>
> git://github.com/vivier/qemu.git tags/linux-user-for-4.1-pull-request
>
> for you to fetch changes up to b50d1e42a4a7dc746ecd42c34c386d81a997759c:
>
> linux-user: set default PPC64 CPU (2019-06-24 23:10:36 +0200)
>
> ----------------------------------------------------------------
> Update ppc64 feature and default CPU
> next setsockops() options
> Improve "-L" option
> Another fix for 5.2-rc1 headers
>
> ----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.1
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-07-01 21:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 12:11 [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 1/6] util/path: Do not cache all filenames at startup Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 2/6] linux-user: emulate msgsnd(), msgrcv() and semtimedop() Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 3/6] linux-user: Add support for setsockopt() option SOL_ALG Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 4/6] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 5/6] linux-user: update PPC64 HWCAP2 feature list Laurent Vivier
2019-06-26 12:11 ` [Qemu-devel] [PULL 6/6] linux-user: set default PPC64 CPU Laurent Vivier
2019-07-01 15:59 ` [Qemu-devel] [PULL 0/6] Linux user for 4.1 patches Peter Maydell
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).