IPC SHM alignment on ARMv7

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Jan 31 08:47:47 EST 2013


On Thu, Jan 31, 2013 at 05:32:18PM +0400, Alexander Kartashov wrote:
> Dear colleagues,
>
> It tuned out that IPC SHM works in a bit strange way on ARMv7:
> the syscall sys_shmat() requires the argument shmaddr to be SHMLBA-aligned:
>
> [ipc/shm.c]
> [...]
>  979     else if ((addr = (ulong)shmaddr)) {
>  980         if (addr & (shmlba - 1)) {
>  981             if (shmflg & SHM_RND)
>  982                 addr &= ~(shmlba - 1);     /* round down */
>  983             else
>  984 #ifndef __ARCH_FORCE_SHMLBA
>  985                 if (addr & ~PAGE_MASK)
>  986 #endif
>  987                     goto out;
>  988         }
>  989         flags = MAP_SHARED | MAP_FIXED;
> [...]
>
> since macro __ARCH_FORCE_SHMLBA is unconditionally defined for the ARM
> architecture. However it uses the function arch_get_unmapped_area()
> introduced in the commit 4197692eef113eeb8e3e413cc70993a5e667e5b8
> in the mainstream kernel to allocate memory for a SHM segment.

Err, no.  Try again - this is the mainline kernel:

$ git log 4197692eef113eeb8e3e413cc70993a5e667e5b8
fatal: bad object 4197692eef113eeb8e3e413cc70993a5e667e5b8

Would this be in linux-next?  Maybe it's a patch which someone else has
applied which isn't in Linus' kernel?

With just the commit ID and no description (we're *constantly* harping
on about that on this list, especially in commit comments: ALWAYS provide
the description as well) it's much harder to do anything with your report.

Please try again.

Thanks.



More information about the linux-arm-kernel mailing list