Internships/ProjectIdeas/ExtendLinuxUserSyscalls

From QEMU
Jump to navigation Jump to search

Extend linux-user syscalls and ioctls

Summary: Implement new or missing syscalls in linux-user.

Background

Although QEMU is often used to run a full virtual machine with a guest operating system inside, it also supports running individual applications on top of the host operating systems. QEMU's linux-user mode translates a program's CPU instructions and emulates Linux system calls so that an ARM Linux executable can execute on an x86 host, for example.

There are currently 2500+ ioctls defined in the Linux kernel. QEMU linux-user currently supports only several hundred. There is a constant need for expanding ioctl support in QEMU. Users use Linux-user mode in variety of setups (for example, building and testing tools and applications under chroot environment), and, on a regular basis, efforts by multiple people are made to fill in missing support.

Regarding syscall support in QEMU linux-user, the coverage is much better than in case of ioctls. However, kernel syscall interface continuously develops and grows, and QEMU linux-user support usually lags considerably. The support for new syscalls is usually left unimplemented, until an end user reports that it is missing in hers/his usage scenario.

In conclusion, the efforts for supporting ioctls and syscalls in QEMU have usually been done on a piece-by-piece basis, in a limited way covering a particular need. This project will take more proactive stance by improving QEMU before users try applications that fail due to missing functionality.

The contributions of this project will be mostly to QEMU, but some parts will also extend LTP (Linux Test Project).

PART I:

  1. Add strace support for printing the third argument of ioctl() (be it int, string, structure or array) - limited to selected ioctls that are frequently used.
  2. Add strace support for printing the arguments of selected syscalls that are frequently used, and not covered in QEMU strace module so far.

PART II:

  1. Amend support for existing groups of ioctls that are not completed 100% (e.g. filesystem ioctls)
  2. Add support for a selected group of ioctls that are not currently supported (e.g. DM ioctls, Bluetooth ioctls, or Radeon DRM ioctls)
  3. Add support for a selected group of syscalls that were recently introduced in kernel.

PART III:

  1. Within LTP (Linux Test Project), develop unit tests for selected ioctls that are supported in QEMU (including some whose support is developed in PART II).
  2. Within LTP (Linux Test Project), develop unit tests for selected syscalls that are supported in QEMU (including some whose support is developed in PART II).

Deliverables

The deliverables are in the form of source code for each part, intended to be upstreamed to either QEMU or LTP open source projects. The time needed for upstreaming (addressing reviews, etc.) process is included into this project. The delivery of results can and should be distributed over larger period of time (2-3 months).

Links:

Details:

  • Skill level: intermediate
  • Language: C
  • Mentor: Laurent Vivier <laurent@vivier.eu>
  • Suggested by: Aleksandar Markovic <amarkovic@wavecomp.com>