[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 81/87] linux-user: Add support for statx() sy
From: |
Aleksandar Markovic |
Subject: |
Re: [Qemu-devel] [PATCH v8 81/87] linux-user: Add support for statx() syscall for all platforms |
Date: |
Mon, 20 Aug 2018 09:45:11 +0000 |
> From: Timothy Baldwin <address@hidden>
> Sent: Monday, August 20, 2018 9:48 AM
>
> Subject: Re: [PATCH v8 81/87] linux-user: Add support for statx() syscall for
> all platforms
>
> On 13/08/18 18:53, Aleksandar Markovic wrote:
> > From: Aleksandar Rikalo <address@hidden>
> >
> > Implement support for translation of system call statx(). The
> > implementation includes invoking other (more mature) syscalls
> > (from the same 'stat' family) on the host side. This way,
> > problems of availability of statx() on the host side are
> > avoided.
> >
> > Signed-off-by: Aleksandar Markovic <address@hidden>
> > Signed-off-by: Stefan Markovic <address@hidden>
> > ---
> > linux-user/syscall.c | 121
> > +++++++++++++++++++++++++++++++++++++++++++++-
> > linux-user/syscall_defs.h | 38 +++++++++++++++
> > 2 files changed, 158 insertions(+), 1 deletion(-)
> >
>
>
> > + if ((p == NULL) || (*((char *)p) == 0)) {
> > + /* By file descriptor */
> > + ret = get_errno(fstat(dirfd, &st));
> > + unlock_user(p, arg2, 0);
> > + } else if (*((char *)p) == '/') {
> > + /* Absolute pathname */
> > + ret = get_errno(stat(path(p), &st));
> > + unlock_user(p, arg2, 0);
> > + } else {
> > + if (dirfd == AT_FDCWD) {
> > + /* Pathname relative to the current working directory
> > */
> > + ret = get_errno(stat(path(p), &st));
> > + unlock_user(p, arg2, 0);
> > + } else {
> > + /*
> > + * Pathname relative to the directory referred to by
> > the
> > + * file descriptor dirfd
> > + */
> > + ret = get_errno(fstatat(dirfd, path(p), &st, flags));
> > + unlock_user(p, arg2, 0);
> > + }
> > + }
>
> This doesn't correctly handle the flags argument, it is ignored unless a
> relative path and directory file descriptor is provided.
Hi, Timothy.
Agreed. The patch generally needs certain improvements wrt handling original
statx() arguments. I would certianly add handling the mask argument.
> As such an implementation of lstat that uses statx will be broken.
>
> Since fstatat exists since 2.6.16 this can be reduced to a call to fstatat.
I am not sure what you meant here. I think QEMU lstat() implementation does not
use statx(). This implementation of statx() uses hosts's statx(), and, as a
fallback, host's fstat(), stat(), and fstatat().
I would like to add that I think this patch should be submitted separately, out
of this series.
Yours,
Aleksandar
- [Qemu-devel] [PATCH v8 58/87] elf: Add EM_NANOMIPS value as a valid one for e_machine field, (continued)
- [Qemu-devel] [PATCH v8 58/87] elf: Add EM_NANOMIPS value as a valid one for e_machine field, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 75/87] linux-user: Add target_structs.h header for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 74/87] linux-user: Add target_cpu.h header for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 60/87] elf: Don't check FCR31_NAN2008 bit for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 71/87] linux-user: Add target_fcntl.h header for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 80/87] linux-user: Amend support for sigaction() syscall for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 70/87] linux-user: Update syscall_defs.h header for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 81/87] linux-user: Add support for statx() syscall for all platforms, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 73/87] linux-user: Add target_syscall.h header for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 85/87] gdbstub: Disable handling of nanoMIPS ISA bit in the MIPS gdbstub, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 67/87] linux-user: Add syscall numbers for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 32/87] target/mips: Add emulation of some common nanoMIPS 32-bit instructions, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 44/87] target/mips: Implement MT ASE support for nanoMIPS, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 48/87] target/mips: Add emulation of DSP ASE for nanoMIPS - part 4, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 66/87] elf: Add nanoMIPS specific variations in ELF header fields, Aleksandar Markovic, 2018/08/13
- [Qemu-devel] [PATCH v8 76/87] linux-user: Add target_elf.h header for nanoMIPS, Aleksandar Markovic, 2018/08/13