All of lore.kernel.org
 help / color / mirror / Atom feed
From: puchuu <1858461@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Bug 1858461] Re: Please refactor linux-user/mips/cpu_loop.c
Date: Mon, 06 Jan 2020 23:32:39 -0000	[thread overview]
Message-ID: <157835355989.5838.7830680062358364120.malone@gac.canonical.com> (raw)
In-Reply-To: 157833123209.15024.12557979334447840996.malonedeb@wampee.canonical.com

Please do not use previous workaround in prod, it is bad, just proof of
concept.

It looks like nobody is maintaining syscall list. It is not possible to
trust it.

We have "arch/mips/kernel/syscalls/syscall_o32.tbl", we need to create
generator. Generator should provide maximum possible number of arguments
for syscall. For example:

> sync_file_range  sys_sync_file_range  sys32_sync_file_range

"sys_sync_file_range" has 4 arguments, "sys32_sync_file_range" - 7
arguments. Maximum value - 7 should be stored inside our table.

The problem is that some syscalls in kernel code is prefixed by
SYSCALL_DEFINE{N} or COMPAT_SYSCALL_DEFINE{N}. but some (like
"sys_sync_file_range" and "sys32_sync_file_range") are not prefixed.

So I think we may have a generator that provides "WAT?" if it don't know
the arguments count and require to update value manualy.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1858461

Title:
  Please refactor linux-user/mips/cpu_loop.c

Status in QEMU:
  New

Bug description:
  Hello. I am working with qemu on test images. I've added a new syscall
  (436) to qemu but received ENOSYS from mips application.

  Please open "linux-user/mips/cpu_loop.c". I've added at the end of
  "mips_syscall_args" the following:

  ```
  MIPS_SYS(sys_getdents64_x32, 3)
  ```

  But

  ```
  syscall_num = env->active_tc.gpr[2] - 4000;
  if (syscall_num >= sizeof(mips_syscall_args)) {
    ret = -TARGET_ENOSYS;
  ```

  returns -TARGET_ENOSYS

  We can see that "linux-user/mips/cpu_loop.c" differs a lot from
  "linux-user/arm/cpu_loop.c". Arm has it's own "ARM_NR_BASE" and etc.

  Can you please refactor mips cpu loop in the same way as arm? Thank
  you.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1858461/+subscriptions


  parent reply	other threads:[~2020-01-06 23:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 17:20 [Bug 1858461] [NEW] Please refactor linux-user/mips/cpu_loop.c puchuu
2020-01-06 17:21 ` [Bug 1858461] " puchuu
2020-01-06 23:32 ` puchuu [this message]
2020-01-06 23:38 ` puchuu
2020-01-07 10:37   ` Thomas Huth
2020-01-07 13:17 ` puchuu
2020-01-07 13:53 ` puchuu
2020-01-07 19:07 ` puchuu
2020-01-07 23:42 ` Aleksandar Markovic
2020-01-08 16:32 ` Aleksandar Markovic
2020-01-08 16:56 ` puchuu
2020-01-08 17:56   ` Peter Maydell
2020-01-08 17:56     ` Peter Maydell
2020-01-08 16:56 ` puchuu
2020-01-08 16:58 ` puchuu
2020-01-08 18:13 ` puchuu
2020-01-08 18:45 ` Aleksandar Markovic
2020-01-08 18:49 ` Aleksandar Markovic
2020-01-08 19:58 ` Aleksandar Markovic
2020-01-08 19:59 ` puchuu
2020-01-15 21:23 ` puchuu
2020-11-17 11:05 ` Philippe Mathieu-Daudé
2021-05-02 18:20 ` Thomas Huth
2021-05-09 16:03 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157835355989.5838.7830680062358364120.malone@gac.canonical.com \
    --to=1858461@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.