On Mon, 2007-06-25 at 12:09 +0100, Russell King wrote: > On Mon, Jun 25, 2007 at 04:35:35AM -0600, Matthew Wilcox wrote: > > On Mon, Jun 25, 2007 at 02:11:45AM -0700, Andrew Morton wrote: > > > ABI. How would you like "it would be nice if maintainers of oddball > > > architectures would pay attention"? > > > > If new syscalls got posted to linux-arch for discussion, I assure you, > > we'd pay attention. > > Ditto. sys_sync_file_range() wasn't, so I think David's sentiment is > bang on. > > And as David says, we've _finally_ been round the discussion loop with > fallocate, so in theory we now know what the issues are, and we _all_ > have a good idea how to deal with argument ordering to satisfy the > majority. That should mean that subsequent discussion be shorter.
Well, those who were paying attention might. We should probably add Documentation/new-syscalls.txt with such information as... --- Never add any system call without considering how its prototype works for all architectures and for 32-bit userspace on 64-bit kernels. - Some architectures have a limit of 6 (32-bit) argument slots. - Some architectures must align 64-bit integers into an aligned pair of registers. A slot may be wasted for padding. - S390 may not have a 64-bit integer in slots 5/6. Where you invent a data structure for communication with userspace, be aware of the following: - Try to ensure your data structure will be identical for 32-bit and 64-bit builds, if possible. That way, you avoid the need to implement compatibility routines for 32-bit userspace on 64-bit kernels. In particular, avoid the 'long' data type. Try to use explicitly sized types such as 'uint64_t' instead. - Most architectures align 64-bit integers to 8 bytes, but i386 doesn't. If you have to implement 32-bit compatibility, make sure you get this right. Preferably, avoid the problem by ensuring that your 64-bit integers are naturally placed with 8-byte alignment even without padding. --- > At least now, if they don't, provided we build every -rc kernel as it's > released, we can detect when new syscalls are added quickly and give > those submitters a suitable roasting at gas mark 95. Linus should be refusing any new system call which doesn't at _least_ handle the 32/64 compatibility issues. Explictly stating that it doesn't need compatibility wrappers would be OK, as long as it's true -- but just saying _nothing_ about it is bad. -- dwmw2 - To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
