From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: align shared memory unconditionally to the SHMLBA boundary
Date: Tue, 16 Jul 2013 12:07:21 +0100 [thread overview]
Message-ID: <20130716110721.GD24642@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <51E524D1.2090504@parallels.com>
On Tue, Jul 16, 2013 at 02:47:45PM +0400, Alexander Kartashov wrote:
> On 07/16/2013 02:36 PM, Russell King - ARM Linux wrote:
>> shmget() doesn't allocate space in the process for the SHM region. It
>> merely creates the shm memory and returns an identifier for it which can
>> later be used by shmat() to map it.
> Thank you for the correction, I meant shmat() in that comment indeed.
> I'm sorry for the inconvenience.
Right, so it appears that there's a difference between shmat() with an
address and with a NULL address, because the enforcement is done by two
completely different bits of code in unrelated parts of the kernel.
I notice Sparc32 seems to have a fix for this along the lines of the
(untested) patch below, so let's do the same on ARM. Please test this
and let me know if this solves your problem.
Thanks.
arch/arm/include/asm/shmparam.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/include/asm/shmparam.h b/arch/arm/include/asm/shmparam.h
index a5223b3..843db59 100644
--- a/arch/arm/include/asm/shmparam.h
+++ b/arch/arm/include/asm/shmparam.h
@@ -1,16 +1,16 @@
#ifndef _ASMARM_SHMPARAM_H
#define _ASMARM_SHMPARAM_H
+#include <asm/cachetype.h>
+
/*
* This should be the size of the virtually indexed cache/ways,
* or page size, whichever is greater since the cache aliases
* every size/ways bytes.
*/
-#define SHMLBA (4 * PAGE_SIZE) /* attach addr a multiple of this */
+#define SHMLBA (cache_is_vipt_aliasing() ? (4 * PAGE_SIZE) : PAGE_SIZE)
-/*
- * Enforce SHMLBA in shmat
- */
+/* Enforce SHMLBA in shmat */
#define __ARCH_FORCE_SHMLBA
#endif /* _ASMARM_SHMPARAM_H */
next prev parent reply other threads:[~2013-07-16 11:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 6:11 [PATCH] arm: align shared memory unconditionally to the SHMLBA boundary Alexander Kartashov
2013-07-15 17:32 ` Cyrill Gorcunov
2013-07-15 18:08 ` Russell King - ARM Linux
2013-07-15 18:57 ` Cyrill Gorcunov
2013-07-16 5:37 ` Alexander Kartashov
2013-07-16 9:53 ` Cyrill Gorcunov
2013-07-16 10:22 ` Alexander Kartashov
2013-07-16 10:36 ` Russell King - ARM Linux
2013-07-16 10:47 ` Alexander Kartashov
2013-07-16 11:07 ` Russell King - ARM Linux [this message]
2013-07-16 13:12 ` Alexander Kartashov
2013-08-16 8:20 ` Alexander Kartashov
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=20130716110721.GD24642@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).