[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] linux-user: Add several IFTUN ioctls
From: |
Laurent Vivier |
Subject: |
Re: [PATCH] linux-user: Add several IFTUN ioctls |
Date: |
Tue, 14 Jul 2020 09:28:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
Le 13/07/2020 à 21:28, Laurent Vivier a écrit :
> Le 10/07/2020 à 21:53, Josh Kunz a écrit :
>> This change includes most widely-available if_tun ioctls that are
>> integer typed.
>>
>> Tested by compiling all linux-user emulators. This patch has also been
>> used successfully to run several binaries that utilize these ioctls for
>> several months.
>>
>> Linux Header:
>> https://github.com/torvalds/linux/blob/dcde237b9b0eb1d19306e6f48c0a4e058907619f/include/uapi/linux/if_tun.h#L31
>>
>> Signed-off-by: Josh Kunz <jkz@google.com>
>> ---
>> linux-user/ioctls.h | 20 ++++++++++++++++++++
>> linux-user/syscall.c | 1 +
>> linux-user/syscall_defs.h | 21 +++++++++++++++++++++
>> 3 files changed, 42 insertions(+)
>>
>> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
>> index 0713ae1311..9b4a67fe84 100644
>> --- a/linux-user/ioctls.h
>> +++ b/linux-user/ioctls.h
>> @@ -593,3 +593,23 @@
>> IOCTL(KCOV_DISABLE, 0, TYPE_NULL)
>> IOCTL(KCOV_INIT_TRACE, IOC_R, TYPE_ULONG)
>> #endif
>> +
>> + IOCTL(TUNGETFEATURES , IOC_R , TYPE_INT)
>> + IOCTL(TUNGETIFF , IOC_R , TYPE_INT)
>> + IOCTL(TUNGETSNDBUF , IOC_R , TYPE_INT)
>> + IOCTL(TUNGETVNETHDRSZ , IOC_R , TYPE_INT)
>> + IOCTL(TUNGETVNETLE , IOC_R , TYPE_INT)
>> + IOCTL(TUNSETDEBUG , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETGROUP , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETIFF , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETIFINDEX , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETLINK , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETNOCSUM , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETOFFLOAD , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETOWNER , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETPERSIST , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETQUEUE , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETSNDBUF , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETTXFILTER , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETVNETHDRSZ , IOC_W , TYPE_INT)
>> + IOCTL(TUNSETVNETLE , IOC_W , TYPE_INT)
...
>>
>
> Applied to my linux-user-for-5.1 branch.
This patch fails ioctls03 LTP tests on some archs (s390x for instance),
TUNGETFEATURES returns unknown features.
Your patch is not correct, definitions should use MK_PTR(...) rather
than TYPE_INT (and some of them are not based on int but on more complex
structures). Your patch only works with guest with same endianness and
word size.
I remove it from the queue.
Thanks,
Laurent