Thread (67 messages) 67 messages, 11 authors, 2020-09-23

Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag

flat view

From: Andy Lutomirski <luto@kernel.org>
Date: 2020-09-20 00:14:57
Also in: io-uring, keyrings, linux-arch, linux-block, linux-fsdevel, linux-mips, linux-mm, linux-s390, linux-scsi, linux-security-module, linuxppc-dev, lkml, netdev, sparclinux

On Sat, Sep 19, 2020 at 4:24 PM Al Viro [off-list ref] wrote:
On Sat, Sep 19, 2020 at 03:53:40PM -0700, Andy Lutomirski wrote:
quoted
quoted
It would not be a win - most of the syscalls don't give a damn
about 32bit vs. 64bit...
Any reasonable implementation would optimize it out for syscalls that don’t care.  Or it could be explicit:

DEFINE_MULTIARCH_SYSCALL(...)
1) what would that look like?
In effect, it would work like this:

/* Arch-specific, but there's a generic case for sane architectures. */
enum syscall_arch {
  SYSCALL_NATIVE,
  SYSCALL_COMPAT,
  SYSCALL_X32,
};

DEFINE_MULTIARCH_SYSCALLn(args, arch)
{
  args are the args here, and arch is the arch.
}
2) have you counted the syscalls that do and do not need that?
No.
3) how many of those realistically *can* be unified with their
compat counterparts?  [hint: ioctl(2) cannot]
There would be no requirement to unify anything.  The idea is that
we'd get rid of all the global state flags.

For ioctl, we'd have a new file_operation:

long ioctl(struct file *, unsigned int, unsigned long, enum syscall_arch);

I'm not saying this is easy, but I think it's possible and the result
would be more obviously correct than what we have now.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help