[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v10 3/3] linux-user: Add support for statx() sys
From: |
Jim Wilson |
Subject: |
Re: [Qemu-devel] [PATCH v10 3/3] linux-user: Add support for statx() syscall |
Date: |
Tue, 18 Jun 2019 15:06:49 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/7/19 3:35 AM, Aleksandar Markovic wrote:
Implement support for translation of system call statx().
I also need these patches for 32-bit RISC-V linux user mode support.
glibc ld.so calls statx if fstatat is not supported. Apparently new
linux architecture ports aren't allowed to define __ARCH_WANT_NEW_STAT
which enables fstatat because this is already obsolete. 64-bit RISC-V
linux does have fstatat, but apparently this was a mistake which we
can't fix now because the ABI is already frozen. The 32-bit RISC-V ABI
is not frozen yet, so it won't have fstatat. Anyways, without statx,
ld.so doesn't work, which makes user mode qemu pretty useless, so we do
need this emulated in qemu to make the 32-bit RISC-V linux user mode
support work properly.
I started with the August 2018 version of the patch a few weeks ago, and
just noticed that it has been resubmitted. I had to modify the patch
slightly to apply to current sources, and had to fix one bug to make it
work. The line
+ if (ret != TARGET_ENOSYS) {
needs to instead be
+ if (ret != -TARGET_ENOSYS) {
I see that Laurent has already pointed that out.
Incidentally, I also have strace patches for statx that work on top of
this patch, since I didn't see that in the nanomips patch set I started
with. That helped me debug the 32-bit RISC-V user mode support.
I've tested this on Ubuntu 16.04 (no host statx) and Ubuntu 19.10 (with
host statx) and it worked well for me running the gcc testsuite for a
riscv32-linux target. I haven't tried testing the latest version of the
patch yet. I can do that if this is helpful.
Jim
Re: [Qemu-devel] [PATCH v10 0/3] linux-user: A set of miscellaneous patches, Aleksandar Markovic, 2019/06/11