Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160…
Browse files Browse the repository at this point in the history
…719-2' into staging

linux-user fixes before 2.7 freeze, fix commit message

# gpg: Signature made Tue 19 Jul 2016 14:18:54 BST
# gpg:                using RSA key 0xB44890DEDE3C9BC0
# gpg: Good signature from "Riku Voipio <[email protected]>"
# gpg:                 aka "Riku Voipio <[email protected]>"
# Primary key fingerprint: FF82 03C8 C391 98AE 0581  41EF B448 90DE DE3C 9BC0

* remotes/riku/tags/pull-linux-user-20160719-2:
  linux-user: AArch64 has sync_file_range, not sync_file_range2
  linux-user: Fix type for SIOCATMARK ioctl
  linux-user: define missing sparc syscalls
  linux-user: Fix terminal control ioctls
  linux-user: Add some new blk ioctls
  linux-user: Handle short lengths in host_to_target_sockaddr()
  linux-user: Forget about synchronous signal once it is delivered
  linux-user: Correct type for LOOP_GET_STATUS{,64} ioctls
  linux-user: Correct type for BLKSSZGET
  linux-user: Add loop control ioctls
  linux-user: Check sigsetsize argument to syscalls
  linux-user: add nested netlink types
  linux-user: convert sockaddr_ll from host to target
  linux-user: add fd_trans helper in do_recvfrom()
  linux-user: fix netlink memory corruption
  linux-user: fd_trans_*_data() returns the length

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Jul 20, 2016
2 parents 5d32173 + c4e1cbd commit 1ecfb24
Show file tree
Hide file tree
Showing 9 changed files with 516 additions and 40 deletions.
3 changes: 1 addition & 2 deletions linux-user/aarch64/syscall_nr.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
#define TARGET_NR_sync 81
#define TARGET_NR_fsync 82
#define TARGET_NR_fdatasync 83
#define TARGET_NR_sync_file_range2 84
/* #define TARGET_NR_sync_file_range 84 */
#define TARGET_NR_sync_file_range 84
#define TARGET_NR_timerfd_create 85
#define TARGET_NR_timerfd_settime 86
#define TARGET_NR_timerfd_gettime 87
Expand Down
41 changes: 37 additions & 4 deletions linux-user/ioctls.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,39 @@
IOCTL(BLKFLSBUF, 0, TYPE_NULL)
IOCTL(BLKRASET, 0, TYPE_INT)
IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG))
IOCTL(BLKSSZGET, IOC_R, MK_PTR(TYPE_LONG))
IOCTL(BLKSSZGET, IOC_R, MK_PTR(TYPE_INT))
IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT))
IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg,
MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg)))

#ifdef BLKDISCARD
IOCTL(BLKDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
#endif
#ifdef BLKIOMIN
IOCTL(BLKIOMIN, IOC_R, MK_PTR(TYPE_INT))
#endif
#ifdef BLKIOOPT
IOCTL(BLKIOOPT, IOC_R, MK_PTR(TYPE_INT))
#endif
#ifdef BLKALIGNOFF
IOCTL(BLKALIGNOFF, IOC_R, MK_PTR(TYPE_INT))
#endif
#ifdef BLKPBSZGET
IOCTL(BLKPBSZGET, IOC_R, MK_PTR(TYPE_INT))
#endif
#ifdef BLKDISCARDZEROES
IOCTL(BLKDISCARDZEROES, IOC_R, MK_PTR(TYPE_INT))
#endif
#ifdef BLKSECDISCARD
IOCTL(BLKSECDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
#endif
#ifdef BLKROTATIONAL
IOCTL(BLKROTATIONAL, IOC_R, MK_PTR(TYPE_SHORT))
#endif
#ifdef BLKZEROOUT
IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
#endif

#ifdef FIBMAP
IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
#endif
Expand All @@ -91,7 +120,7 @@
MK_PTR(MK_STRUCT(STRUCT_fiemap)))
#endif

IOCTL(SIOCATMARK, 0, TYPE_NULL)
IOCTL(SIOCATMARK, IOC_R, MK_PTR(TYPE_INT))
IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
IOCTL(SIOCGIFFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCSIFFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
Expand Down Expand Up @@ -322,11 +351,15 @@
IOCTL(LOOP_SET_FD, 0, TYPE_INT)
IOCTL(LOOP_CLR_FD, 0, TYPE_INT)
IOCTL(LOOP_SET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
IOCTL(LOOP_GET_STATUS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
IOCTL(LOOP_GET_STATUS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info)))
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_GET_STATUS64, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)

IOCTL(LOOP_CTL_ADD, 0, TYPE_INT)
IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT)
IOCTL(LOOP_CTL_GET_FREE, 0, TYPE_NULL)

IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget)))
IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos)))
Expand Down
11 changes: 10 additions & 1 deletion linux-user/linux_loop.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* Copied from 2.6.25 kernel headers to avoid problems on older hosts. */
/* Copied from 2.6.25 kernel headers to avoid problems on older hosts,
* and subsequently updated to match newer additions to the API.
*/

#ifndef LINUX_LOOP_H
#define LINUX_LOOP_H
Expand Down Expand Up @@ -92,5 +94,12 @@ struct loop_info64 {
#define LOOP_SET_STATUS64 0x4C04
#define LOOP_GET_STATUS64 0x4C05
#define LOOP_CHANGE_FD 0x4C06
#define LOOP_SET_CAPACITY 0x4C07
#define LOOP_SET_DIRECT_IO 0x4C08

/* /dev/loop-control interface */
#define LOOP_CTL_ADD 0x4C80
#define LOOP_CTL_REMOVE 0x4C81
#define LOOP_CTL_GET_FREE 0x4C82

#endif
8 changes: 4 additions & 4 deletions linux-user/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5826,15 +5826,15 @@ long do_rt_sigreturn(CPUArchState *env)

#endif

static void handle_pending_signal(CPUArchState *cpu_env, int sig)
static void handle_pending_signal(CPUArchState *cpu_env, int sig,
struct emulated_sigtable *k)
{
CPUState *cpu = ENV_GET_CPU(cpu_env);
abi_ulong handler;
sigset_t set;
target_sigset_t target_old_set;
struct target_sigaction *sa;
TaskState *ts = cpu->opaque;
struct emulated_sigtable *k = &ts->sigtab[sig - 1];

trace_user_handle_signal(cpu_env, sig);
/* dequeue signal */
Expand Down Expand Up @@ -5937,7 +5937,7 @@ void process_pending_signals(CPUArchState *cpu_env)
sigact_table[sig - 1]._sa_handler = TARGET_SIG_DFL;
}

handle_pending_signal(cpu_env, sig);
handle_pending_signal(cpu_env, sig, &ts->sync_signal);
}

for (sig = 1; sig <= TARGET_NSIG; sig++) {
Expand All @@ -5947,7 +5947,7 @@ void process_pending_signals(CPUArchState *cpu_env)
if (ts->sigtab[sig - 1].pending &&
(!sigismember(blocked_set,
target_to_host_signal_table[sig]))) {
handle_pending_signal(cpu_env, sig);
handle_pending_signal(cpu_env, sig, &ts->sigtab[sig - 1]);
/* Restart scan from the beginning */
sig = 1;
}
Expand Down
3 changes: 3 additions & 0 deletions linux-user/sparc/syscall_nr.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@
#define TARGET_NR_readahead 205 /* Linux Specific */
#define TARGET_NR_socketcall 206 /* Linux Specific */
#define TARGET_NR_syslog 207 /* Linux Specific */
#define TARGET_NR_lookup_dcookie 208 /* Linux Specific */
#define TARGET_NR_fadvise64 209 /* Linux Specific */
#define TARGET_NR_fadvise64_64 210 /* Linux Specific */
#define TARGET_NR_tgkill 211 /* Linux Specific */
#define TARGET_NR_waitpid 212 /* Linux Specific */
#define TARGET_NR_swapoff 213 /* Linux Specific */
Expand Down
Loading

0 comments on commit 1ecfb24

Please sign in to comment.