Thread (49 messages) flat view 49 messages, 7 authors, 2022-11-03

Re: [PATCH v6 13/25] powerpc: Remove direct call to mmap2 syscall handlers

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2022-09-28 13:02:03

On Wed, Sep 28, 2022, at 2:15 PM, Michael Ellerman wrote:
But I think it makes more sense to do the same as mmap2() and pass the
4K offset through, and pass shift = PAGE_SHIFT - 12. I also borrowed the
"off_4k" name from arm64. End result:

#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE6(mmap2,
		       unsigned long, addr, size_t, len,
		       unsigned long, prot, unsigned long, flags,
		       unsigned long, fd, unsigned long, off_4k)
{
	return do_mmap2(addr, len, prot, flags, fd, off_4k, PAGE_SHIFT-12);
}
#endif

With that my G5 boots again :)
Any chance we can instead add a working compat_sys_mmap2/sys_mmap2
in mm/mmap.c alongside the sys_mmap_pgoff implementation?

While sys_mmap_pgoff() was meant to replace the various sys_mmap2()
implementations, I think it was ultimately a mistake, and we later
converged on the sys_mmap2() calling conventions with 12 bits
offset for almost all 32-bit architectures.

   Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help