- 12 5月, 2018 1 次提交
-
-
由 Laurent Vivier 提交于
Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Reviewed-by: NMax Filippov <jcmvbkbc@gmail.com> Message-Id: <20180509231123.20864-2-laurent@vivier.eu>
-
- 04 5月, 2018 1 次提交
-
-
由 Laurent Vivier 提交于
Since commit 8efb2ed5 ("linux-user: Correct signedness of target_flock l_start and l_len fields"), flock64 structure uses abi_llong for l_start and l_len in place of "unsigned long long" this should force them to be aligned accordingly to the target rules. So we can remove the padding field and the QEMU_PACKED attribute. I have compared the result of the following program before and after the change: cat -> flock64_dump <<EOF p/d sizeof(struct target_flock64) p/d &((struct target_flock64 *)0)->l_type p/d &((struct target_flock64 *)0)->l_whence p/d &((struct target_flock64 *)0)->l_start p/d &((struct target_flock64 *)0)->l_len p/d &((struct target_flock64 *)0)->l_pid quit EOF for file in build/all/*-linux-user/qemu-* ; do echo $file gdb -batch -nx -x flock64_dump $file 2> /dev/null done The sizeof() changes because we remove the QEMU_PACKED. The new size is 32 (except for i386 and m68k) and this is the real size of "struct flock64" on the target architecture. The following architectures differ: aarch64_be, aarch64, alpha, armeb, arm, cris, hppa, nios2, or1k, riscv32, riscv64, s390x. For a subset of these architectures, I have checked with the following program the new structure is the correct one: #include <stdio.h> #define __USE_LARGEFILE64 #include <fcntl.h> int main(void) { printf("struct flock64 %d\n", sizeof(struct flock64)); printf("l_type %d\n", &((struct flock64 *)0)->l_type); printf("l_whence %d\n", &((struct flock64 *)0)->l_whence); printf("l_start %d\n", &((struct flock64 *)0)->l_start); printf("l_len %d\n", &((struct flock64 *)0)->l_len); printf("l_pid %d\n", &((struct flock64 *)0)->l_pid); } [I have checked aarch64, alpha, hppa, s390x] For ARM, the target_flock64 becomes the EABI definition, so we need to define the OABI one in place of the EABI one and use it when it is needed. I have also fixed the alignment value for sh4 (to align llong on 4 bytes) (see c2e3dee6 "linux-user: Define target alignment size") [We should check alignment properties for cris, nios2 and or1k] Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Message-Id: <20180502215730.28162-1-laurent@vivier.eu>
-
- 03 4月, 2018 2 次提交
-
-
由 Laurent Vivier 提交于
Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Message-Id: <20180402102453.9883-3-laurent@vivier.eu>
-
由 Laurent Vivier 提交于
Sparc as an extended sigaction structure containing the field ka_restorer used in place of sa_restorer. Define TARGET_ARCH_HAS_KA_RESTORER and use it with sparc. Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Message-Id: <20180402102453.9883-2-laurent@vivier.eu>
-
- 17 3月, 2018 1 次提交
-
-
由 Max Filippov 提交于
Import list of syscalls from the kernel source. Conditionalize code/data that is only used with softmmu. Implement exception handlers. Implement signal hander (only the core registers for now, no coprocessors or TIE). Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Laurent Vivier <laurent@vivier.eu> Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
-
- 10 3月, 2018 2 次提交
-
-
由 Shea Levy 提交于
Signed-off-by: NShea Levy <shea@shealevy.com> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Message-Id: <20180301111500.15717-1-shea@shealevy.com> Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
-
由 Peter Maydell 提交于
We dropped the unicore32-linux-user target in commit 5e2b40f7 in 2016. Nobody has made any attempt to fix the issues that caused us to drop it, so remove the associated code. (The system emulation parts of unicore32 remain.) Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Message-Id: <20180308144733.25615-2-peter.maydell@linaro.org> Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
-
- 07 3月, 2018 1 次提交
-
-
由 Michael Clark 提交于
Implementation of linux user emulation for RISC-V. Reviewed-by: NRichard Henderson <richard.henderson@linaro.org> Signed-off-by: NSagar Karandikar <sagark@eecs.berkeley.edu> Signed-off-by: NMichael Clark <mjc@sifive.com>
-
- 23 1月, 2018 1 次提交
-
-
由 Peter Maydell 提交于
The Linux struct cmsghdr is already guaranteed to be sufficiently aligned that CMSG_ALIGN(sizeof struct cmsghdr) is always equal to sizeof struct cmsghdr. Stop doing the unnecessary alignment arithmetic for host and target cmsghdr. This follows kernel commit 1ff8cebf49ed9e9ca2 and brings our TARGET_CMSG_* macros back into line with the kernel ones, as well as making them easier to understand. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Message-Id: <1513345976-22958-3-git-send-email-peter.maydell@linaro.org> Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
-
- 08 11月, 2017 5 次提交
-
-
由 Helge Deller 提交于
Add the missing defines and for TARGET_MAP_STACK and TARGET_MAP_HUGETLB for alpha, mips, ppc, x86, hppa. Fix the mmap_flags translation table to translate MAP_HUGETLB between host and target architecture, and to drop MAP_STACK. Signed-off-by: NHelge Deller <deller@gmx.de> Message-Id: <20170311183016.GA20514@ls3530.fritz.box> [rth: Drop MAP_STACK instead of translating it, since it is ignored in the kernel anyway. Fix tabs to spaces.] Signed-off-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Helge Deller 提交于
Signed-off-by: NHelge Deller <deller@gmx.de> Signed-off-by: NRichard Henderson <rth@twiddle.net> Message-ID: <20170311175019.GA7195@ls3530.fritz.box> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Helge Deller 提交于
TARGET_MAP_TYPE needs to be 0x03 instead of 0x0f on the hppa architecture, otherwise it conflicts with MAP_FIXED which is 0x04. Signed-off-by: NHelge Deller <deller@gmx.de> Signed-off-by: NRichard Henderson <rth@twiddle.net> Message-ID: <20170311175019.GA7195@ls3530.fritz.box> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Helge Deller 提交于
Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NHelge Deller <deller@gmx.de> Signed-off-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Richard Henderson 提交于
Reading and writing to an sa_restorer member that isn't supposed to exist corrupts user memory. Introduce TARGET_ARCH_HAS_SA_RESTORER, similar to the kernel's __ARCH_HAS_SA_RESTORER. Reported-by: NHelge Deller <deller@gmx.de> Signed-off-by: NRichard Henderson <rth@twiddle.net> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
- 18 10月, 2017 1 次提交
-
-
由 Peter Maydell 提交于
The TARGET_MTIOCTOP/TARGET_MTIOCGET/TARGET_MTIOCPOS values were being defined in terms of host struct types, but these structures are such that their size might differ on different hosts. Switch to using a target struct definition instead. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
- 17 10月, 2017 1 次提交
-
-
由 Marco A L Barbosa 提交于
Signed-off-by: NMarco A L Barbosa <malbarbo@gmail.com> Reviewed-by: NLaurent Vivier <lvivier@redhat.com> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 16 10月, 2017 2 次提交
-
-
由 Peter Maydell 提交于
We were defining TARGET_FS_IOC_GETFLAGS and TARGET_FS_IOC_SETFLAGS using the host 'long' type in the size field, which meant that they had the wrong values if the host and guest had different sized longs. Switch to abi_long instead. This fixes a bug where these ioctls don't work on 32-bit guests on 64-bit hosts (and makes the LTP test 'setxattr03' pass where it did not previously.) Reported-by: Npgndev <pgnet.dev@gmail.com> Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Riku Voipio 提交于
Since O_TMPFILE might differ between guest and host, add it to the bitmask_transtbl. While at it, fix the definitions of O_DIRECTORY etc which should arm32 according to kernel sources. This fixes open14 and openat03 ltp testcases. Fixes: https://bugs.launchpad.net/qemu/+bug/1709170
-
- 28 2月, 2017 1 次提交
-
-
由 Helge Deller 提交于
Add the neccessary sockopts for ping and traceroute on IPv6. This fixes the following qemu warnings with IPv6: Unsupported ancillary data: 0/2 Unsupported ancillary data: 0/11 Unsupported ancillary data: 41/25 Unsupported setsockopt level=0 optname=12 Unsupported setsockopt level=41 optname=16 Unsupported setsockopt level=41 optname=25 Unsupported setsockopt level=41 optname=50 Unsupported setsockopt level=41 optname=51 Unsupported setsockopt level=41 optname=8 Unsupported setsockopt level=58 optname=1 Tested with hppa-linux-user (big-endian) on x86_64 (little-endian). Signed-off-by: NHelge Deller <deller@gmx.de> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Tested-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170218223130.GA25278@ls3530.fritz.box> Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
-
- 16 2月, 2017 1 次提交
-
-
由 Helge Deller 提交于
Add missing FICLONE and FICLONERANGE ioctls. Signed-off-by: NHelge Deller <deller@gmx.de> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Message-Id: <20170211222602.GA6399@ls3530.fritz.box> Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
-
- 25 1月, 2017 1 次提交
-
-
由 Marek Vasut 提交于
Add missing bits for qemu-user required for emulating Altera Nios2 userspace binaries. Signed-off-by: NMarek Vasut <marex@denx.de> Cc: Chris Wulff <crwulff@gmail.com> Cc: Jeff Da Silva <jdasilva@altera.com> Cc: Ley Foon Tan <lftan@altera.com> Cc: Sandra Loosemore <sandra@codesourcery.com> Cc: Yves Vandervennet <yvanderv@altera.com> Reviewed-by: NAlexander Graf <agraf@suse.de> Message-Id: <20170118220146.489-4-marex@denx.de> Signed-off-by: NRichard Henderson <rth@twiddle.net>
-
- 24 1月, 2017 2 次提交
-
-
由 Richard Henderson 提交于
-
由 Helge Deller 提交于
Add F_GETLK, F_SETLK, F_SETLKW, F_GETOWN, F_SETOWN, F_SETSIG, F_GETSIG, F_GETLK64, F_SETLK64 and F_SETLKW64 for hppa. Signed-off-by: NHelge Deller <deller@gmx.de> Signed-off-by: NRichard Henderson <rth@twiddle.net>
-
- 23 1月, 2017 2 次提交
-
-
由 Helge Deller 提交于
Mirror syscall_defs.h for the element type of struct timeval and struct timespec, even though that's not 100% accurate for each guest. Signed-off-by: NHelge Deller <deller@gmx.de> [rth: Changed the MK_ARRAY types as per above; added ioctl.h entries.] Signed-off-by: NRichard Henderson <rth@twiddle.net>
-
由 Richard Henderson 提交于
This reverts commit d41f3c3c. Signed-off-by: NRichard Henderson <rth@twiddle.net>
-
- 21 10月, 2016 4 次提交
-
-
由 Peter Maydell 提交于
The sigevent structure includes a union with some fields which are pointers. For the QEMU target_sigevent structure we must represent these as abi_ulongs, not host function pointers. This error was causing the compiler to believe it should 8-align the _sigev_un union on a 64-bit host, which meant that the code in target_to_host_sigevent() was looking at the wrong offset to find the _tid field, and timer_create() would spuriously fail with EINVAL. This fixes the final loose end noted in LP:1042388. While we're editing the structure, switch the 'int32_t' fields to 'abi_int'; this will only matter for guests with non-standard integer alignment like m68k. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Aleksandar Markovic 提交于
There are currently several problems related to syslog() support. For example, if the second argument "bufp" of target syslog() syscall is NULL, the current implementation always returns error code EFAULT. However, NULL is a perfectly valid value for the second argument for many use cases of this syscall. This is, for example, visible from this excerpt of man page for syslog(2): > EINVAL Bad arguments (e.g., bad type; or for type 2, 3, or 4, buf is > NULL, or len is less than zero; or for type 8, the level is > outside the range 1 to 8). Moreover, the argument "bufp" is ignored for all cases of values of the first argument, except 2, 3 and 4. This means that for such cases (the first argument is not 2, 3 or 4), there is no need to pass "buf" between host and target, and it can be set to NULL while calling host's syslog(), without loss of emulation accuracy. Note also that if "bufp" is NULL and the first argument is 2, 3 or 4, the correct returned error code is EINVAL, not EFAULT. All these details are reflected in this patch. "#ifdef TARGET_NR_syslog" is also proprerly inserted when needed. Support for Qemu's "-strace" switch for syslog() syscall is included too. LTP tests syslog11 and syslog12 pass with this patch (while fail without it), on any platform. Changes to original patch by Riku Voipio: fixed error paths in TARGET_SYSLOG_ACTION_READ_ALL to match http://lxr.free-electrons.com/source/kernel/printk/printk.c?v=4.7#L1335 Should fix also the build error in: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg03721.htmlSigned-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Aleksandar Markovic 提交于
Since not all Linux host platforms support socketcall() (most notably Intel), do_socketcall() function in Qemu's syscalls.c is implemented to mirror the corespondant implementation of socketcall() in Linux kernel, and to utilise individual socket operations that are supported on all Linux platforms. (see kernel source file net/socket.c, definition of socketcall). However, error codes produced by Qemu implementation are wrong for the cases of invalid values of the first argument. Also, naming of constants is not consistent with kernel one, and not consistant with Qemu convention of prefixing such constants with "TARGET_". This patch in that light brings do_socketcall() closer to its kernel counterpart, and in that way fixes the errors and yields more consisrtent Qemu code. There were also three missing cases (among 20) for strace support for socketcall(). The array that contains pointers for appropriate printing functions is updated with 3 elements, however pointers to functions are left NULL, and its implementation is left for future. Also, this patch fixes failure of LTP test socketcall02, if executed on some Qemu emulated sywstems (uer mode). Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Aleksandar Markovic 提交于
This patch implements Qemu user mode adjtimex() syscall support. Syscall adjtimex() reads and optionally sets parameters for a clock adjustment algorithm used in network synchonization or similar scenarios. Its declaration is: int adjtimex(struct timex *buf); The correspondent source code in the Linux kernel is at kernel/time.c, line 206. The Qemu implementation is based on invocation of host's adjtimex(), and its key part is in the "TARGET_NR_adjtimex" case segment of the the main switch statement of the function do_syscall(), in linux-user/syscalls.c. All necessary conversions of the data structures from target to host and from host to target are covered. Two new functions, target_to_host_timex() and host_to_target_timex(), are provided for the purpose of such conversions. For that purpose, the support for related structure "timex" had tp be added to the file linux-user/syscall_defs.h, based on its definition in Linux kernel. Also, the relevant support for "-strace" Qemu option is included in files linux-user/strace.c and linux-user/strace.list. This patch also fixes failures of LTP tests adjtimex01 and adjtimex02, if executed in Qemu user mode. Signed-off-by: NAleksandar Rikalo <aleksandar.rikalo@imgtec.com> Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
- 23 9月, 2016 3 次提交
-
-
由 Aleksandar Markovic 提交于
Structure flock is defined for Mips in a way different from any other platform. For reference, see Linux kernel source code files: arch/mips/include/uapi/asm/fcntl.h, line 63 (for Mips) include/uapi/asm-generic/fcntl.h, line 195 (for all other platforms) This patch fix this problem, by amending structure target_flock, for Mips only. Besides, this patch fixes LTP tests fcntl11, fcntl17, fcntl19, fcntl20, and fcntl21, which are currently failing, if executed in Qemu user mode for Mips platforms. Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Reviewed-by: NLeon Alrae <leon.alrae@imgtec.com> Acked-by: NRiku Voipio <riku.voipio@linaro.org> Signed-off-by: NLeon Alrae <leon.alrae@imgtec.com>
-
由 Aleksandar Markovic 提交于
For some reason, Qemu's TARGET_F_GETOWN constant for Mips does not match the correct value of correspondent F_GETOWN. This patch fixes this problem. For reference, see Mips' F_GETOWN definition in Linux kernel at arch/mips/include/uapi/asm/fcntl.h#L44. This patch also fixes some fcntl()-related LTP tests for Qemu user mode for Mips. Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com> Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Reviewed-by: NLeon Alrae <leon.alrae@imgtec.com> Acked-by: NRiku Voipio <riku.voipio@linaro.org> Signed-off-by: NLeon Alrae <leon.alrae@imgtec.com>
-
由 Aleksandar Markovic 提交于
This patch fixes wrong definition of TARGET_SIOCATMARK for mips, alpha, and sh4. The current definition is: #define SIOCATMARK 0x8905 while the correct definition is: #define SIOCATMARK TARGET_IOR('s', 7, int) See Linux kernel source file arch/mips/include/uapi/asm/sockios.h#L19 for reference. This patch also a fixes LTP test failure for test sockioctl01, for mips, alpha, and sh4. Signed-off-by: NAleksandar Rikalo <aleksandar.rikalo@imgtec.com> Signed-off-by: NAleksandar Markovic <aleksandar.markovic@imgtec.com> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Reviewed-by: NLeon Alrae <leon.alrae@imgtec.com> Acked-by: NRiku Voipio <riku.voipio@linaro.org> Signed-off-by: NLeon Alrae <leon.alrae@imgtec.com>
-
- 21 9月, 2016 2 次提交
-
-
由 Peter Maydell 提交于
The kernel checks that the maxevents parameter to epoll_wait is non-negative and not larger than EP_MAX_EVENTS. Add this check to our implementation, so that: * we fail these cases EINVAL rather than EFAULT * we don't pass negative or overflowing values to the lock_user() size calculation Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Peter Maydell 提交于
Implement the FS_IOC_GETFLAGS and FS_IOC_SETFLAGS ioctls, as used by chattr. Note that the type information encoded in these ioctl numbers is at odds with the actual type the kernel accesses, as discussed in http://thread.gmane.org/gmane.linux.file-systems/80164. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
- 15 9月, 2016 1 次提交
-
-
由 Thomas Huth 提交于
The HPPA backend has been removed by the following commit: 802b5081 tcg-hppa: Remove tcg backend But some small pieces of the HPPA backend still survived until today. Since we also do not have support for a HPPA target in QEMU, we can nowadays safely remove the remaining HPPA parts (like the disassembler code, or the detection of HPPA in the configure script). Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 19 7月, 2016 2 次提交
-
-
由 Peter Maydell 提交于
Add some new blk ioctls (these are 0x12,119 through to 0x12,127). Several of these are used by mke2fs; this silences the warnings: mke2fs 1.42.12 (29-Aug-2014) Unsupported ioctl: cmd=0x127b Unsupported ioctl: cmd=0x127a warning: Unable to get device geometry for /dev/loop5 Unsupported ioctl: cmd=0x127c Unsupported ioctl: cmd=0x127c Unsupported ioctl: cmd=0x1277 Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
由 Peter Maydell 提交于
Add support for the /dev/loop-control ioctls: LOOP_CTL_ADD LOOP_CTL_REMOVE LOOP_CTL_GET_FREE [RV: fixed to apply to new header guards] Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-
- 12 7月, 2016 1 次提交
-
-
由 Markus Armbruster 提交于
Found with scripts/clean-header-guards.pl. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NRichard Henderson <rth@twiddle.net>
-
- 26 6月, 2016 2 次提交
-
-
由 Laurent Vivier 提交于
Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org> Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
-
由 Peter Maydell 提交于
Support the F_GETPIPE_SZ and F_SETPIPE_SZ fcntl operations. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
-