[PATCH v3 0/3] linux-user/syscall.c: do_ppoll: eliminate large alloca

Michael Tokarev posted 3 patches 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230914074337.149897-1-mjt@tls.msk.ru
Maintainers: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c | 52 +++++++++++++++++++++++---------------------
1 file changed, 27 insertions(+), 25 deletions(-)
[PATCH v3 0/3] linux-user/syscall.c: do_ppoll: eliminate large alloca
Posted by Michael Tokarev 8 months ago
This is a v3 patch (now patchset) which eliminates guest-controlled
alloca from linux-user:poll.  I now split out 2 unrelated preparational
changes into its own patches, for easy review.

The small optmization which were here in v1 is still there.  In huge
number of use cases, poll() et all are called with just one file
descriptor, there's no need to use heap allocation for this, and the
code to avoid this heap allocation is already there, is short and is
easy to read too (YMMV).

This patchset passes poll- and ppoll-related LTSP tests, except of
the ppoll_time64 case (tested on ppc64):

ppoll01.c:174: TCONF: syscall(414) __NR_ppoll_time64 not supported on your arch

which was here before.

Michael Tokarev (3):
  linux-user/syscall.c: do_ppoll: simplify time64 host<=>target
    conversion expressions
  linux-user/syscall.c: do_ppoll: consolidate and fix the forgotten
    unlock_user
  linux-user/syscall.c: do_ppoll: eliminate large alloca

 linux-user/syscall.c | 52 +++++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

-- 
2.39.2